annotate src/ExternalClientP.h @ 4407:4ee73bbe4f8e

Always use boyer_moore in ASCII or Latin-1 buffers with ASCII search strings. 2007-12-26 Aidan Kehoe <kehoea@parhasard.net> * casetab.c: Extend and correct some case table documentation. * search.c (search_buffer): Correct a bug where only the first entry for a character in the case equivalence table was examined in determining if the Boyer-Moore search algorithm is appropriate. If there are case mappings outside of the charset and row of the characters specified in the search string, those case mappings can be safely ignored (and Boyer-Moore search can be used) if we know from the buffer statistics that the corresponding characters cannot occur. * search.c (boyer_moore): Assert that we haven't been passed a string with varying characters sets or rows within character sets. That's what simple_search is for. In the very rare event that a character in the search string has a canonical case mapping that is not in the same character set and row, don't try to search for the canonical character, search for some other character that is in the the desired character set and row. Assert that the case table isn't corrupt. Do not search for any character case mappings that cannot possibly occur in the buffer, given the buffer metadata about its contents.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 26 Dec 2007 17:30:16 +0100
parents 74fd4e045ea6
children 697ef44129c6 2aa9cd456ae7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* External client widget internal header file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1993, 1994 Sun Microsystems, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This library is free software; you can redistribute it and/or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 modify it under the terms of the GNU Library General Public
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 License as published by the Free Software Foundation; either
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 version 2 of the License, or (at your option) any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 This library is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 Library General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 You should have received a copy of the GNU Library General Public
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 License along with this library; if not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Written by Ben Wing. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 0
diff changeset
23 #ifndef INCLUDED_ExternalClientP_h_
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 0
diff changeset
24 #define INCLUDED_ExternalClientP_h_
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #include "ExternalClient.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #include <Xm/PrimitiveP.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 typedef struct { /* new fields for ExternalClient class */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 int dummy;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 } ExternalClientClassPart;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 typedef struct _ExternalClientClassRec { /* full class record declaration */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 CoreClassPart core_class;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 XmPrimitiveClassPart primitive_class;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ExternalClientClassPart externalClient_class;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 } ExternalClientClassRec;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 typedef struct { /* new fields for ExternalClient widget */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 Bool dead_shell; /* is the shell dead? */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 unsigned long shell_timeout;/* how long to wait for shell's response */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 int shell_ready; /* is the shell ready? */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 Window event_window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 long event_mask;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 Bool has_focus;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 char *emacs_procid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 XtCallbackList shell_ready_callback;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 String shell_name;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 Bool use_tooltalk;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 } ExternalClientPart;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 typedef struct _ExternalClientRec { /* full instance record */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 CorePart core;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 XmPrimitivePart primitive;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ExternalClientPart externalClient;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 } ExternalClientRec;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 extern ExternalClientClassRec externalClientClassRec; /* class pointer */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 0
diff changeset
66 #endif /* INCLUDED_ExternalClientP_h_ */