annotate src/s/bsdos4.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 00e9371a84f3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
1 #include "bsdos3.h"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
2
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
3 /* BSD/OS seems to have switched to ELF format for executables. */
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
4 #ifdef __ELF__
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
5
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
6 #undef ORDINARY_LINK
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
7 #define ORDINARY_LINK 1
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
8 #define UNEXEC unexelf.o
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
9
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
10 #endif /* ELF */
508
0be8704d6062 [xemacs-hg @ 2001-05-05 10:21:20 by martinb]
martinb
parents: 333
diff changeset
11
0be8704d6062 [xemacs-hg @ 2001-05-05 10:21:20 by martinb]
martinb
parents: 333
diff changeset
12 /* The declaration for openpty is missing. Where is libutil.h? */
517
00e9371a84f3 [xemacs-hg @ 2001-05-08 05:16:01 by martinb]
martinb
parents: 508
diff changeset
13 #ifndef NOT_C_CODE
508
0be8704d6062 [xemacs-hg @ 2001-05-05 10:21:20 by martinb]
martinb
parents: 333
diff changeset
14 struct termios;
0be8704d6062 [xemacs-hg @ 2001-05-05 10:21:20 by martinb]
martinb
parents: 333
diff changeset
15 struct winsize;
0be8704d6062 [xemacs-hg @ 2001-05-05 10:21:20 by martinb]
martinb
parents: 333
diff changeset
16 int openpty (int *, int *, char *, struct termios *, struct winsize *);
517
00e9371a84f3 [xemacs-hg @ 2001-05-08 05:16:01 by martinb]
martinb
parents: 508
diff changeset
17 #endif