1 diff -burN -x '*.orig' vim-6.2.532.orig/src/edit.c vim-6.2.532/src/edit.c
2 --- vim-6.2.532.orig/src/edit.c 2004-05-08 08:55:12.000000000 +0200
3 +++ vim-6.2.532/src/edit.c 2004-05-08 09:25:12.218962464 +0200
5 if ((c == Ctrl_V || c == Ctrl_Q) && ctrl_x_mode == CTRL_X_CMDLINE)
8 - if (c == Ctrl_V || c == Ctrl_Q)
10 +#ifndef FEAT_SPELL_HL /* WM */
16 c = Ctrl_V; /* pretend CTRL-V is last typed character */
17 @@ -1229,6 +1233,20 @@
20 #endif /* FEAT_INS_EXPAND */
21 +#ifdef FEAT_SPELL_HL /* WM */
23 + if(set_to_private_dict(
24 + ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE),
25 + curwin->w_cursor.col, FALSE))
29 + if(set_to_private_dict(
30 + ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE),
31 + curwin->w_cursor.col, TRUE))
36 case Ctrl_Y: /* copy from previous line or scroll down */
37 case Ctrl_E: /* copy from next line or scroll up */
38 diff -burN -x '*.orig' vim-6.2.532.orig/src/eval.c vim-6.2.532/src/eval.c
39 --- vim-6.2.532.orig/src/eval.c 2004-05-08 08:55:12.000000000 +0200
40 +++ vim-6.2.532/src/eval.c 2004-05-08 09:25:12.235959880 +0200
51 diff -burN -x '*.orig' vim-6.2.532.orig/src/ex_cmds.h vim-6.2.532/src/ex_cmds.h
52 --- vim-6.2.532.orig/src/ex_cmds.h 2004-05-08 08:55:12.000000000 +0200
53 +++ vim-6.2.532/src/ex_cmds.h 2004-05-08 09:25:12.241958968 +0200
55 BANG|FILE1|TRLBAR|SBOXOK|CMDWIN),
56 EX(CMD_split, "split", ex_splitview,
57 BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
58 +EX(CMD_spell, "spell", ex_spell,
59 + EXTRA|NOTRLCOM|CMDWIN),
60 EX(CMD_sprevious, "sprevious", ex_previous,
61 EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
62 EX(CMD_srewind, "srewind", ex_rewind,
63 diff -burN -x '*.orig' vim-6.2.532.orig/src/ex_docmd.c vim-6.2.532/src/ex_docmd.c
64 --- vim-6.2.532.orig/src/ex_docmd.c 2004-05-08 08:55:13.000000000 +0200
65 +++ vim-6.2.532/src/ex_docmd.c 2004-05-08 09:25:12.266955168 +0200
68 # define ex_syntax ex_ni
70 +#ifndef FEAT_SPELL_HL
71 +# define ex_spell ex_ni
74 # define ex_perl ex_script_ni
75 # define ex_perldo ex_ni
76 @@ -3404,6 +3407,12 @@
77 set_context_in_syntax_cmd(xp, arg);
89 diff -burN -x '*.orig' vim-6.2.532.orig/src/feature.h vim-6.2.532/src/feature.h
90 --- vim-6.2.532.orig/src/feature.h 2004-05-08 08:55:11.000000000 +0200
91 +++ vim-6.2.532/src/feature.h 2004-05-08 09:25:12.271954408 +0200
93 # define FEAT_RIGHTLEFT
97 +#undef FEAT_RIGHTLEFT
100 +/* # define FEAT_PRINTER */
103 * +arabic Arabic keymap and shaping support.
104 diff -burN -x '*.orig' vim-6.2.532.orig/src/globals.h vim-6.2.532/src/globals.h
105 --- vim-6.2.532.orig/src/globals.h 2004-05-08 08:55:13.000000000 +0200
106 +++ vim-6.2.532/src/globals.h 2004-05-08 09:25:12.274953952 +0200
108 #ifdef USE_TERM_CONSOLE
109 EXTERN int term_console INIT(= FALSE); /* set to TRUE when console used */
111 +#ifdef FEAT_SPELL_HL
112 +EXTERN char_u hashname[MAXPATHL]; /* name of the dictionary */
114 EXTERN int termcap_active INIT(= FALSE); /* set by starttermcap() */
115 EXTERN int cur_tmode INIT(= TMODE_COOK); /* input terminal mode */
116 EXTERN int bangredo INIT(= FALSE); /* set to TRUE whith ! command */
117 diff -burN -x '*.orig' vim-6.2.532.orig/src/main.c vim-6.2.532/src/main.c
118 --- vim-6.2.532.orig/src/main.c 2004-05-08 08:55:12.000000000 +0200
119 +++ vim-6.2.532/src/main.c 2004-05-08 09:25:12.279953192 +0200
120 @@ -2245,6 +2245,10 @@
121 write_viminfo(NULL, FALSE);
124 +#ifdef FEAT_SPELL_HL
125 + spell_save_private_dict();
129 apply_autocmds(EVENT_VIMLEAVE, NULL, NULL, FALSE, curbuf);
131 diff -burN -x '*.orig' vim-6.2.532.orig/src/Makefile vim-6.2.532/src/Makefile
132 --- vim-6.2.532.orig/src/Makefile 2004-05-08 08:55:11.000000000 +0200
133 +++ vim-6.2.532/src/Makefile 2004-05-08 09:25:12.286952128 +0200
134 @@ -1234,6 +1234,22 @@
135 # Use this for cproto 3 patchlevel 7 or above (use "cproto -V" to check):
136 PROTO_FLAGS = -m -M__ARGS -d -E"$(CPP)" $(NO_ATTR)
138 +SPELL_SRC = spell.c \
146 +SPELL_OBJ = objects/spell.o \
150 + objects/makedent.o \
155 ################################################
156 ## no changes required below this line ##
157 @@ -1244,7 +1260,7 @@
159 .SUFFIXES: .cc .c .o .pro
161 -PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS)
162 +PRE_DEFS = -Iproto -Ispell $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS)
163 POST_DEFS = $(X_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(TCL_CFLAGS) $(RUBY_CFLAGS) $(EXTRA_DEFS)
165 ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(POST_DEFS)
166 @@ -1326,6 +1342,7 @@
174 @@ -1392,6 +1409,7 @@
182 @@ -2392,6 +2410,9 @@
183 objects/undo.o: undo.c
186 +objects/spell.o: spell.c spell/local.h
187 + $(CCC) -o $@ spell.c
189 objects/window.o: window.c
190 $(CCC) -o $@ window.c
192 @@ -2649,6 +2670,9 @@
193 auto/osdef.h ascii.h keymap.h term.h macros.h structs.h regexp.h \
194 gui.h gui_beval.h proto/gui_beval.pro option.h ex_cmds.h proto.h \
195 globals.h farsi.h arabic.h
196 +objects/spell.o: spell.c vim.h spell/config.h feature.h os_unix.h auto/osdef.h \
197 + ascii.h keymap.h term.h macros.h regexp.h structs.h gui.h globals.h farsi.h \
198 + option.h ex_cmds.h proto.h spell/local.h spell/wm.h spell/ispell.h
199 objects/syntax.o: syntax.c vim.h auto/config.h feature.h os_unix.h \
200 auto/osdef.h ascii.h keymap.h term.h macros.h structs.h regexp.h \
201 gui.h gui_beval.h proto/gui_beval.pro option.h ex_cmds.h proto.h \
202 @@ -2815,3 +2839,26 @@
203 auto/osdef.h ascii.h keymap.h term.h macros.h structs.h regexp.h \
204 gui.h gui_beval.h proto/gui_beval.pro option.h ex_cmds.h proto.h \
205 globals.h farsi.h arabic.h version.h
207 +SPELL_CFLAGS=$(CFLAGS) -pedantic -DUSG=1
209 +objects/good.o: spell/good.c spell/config.h spell/ispell.h spell/i_proto.h spell/msgs.h spell/local.h
210 + $(CC) -c $(SPELL_CFLAGS) spell/good.c -o objects/good.o
212 +objects/lookup.o: spell/lookup.c spell/config.h spell/ispell.h spell/i_proto.h spell/msgs.h spell/local.h
213 + $(CC) -c $(SPELL_CFLAGS) spell/lookup.c -o objects/lookup.o
215 +objects/hash.o: spell/hash.c spell/config.h spell/ispell.h spell/i_proto.h spell/local.h
216 + $(CC) -c $(SPELL_CFLAGS) spell/hash.c -o objects/hash.o
218 +objects/makedent.o: spell/makedent.c spell/config.h spell/ispell.h spell/i_proto.h spell/msgs.h spell/local.h
219 + $(CC) -c $(SPELL_CFLAGS) spell/makedent.c -o objects/makedent.o
221 +objects/tree.o: spell/tree.c spell/config.h spell/ispell.h spell/i_proto.h spell/msgs.h spell/local.h
222 + $(CC) -c $(SPELL_CFLAGS) spell/tree.c -o objects/tree.o
224 +objects/tgood.o: spell/tgood.c spell/config.h spell/ispell.h spell/i_proto.h spell/local.h
225 + $(CC) -c $(SPELL_CFLAGS) spell/tgood.c -o objects/tgood.o
227 +objects/util.o: spell/util.c spell/config.h spell/ispell.h spell/i_proto.h spell/local.h
228 + $(CC) -c $(SPELL_CFLAGS) spell/util.c -o objects/util.o
229 diff -burN -x '*.orig' vim-6.2.532.orig/src/normal.c vim-6.2.532/src/normal.c
230 --- vim-6.2.532.orig/src/normal.c 2004-05-08 08:55:11.000000000 +0200
231 +++ vim-6.2.532/src/normal.c 2004-05-08 09:25:12.304949392 +0200
234 static int get_visual_text __ARGS((cmdarg_T *cap, char_u **pp, int *lenp));
236 +#ifdef FEAT_SPELL_HL
237 +static void nv_settodict_q __ARGS((cmdarg_T *cap));
238 +static void nv_settodict_s __ARGS((cmdarg_T *cap));
240 static void nv_tagpop __ARGS((cmdarg_T *cap));
241 static void nv_scroll __ARGS((cmdarg_T *cap));
242 static void nv_right __ARGS((cmdarg_T *cap));
244 {Ctrl_N, nv_down, NV_STS, FALSE},
245 {Ctrl_O, nv_ctrlo, 0, 0},
246 {Ctrl_P, nv_up, NV_STS, FALSE},
247 +#ifdef FEAT_SPELL_HL
248 + {Ctrl_Q, nv_settodict_q, 0, 0},
250 {Ctrl_Q, nv_ignore, 0, 0},
252 {Ctrl_R, nv_redo, 0, 0},
253 +#ifdef FEAT_SPELL_HL
254 + {Ctrl_S, nv_settodict_s, 0, 0},
256 {Ctrl_S, nv_ignore, 0, 0},
258 {Ctrl_T, nv_tagpop, NV_NCW, 0},
259 {Ctrl_U, nv_halfpage, 0, 0},
261 @@ -7834,6 +7846,28 @@
265 +#ifdef FEAT_SPELL_HL
270 + if(set_to_private_dict(
271 + ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE),
272 + curwin->w_cursor.col, FALSE))
273 + clearopbeep(cap->oap);
280 + if(set_to_private_dict(
281 + ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE),
282 + curwin->w_cursor.col, TRUE))
283 + clearopbeep(cap->oap);
289 * In exclusive Visual mode, may include the last character.
290 diff -burN -x '*.orig' vim-6.2.532.orig/src/option.c vim-6.2.532/src/option.c
291 --- vim-6.2.532.orig/src/option.c 2004-05-08 08:55:13.000000000 +0200
292 +++ vim-6.2.532/src/option.c 2004-05-08 09:43:59.312618184 +0200
304 static char_u *p_syn;
306 +#ifdef FEAT_SPELL_HL
307 +static char_u *p_spelldirectory;
308 +static char_u *p_language;
313 @@ -1072,7 +1078,7 @@
314 {(char_u *)FALSE, (char_u *)0L}},
315 {"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
316 (char_u *)&p_hl, PV_NONE,
317 - {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn",
318 + {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,Z:Spell",
320 {"history", "hi", P_NUM|P_VIM,
321 (char_u *)&p_hi, PV_NONE,
322 @@ -1337,6 +1343,13 @@
323 (char_u *)NULL, PV_NONE,
325 {(char_u *)"", (char_u *)0L}},
326 + {"language", "lang", P_STRING|P_ALLOCED|P_VI_DEF,
327 +#ifdef FEAT_SPELL_HL
328 + (char_u *)&p_language, PV_SPELL_LANG,
330 + (char_u *)NULL, PV_NONE,
332 + {(char_u *)"", (char_u *)0L}},
333 {"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL,
335 (char_u *)&p_ls, PV_NONE,
336 @@ -1935,6 +1948,14 @@
337 {"sourceany", NULL, P_BOOL|P_VI_DEF,
338 (char_u *)NULL, PV_NONE,
339 {(char_u *)FALSE, (char_u *)0L}},
340 + {"spelldirectory", "spelldir", P_STRING|P_ALLOCED|P_VI_DEF|P_EXPAND,
341 +#ifdef FEAT_SPELL_HL
342 + (char_u *)&p_spelldirectory, PV_SPELL_DIR,
343 + {(char_u *)"/usr/lib/ispell", (char_u *)0L}},
345 + (char_u *)NULL, PV_NONE,
346 + {(char_u *)"", (char_u *)0L}},
348 {"splitbelow", "sb", P_BOOL|P_VI_DEF,
350 (char_u *)&p_sb, PV_NONE,
351 @@ -4815,6 +4836,26 @@
355 +#ifdef FEAT_SPELL_HL
356 + else if (varp == &p_spell_dir)
358 + STRCPY(hashname, p_spell_dir);
359 + STRCAT(hashname, "/");
360 + STRCAT(hashname, p_spell_lang);
361 + STRCAT(hashname, ".hash");
363 + redraw_all_later(NOT_VALID);
365 + else if (varp == &p_spell_lang)
367 + STRCPY(hashname, p_spell_dir);
368 + STRCAT(hashname, "/");
369 + STRCAT(hashname, p_spell_lang);
370 + STRCAT(hashname, ".hash");
372 + redraw_all_later(NOT_VALID);
377 /* 'encoding' and 'fileencoding' */
378 @@ -7921,6 +7962,10 @@
380 case PV_SYN: return (char_u *)&(curbuf->b_p_syn);
382 +#ifdef FEAT_SPELL_HL
383 + case PV_SPELL_DIR: return (char_u *)&(p_spell_dir);
384 + case PV_SPELL_LANG: return (char_u *)&(p_spell_lang);
386 case PV_SW: return (char_u *)&(curbuf->b_p_sw);
387 case PV_TS: return (char_u *)&(curbuf->b_p_ts);
388 case PV_TW: return (char_u *)&(curbuf->b_p_tw);
389 diff -burN -x '*.orig' vim-6.2.532.orig/src/option.h vim-6.2.532/src/option.h
390 --- vim-6.2.532.orig/src/option.h 2004-05-08 08:55:13.000000000 +0200
391 +++ vim-6.2.532/src/option.h 2004-05-08 09:25:23.884189080 +0200
393 EXTERN char_u *p_dex; /* 'diffexpr' */
396 +EXTERN char_u *p_spell_dir; /* directory with spell hash*/
397 +EXTERN char_u *p_spell_lang; /* name of language (spell hash file)*/
398 #ifdef FEAT_INS_EXPAND
399 EXTERN char_u *p_dict; /* 'dictionary' */
401 diff -burN -x '*.orig' vim-6.2.532.orig/src/proto/spell.pro vim-6.2.532/src/proto/spell.pro
402 --- vim-6.2.532.orig/src/proto/spell.pro 1970-01-01 01:00:00.000000000 +0100
403 +++ vim-6.2.532/src/proto/spell.pro 2004-05-08 09:25:23.885188928 +0200
405 +int reload_dict(void);
\r
406 +void ex_spell(exarg_T *eap);
\r
407 +int get_spell_attr(colnr_T spell_col, colnr_T col, char_u *line);
\r
408 +int set_to_private_dict(char *line, int cursor_col, int convert_to_lower);
\r
409 +void spell_save_private_dict(void);
\r
410 diff -burN -x '*.orig' vim-6.2.532.orig/src/proto.h vim-6.2.532/src/proto.h
411 --- vim-6.2.532.orig/src/proto.h 2004-05-08 08:55:13.000000000 +0200
412 +++ vim-6.2.532/src/proto.h 2004-05-08 09:25:23.887188624 +0200
414 # include "os_qnx.pro"
417 +#ifdef FEAT_SPELL_HL
418 +# include "spell.pro"
420 # include "buffer.pro"
421 # include "charset.pro"
423 diff -burN -x '*.orig' vim-6.2.532.orig/src/screen.c vim-6.2.532/src/screen.c
424 --- vim-6.2.532.orig/src/screen.c 2004-05-08 08:55:12.000000000 +0200
425 +++ vim-6.2.532/src/screen.c 2004-05-08 09:25:23.901186496 +0200
427 static match_T match_hl; /* used for ":match" highlight matching */
430 +#ifdef FEAT_SPELL_HL
431 +extern int spell_flag;
434 static foldinfo_T win_foldinfo; /* info for 'foldcolumn' */
436 @@ -2537,6 +2540,9 @@
437 int has_syntax = FALSE; /* this buffer has syntax highl. */
440 +#ifdef FEAT_SPELL_HL
441 + int spell_attr = 0;
443 int extra_check; /* has syntax or linebreak */
445 int multi_attr = 0; /* attributes desired by multibyte */
446 @@ -2615,8 +2621,18 @@
450 +#if defined(FEAT_SYN_HL) || defined(FEAT_SPELL_HL)
453 - if (syntax_present(wp->w_buffer))
454 + syntax_present(wp->w_buffer)
458 +#ifdef FEAT_SPELL_HL
464 /* Prepare for syntax highlighting in this line. When there is an
465 * error, stop syntax highlighting. */
466 @@ -3263,6 +3279,10 @@
467 else if (search_attr == 0 && has_syntax)
468 char_attr = syntax_attr;
470 +#ifdef FEAT_SPELL_HL
471 + else if (spell_flag)
472 + char_attr = spell_attr;
475 char_attr = search_attr;
477 @@ -3577,6 +3597,17 @@
478 char_attr = syntax_attr;
481 +#ifdef FEAT_SPELL_HL
485 + spell_attr = get_spell_attr((colnr_T)v - 1, col,
486 + ml_get_buf(wp->w_buffer,
488 + if (area_attr == 0 && search_attr == 0 && spell_attr)
489 + char_attr = spell_attr;
492 #ifdef FEAT_LINEBREAK
494 * Found last space before word: check for line break
495 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/config.h vim-6.2.532/src/spell/config.h
496 --- vim-6.2.532.orig/src/spell/config.h 1970-01-01 01:00:00.000000000 +0100
497 +++ vim-6.2.532/src/spell/config.h 2004-05-08 09:25:23.929182240 +0200
499 +#include "local.h" /* local definitions for options */
502 +** Major-differences selection. The default system is BSD; for USG
503 +** or non-UNIX systems you should add the appropriate #define to local.h.
506 +#undef USG /* Define this in local.h for System V machines */
510 +#include <sys/param.h>
511 +#include <sys/types.h>
514 +# ifndef FEAT_SPELL_HL
516 +# include <dirent.h>
518 +# define NAMLEN(dirent) strlen((dirent)->d_name)
521 +# define dirent direct
522 +# define NAMLEN(dirent) (dirent)->d_namlen
523 +# if HAVE_SYS_NDIR_H
524 +# include <sys/ndir.h>
527 +# include <sys/dir.h>
537 +** Things that normally go in a Makefile. Define these just like you
538 +** might in the Makefile, except you should use #define instead of
539 +** make's assignment syntax. Everything must be double-quoted, and
540 +** (unlike make) you can't use any sort of $-syntax to pick up the
541 +** values of other definitions.
547 +#define EMACS "emacs"
556 +#define LINTFLAGS ""
557 +#endif /* LINTFLAGS */
563 +** Libraries that may need to be added to the cc line to get ispell to
564 +** link. Normally, this should be null.
571 +** TERMLIB - where to get the termcap library. Should be -ltermcap or
572 +** -lcurses on most systems.
575 +#define TERMLIB "-lncurses"
579 +** REGLIB - where to get the regular-expression routines, if
580 +** REGEX_LOOKUP is defined. Should be -lPW on USG systems, null on
588 +** Where to install various components of ispell. BINDIR contains
589 +** binaries. LIBDIR contains hash tables and affix files. ELISPDIR
590 +** contains emacs lisp files (if any) and TEXINFODIR contains emacs
591 +** TeXinfo files. MAN1DIR and MAN4DIR will hold the chapter-1 and
592 +** chapter-4 manual pages, respectively.
594 +** If you intend to use multiple dictionary files, I would suggest
595 +** LIBDIR be a directory which will contain nothing else, so sensible
596 +** names can be constructed for the -d option without conflict.
599 +#define BINDIR "/usr/bin"
602 +#define LIBDIR "/usr/lib/ispell"
605 +#define ELISPDIR "/usr/lib/emacs/site-lisp"
608 +#define TEXINFODIR "/usr/share/info"
611 +#define MAN1DIR "/usr/share/man/man1"
614 +#define MAN4DIR "/usr/share/man/man4"
618 +** Extensions to put on manual pages. Usually these are ".1" or ".1l".
621 +#define MAN1EXT ".1"
624 +#define MAN4EXT ".4"
628 +** List of all hash files (languages) which will be supported by ispell.
630 +** This variable has a complex format so that many options can be
631 +** specified. The format is as follows:
633 +** <language>[,<make-options>...] [<language> [,<make-options> ...] ...]
637 +** language is the name of a subdirectory of the
638 +** "languages" directory
639 +** make-options are options that are to be passed to "make" in
640 +** the specified directory. The make-options
641 +** should not, in general, specify a target, as
642 +** this will be provided by the make process.
644 +** For example, if LANGUAGES is:
646 +** "{american,MASTERDICTS=american.med+,HASHFILES=americanmed+.hash,EXTRADICT=/usr/dict/words /usr/dict/web2} {deutsch,DICTALWAYS=deutsch.sml,DICTOPTIONS=}"
648 +** then the American-English and Deutsch (German) languages will be supported,
649 +** and the following variable settings will be passed to the two Makefiles:
653 +** MASTERDICTS='american.med+'
654 +** HASHFILES='americanmed+.hash'
655 +** EXTRADICT='/usr/dict/words /usr/dict/web2'
659 +** DICTALWAYS='deutsch.sml'
662 +** Notes on the syntax: The makefile is not very robust. If you have
663 +** make problems, or if make seems to fail in the language-subdirs
664 +** dependency, check your syntax. The makefile adds single quotes to
665 +** the individual variables in the LANGUAGES specification, so don't
666 +** use quotes of any kind.
668 +** In the future, the first language listed in this variable will
669 +** become the default, and the DEFHASH, DEFLANG, and DEFPAFF,
670 +** variables will all become obsolete. So be sure to put your default
671 +** language first, to make later conversion easier!
673 +** Notes on options for the various languages will be found in the
674 +** Makefiles for those languages. Some of those languages may require
675 +** you to also change various limits limits like MASKBITS or the
676 +** length parameters.
678 +** A special note on the English language: because the British and
679 +** American dialects use different spelling, you should usually select
680 +** one or the other of these. If you select both, the setting of
681 +** MASTERHASH will determine which becomes the language linked to
682 +** DEFHASH (which will usually be named english.hash).
684 +** On MSDOS systems you must use names which are consistent with the
685 +** 8+3 filename restrictions, or you will risk filename collision. See
686 +** the file pc/local.djgpp for details.
689 +#define LANGUAGES "{american,MASTERDICTS=american.med+,HASHFILES=americanmed+.hash,EXTRADICT=/usr/dict/words}"
690 +#endif /* LANGUAGES */
693 +** Master hash file for DEFHASH. This is the name of a hash file
694 +** built by a language Makefile. It should be the most-popular hash
695 +** file on your system, because it is the one that will be used by
696 +** default. It must be listed in LANGUAGES, above.
699 +#define MASTERHASH "polish+.hash"
703 +** Default native-language hash file. This is the name given to the
704 +** hash table that will be used if no language is specified to
705 +** ispell. It is a link to MASTERHASH, above.
708 +#define DEFHASH "polish.hash"
712 +** Language tables for the default language. This must be the name of
713 +** the affix file that was used to generate the MASTERHASH/DEFHASH,
717 +#define DEFLANG "polish.aff"
721 +** Language to use for error messages. If there are no messages in this
722 +** language, English will be used instead.
725 +#define MSGLANG "polish"
726 +#endif /* MSGLANG */
729 +** If your sort command accepts the -T switch to set temp file
730 +** locations (try it out; it exists but is undocumented on some
731 +** systems), make the following variable the null string. Otherwise
732 +** leave it as the sed script.
735 +#define SORTTMP "-e '/!!SORTTMP!!/s/=.*$/=/'"
739 +** If your sort command accepts the -T switch (see above), make the
740 +** following variable refer to a temporary directory with lots of
741 +** space. Otherwise make it the null string.
743 +#ifndef MAKE_SORTTMP
744 +#define MAKE_SORTTMP "-T ${TMPDIR-/usr/tmp}"
748 +** If your shell needs ": Use /bin/sh" at the first line of a shell
749 +** script, make the following variable the null string. Otherwise
750 +** leave it as this sed script which will put a "#!/bin/sh" there.
752 +#ifndef MAKE_POUND_BANG
753 +#define MAKE_POUND_BANG "-e 1s,^:.*Use.*/bin/sh,#!/bin/sh,"
758 +** INSTALL program. Could be a copy program like cp or something fancier
759 +** like /usr/ucb/install -c
762 +#define INSTALL "cp"
766 +** If your system has the rename(2) system call, define HAS_RENAME and
767 +** ispell will use that call to rename backup files. Otherwise, it
768 +** will use link/unlink. There is no harm in this except on MS-DOS,
769 +** which doesn't support link/unlink.
773 +#endif /* HAS_RENAME */
775 +/* type given to signal() by signal.h */
777 +#define SIGNAL_TYPE void
780 +/* environment variable for user's word list */
782 +#define PDICTVAR "WORDLIST"
785 +/* prefix part of default word list */
787 +#define DEFPDICT ".ispell_"
791 +** suffix part of default word list
794 +#define DEFPAFF "words"
797 +/* old place to look for default word list */
799 +#define OLDPDICT ".ispell_"
800 +#endif /* OLDPDICT */
802 +#define OLDPAFF "words"
803 +#endif /* OLDPAFF */
805 +/* environment variable for include file string */
807 +#define INCSTRVAR "INCLUDE_STRING"
810 +/* default include string */
812 +#define DEFINCSTR "&Include_File&"
815 +/* mktemp template for temporary file - MUST contain 6 consecutive X's */
817 +#define TEMPNAME "/tmp/ispellXXXXXX"
821 +** If REGEX_LOOKUP is undefined, the lookup command (L) will use the look(1)
822 +** command (if available) or the egrep command. If REGEX_LOOKUP is defined,
823 +** the lookup command will use the internal dictionary and the
824 +** regular-expression library (which you must supply separately. There is
825 +** a public-domain library available; libraries are also distributed with
826 +** both BSD and System V.
828 +** The advantage of no REGEX_LOOKUP is that it is often much faster, especially
829 +** if the look(1) command is available, that the words found are presented
830 +** in alphabetical order, and that the list of words searched is larger.
831 +** The advantage of REGEX_LOOKUP is that ispell doesn't need to spawn another
832 +** program, and the list of words searched is exactly the list of (root) words
833 +** that ispell will accept. (However, note that words formed with affixes will
834 +** not be found; this can produce some artifacts. For example, since
835 +** "brother" can be formed as "broth+er", a lookup command might fail to
838 +#ifndef REGEX_LOOKUP
840 +#endif /* REGEX_LOOKUP */
843 +** Choose the proper type of regular-expression routines here. BSD
844 +** and public-domain systems have routines called re_comp and re_exec;
845 +** System V uses regcmp and regex.
847 +** REGCTYPE is the type of a variable to hold the compiled regexp
848 +** REGCMP(re,str) is the function which compiles a regexp in `str' into
849 +** a compiled regexp `re' declared as REGCTYPE and
851 +** REGEX(re,str,dummy) is a function which matches `str' against a compiled
852 +** regexp in `re' and returns a non-NULL pointer if it
853 +** matches, NULL otherwise.
854 +** REGFREE(re) is anything that should be done when the compiled
855 +** regexp `re' is no longer needed. It can be also used
856 +** to allocate any structures required to compile a
857 +** regexp, since it is called *before* compiling a new
858 +** regexp (that's where we know that the old one will no
861 +** Here is one way of defining these if you have POSIX regexp functions:
863 +** #include <sys/types.h>
864 +** #include <regex.h>
865 +** #define REGCTYPE regex_t *
866 +** #define REGCMP(re,str) (regcomp (re, str, 0), re)
867 +** #define REGEX(re, str, dummy) \
868 +** (re != 0 && regexec (re, str, 0, 0, 0) == 0 ? (char *)1 : NULL)
869 +** #define REGFREE(re) \
872 +** re = (regex_t *)calloc (1, sizeof (regex_t)); \
881 +#define REGCTYPE char *
882 +#define REGCMP(re,str) regcmp (str, (char *) 0)
883 +#define REGEX(re, str, dummy) regex (re, str, dummy, dummy, dummy, dummy, \
884 + dummy, dummy, dummy, dummy, dummy, dummy)
885 +#define REGFREE(re) do {if (re != NULL) free (re); re = NULL;} \
888 +#define REGCTYPE char *
889 +#define REGFREE(re) (void)0
890 +#define REGCMP(re,str) re_comp (str)
891 +#define REGEX(re, str, dummy) re_exec (str)
894 +#endif /* REGEX_LOOKUP */
896 +/* look command (if look(1) MAY BE available - ignored if not) */
897 +#ifndef REGEX_LOOKUP
899 +#define LOOK "look -df"
901 +#endif /* REGEX_LOOKUP */
903 +/* path to egrep (use speeded up version if available) */
906 +#define EGREPCMD "/bin/egrep"
908 +#define EGREPCMD "/usr/bin/egrep -i"
912 +/* path to wordlist for Lookup command (typically /usr/dict/{words|web2}) */
913 +/* note that /usr/dict/web2 is usually a bad idea due to obscure words */
915 +#define WORDS "/usr/dict/words"
918 +/* buffer size to use for file names if not in sys/param.h */
920 +#define MAXPATHLEN 240
923 +/* max file name length (will truncate to fit BAKEXT) if not in sys/param.h */
925 +#define MAXNAMLEN 14
928 +/* define if you want .bak file names truncated to MAXNAMLEN characters */
931 +#endif /* TRUNCATEBAK */
933 +/* largest word accepted from a file by any input routine, plus one */
934 +#ifndef INPUTWORDLEN
935 +#define INPUTWORDLEN 100
938 +/* largest amount that a word might be extended by adding affixes */
940 +#define MAXAFFIXLEN 20
944 +** Define the following to suppress the 8-bit character feature.
945 +** Unfortunately, this doesn't work as well as it might, because ispell
946 +** only strips the 8th bit in some places. For example, it calls strcmp()
947 +** quite often without first stripping parity. However, I really wonder
948 +** about the utility of this option, so I haven't bothered to fix it. If
949 +** you think the stripping feature of NO8BIT is useful, you might let me
950 +** (Geoff Kuenning) know.
952 +** Nevertheless, NO8BIT is a useful option for other reasons. If NO8BIT
953 +** is defined, ispell will probably use 8-bit characters internally;
954 +** this improves time efficiency and saves a small amount of space
955 +** in the hash file. Thus, I recommend you specify NO8BIT unless you
956 +** actually expect to be spelling files which use a 256-character set.
963 +** Number of mask bits (affix flags) supported. Must be 32, 64, 128, or
964 +** 256. If MASKBITS is 32 or 64, there are really only 26 or 58 flags
965 +** available, respectively. If it is 32, the flags are named with the
966 +** 26 English uppercase letters; lowercase will be converted to uppercase.
967 +** If MASKBITS is 64, the 58 flags are named 'A' through 'z' in ASCII
968 +** order, including the 6 special characters from 'Z' to 'a': "[\]^_`".
969 +** If MASKBITS is 128 or 256, all the 7-bit or 8-bit characters,
970 +** respectively, are theoretically available, though a few (newline, slash,
971 +** null byte) are pretty hard to actually use successfully.
973 +** Note that a number of non-English affix files depend on having a
974 +** larger value for MASKBITS. See the affix files for more
982 +** C type to use for masks. This should be a type that the processor
983 +** accesses efficiently.
985 +** MASKTYPE_WIDTH must correctly reflect the number of bits in a
986 +** MASKTYPE. Unfortunately, it is also required to be a constant at
987 +** preprocessor time, which means you can't use the sizeof operator to
990 +** Note that MASKTYPE *must* match MASKTYPE_WIDTH or you may get
991 +** division-by-zero errors!
994 +#define MASKTYPE long
996 +#ifndef MASKTYPE_WIDTH
997 +#define MASKTYPE_WIDTH 32
999 +#if MASKBITS < MASKTYPE_WIDTH
1001 +#define MASKBITS MASKTYPE_WIDTH
1002 +#endif /* MASKBITS < MASKTYPE_WIDTH */
1005 +/* maximum number of include files supported by xgets; set to 0 to disable */
1006 +#ifndef MAXINCLUDEFILES
1007 +#define MAXINCLUDEFILES 5
1011 +** Maximum hash table fullness percentage. Larger numbers trade space
1015 +#define MAXPCT 70 /* Expand table when 70% full */
1019 +** Maximum number of "string" characters that can be defined in a
1020 +** language (affix) file. Don't forget that an upper/lower string
1021 +** character counts as two!
1023 +#ifndef MAXSTRINGCHARS
1024 +#define MAXSTRINGCHARS 512
1025 +#endif /* MAXSTRINGCHARS */
1028 +** Maximum length of a "string" character. The default is appropriate for
1029 +** nroff-style characters starting with a backslash.
1031 +#ifndef MAXSTRINGCHARLEN
1032 +#define MAXSTRINGCHARLEN 10
1033 +#endif /* MAXSTRINGCHARLEN */
1036 +** the S_NOPARITY mask is applied to user input characters from the terminal
1037 +** in order to mask out the parity bit.
1040 +#define S_NOPARITY 0x7f
1042 +#define S_NOPARITY 0xff
1047 +** the terminal mode for ispell, set to CBREAK or RAW
1051 +#define TERM_MODE CBREAK
1055 +** Define this if you want your columns of words to be of equal length.
1056 +** This will spread short word lists across the screen instead of down it.
1058 +#ifndef EQUAL_COLUMNS
1059 +#undef EQUAL_COLUMNS
1060 +#endif /* EQUAL_COLUMNS */
1063 +** This is the extension that will be added to backup files
1066 +#define BAKEXT ".bak"
1070 +** Define this if you want to suppress the capitalization-checking
1071 +** feature. This will reduce the size of the hashed dictionary on
1072 +** most 16-bit and some 32-bit machines. This option is not
1075 +#ifndef NO_CAPITALIZATION_SUPPORT
1076 +#undef NO_CAPITALIZATION_SUPPORT
1077 +#endif /* NO_CAPITALIZATION_SUPPORT */
1080 +** Define this if you want your personal dictionary sorted. This may take
1081 +** a long time for very large dictionaries. Dictionaries larger than
1082 +** SORTPERSONAL words will not be sorted. Define SORTPERSONAL as zero
1083 +** to disable this feature.
1085 +#ifndef SORTPERSONAL
1086 +#define SORTPERSONAL 1000
1090 +** Define this if you want to use the shell for interpretation of commands
1091 +** issued via the "L" command, "^Z" under System V, and "!". If this is
1092 +** not defined then a direct fork()/exec() will be used in place of the
1093 +** normal system(). This may speed up these operations greately on some
1101 +** Maximum language-table search size. Smaller numbers make ispell
1102 +** run faster, at the expense of more memory (the lowest reasonable value
1103 +** is 2). If a given character appears in a significant position in
1104 +** more than MAXSEARCH suffixes, it will be given its own index table.
1105 +** If you change this, define INDEXDUMP in lookup.c to be sure your
1106 +** index table looks reasonable.
1109 +#define MAXSEARCH 4
1113 +** Define this if you want to be able to type any command at a "type space
1114 +** to continue" prompt.
1116 +#ifndef COMMANDFORSPACE
1117 +#undef COMMANDFORSPACE
1118 +#endif /* COMMANDFORSPACE */
1121 +** Memory-allocation increment. Buildhash allocates memory in chunks
1122 +** of this size, and then subdivides it to get its storage. This saves
1123 +** much malloc execution time. A good number for this is the system
1124 +** page size less the malloc storage overhead.
1126 +** Define this to zero to revert to using malloc/realloc. This is normally
1127 +** useful only on systems with limited memory.
1129 +#ifndef MALLOC_INCREMENT
1130 +#define MALLOC_INCREMENT 0
1134 +** Maximum number of "hits" expected on a word. This is basically the
1135 +** number of different ways different affixes can produce the same word.
1136 +** For example, with "english.aff", "brothers" can be produced 3 ways:
1137 +** "brothers," "brother+s", or "broth+ers". If this is too low, no major
1138 +** harm will be done, but ispell may occasionally forget a capitalization.
1141 +#define MAX_HITS 10
1145 +** Maximum number of capitalization variations expected in any word.
1146 +** Besides the obvious all-lower, all-upper, and capitalized versions,
1147 +** this includes followcase variants. If this is too low, no real
1148 +** harm will be done, but ispell may occasionally fail to suggest a
1149 +** correct capitalization.
1152 +#define MAX_CAPS 10
1153 +#endif /* MAX_CAPS */
1155 +/* Define this to ignore spelling check of entire LaTeX bibliography listings */
1161 +** Default nroff and TeX special characters. Normally, you won't want to
1162 +** change this; instead you would override it in the language-definition
1166 +#define TEXSPECIAL "{}$*.%#&?,;:!@~-"
1170 +#define NRSPECIAL "().\\*"
1174 +** Defaults for certain command-line flags.
1176 +#ifndef DEFNOBACKUPFLAG
1177 +#define DEFNOBACKUPFLAG 0 /* Don't suppress backup file */
1180 +#define DEFTEXFLAG 0 /* Default to nroff mode */
1184 +** Define this if you want ispell to place a limitation on the maximum
1185 +** size of the screen. On windowed workstations with very large windows,
1186 +** the size of the window can be too much of a good thing, forcing the
1187 +** user to look back and forth between the bottom and top of the screen.
1188 +** If MAX_SCREEN_SIZE is nonzero, screens larger than this will be treated
1189 +** as if they have only MAX_SCREEN_SIZE lines. A good value for this
1190 +** variable is 24 or 30. Define it as zero to suppress the feature.
1192 +#ifndef MAX_SCREEN_SIZE
1193 +#define MAX_SCREEN_SIZE 0
1197 +** The next three variables are used to provide a variable-size context
1198 +** display at the bottom of the screen. Normally, the user will see
1199 +** a number of lines equal to CONTEXTPCT of his screen, rounded down
1200 +** (thus, with CONTEXTPCT == 10, a 24-line screen will produce two lines
1201 +** of context). The context will never be greater than MAXCONTEXT or
1202 +** less than MINCONTEXT. To disable this feature entirely, set MAXCONTEXT
1203 +** and MINCONTEXT to the same value. To round context percentages up,
1204 +** define CONTEXTROUNDUP.
1206 +** Warning: don't set MAXCONTEXT ridiculously large. There is a
1207 +** static buffer of size MAXCONTEXT*BUFSIZ; since BUFSIZ is frequently
1208 +** 1K or larger, this can create a remarkably large executable.
1211 +#define CONTEXTPCT 10 /* Use 10% of the screen for context */
1214 +#define MINCONTEXT 2 /* Always show at least 2 lines of context */
1217 +#define MAXCONTEXT 10 /* Never show more than 10 lines of context */
1219 +#ifndef CONTEXTROUNDUP
1220 +#undef CONTEXTROUNDUP /* Don't round context up */
1224 +** Define this if you want the context lines to be displayed at the
1225 +** bottom of the screen, the way they used to be, rather than at the top.
1227 +#ifndef BOTTOMCONTEXT
1228 +#undef BOTTOMCONTEXT
1229 +#endif /* BOTTOMCONTEXT */
1232 +** Define this if you want the "mini-menu," which gives the most important
1233 +** options at the bottom of the screen, to be the default (in any case, it
1234 +** can be controlled with the "-M" switch).
1241 +** You might want to change this to zero if your users want to check
1242 +** single-letter words against the dictionary. However, you should try
1243 +** some sample runs using the -W switch before you try it out; you'd
1244 +** be surprised how many single letters appear in documents. If you increase
1245 +** MINWORD beyond 1, don't say I didn't warn you that it was a bad idea.
1248 +#define MINWORD 1 /* Words this short and shorter are always ok */
1252 +** ANSI C compilers are supposed to provide an include file,
1253 +** "stdlib.h", which gives function prototypes for all library
1254 +** routines. Define NO_STDLIB_H if you have a compiler that claims to
1255 +** be ANSI, but doesn't provide this include file.
1257 +#ifndef NO_STDLIB_H
1259 +#define NO_STDLIB_H
1260 +#endif /* __STDC__ */
1261 +#endif /* NO_STDLIB_H */
1264 +** The following define is used by the ispell developer to help
1265 +** double-check the software. Leave it undefined on other systems
1266 +** unless you are especially fond of warning messages, or are pursuing
1267 +** an inexplicable bug that might be related to a type mismatch.
1269 +#ifndef GENERATE_LIBARARY_PROTOS
1270 +#undef GENERATE_LIBARARY_PROTOS
1271 +#endif /* GENERATE_LIBARARY_PROTOS */
1274 +** Symbols below this point are generally intended to cater to
1275 +** idiosyncracies of specific machines and operating systems.
1277 +** MS-DOS users should also define HAS_RENAME, above, if appropriate.
1279 +** Define PIECEMEAL_HASH_WRITES if your system can't handle huge write
1280 +** operations. This is known to be a problem on MS-DOS systems when
1281 +** a 16-bit compiler is used to compile Ispell.
1283 +#ifndef PIECEMEAL_HASH_WRITES
1284 +#undef PIECEMEAL_HASH_WRITES
1285 +#endif /* PIECEMEAL_HASH_WRITES */
1288 +** Redefine GETKEYSTROKE() to getkey() on some MS-DOS systems where
1289 +** getchar() doesn't operate properly in raw mode.
1291 +#ifndef GETKEYSTROKE
1292 +#define GETKEYSTROKE() getchar ()
1293 +#endif /* GETKEYSTROKE */
1296 +** Define MSDOS_BINARY_OPEN to 0x8000 on MS-DOS systems. This can be
1297 +** done by adding "#include fcntl.h" to your local.h file.
1299 +#ifndef MSDOS_BINARY_OPEN
1301 +#define MSDOS_BINARY_OPEN O_BINARY
1302 +#else /* O_BINARY */
1303 +#define MSDOS_BINARY_OPEN 0
1304 +#endif /* O_BINARY */
1305 +#endif /* MSDOS_BINARY_OPEN */
1308 +** Environment variable to use to locate the home directory. On DOS
1309 +** systems you might want to set this to ISPELL_HOME to avoid
1310 +** conflicts with other programs that look for a HOME environment
1311 +** variable; on all other systems it should be just HOME.
1314 +#define HOME "HOME"
1318 +** On MS-DOS systems, define PDICTHOME to be the name of a directory
1319 +** to be used to contain the personal dictionary (.ispell_english,
1320 +** etc.). On other systems, you can leave it undefined.
1324 +#endif /* PDICTHOME */
1327 +** On MS-DOS systems, you can rename the following variables so that
1328 +** ispell's files have 3-character suffixes. Note that, if you do
1329 +** this, you will have to redefine any variable above that incorporates
1330 +** one of the suffixes. (Most MS-DOS environments will silently truncate
1331 +** excess characters beyond the 8+3 limit, so you usually don't need to
1332 +** change the suffixes just because they are longer than 3 characters.)
1335 +#define HASHSUFFIX ".hash"
1336 +#endif /* HASHSUFFIX */
1338 +#define STATSUFFIX ".sta"
1339 +#endif /* STATSUFFIX */
1340 +#ifndef COUNTSUFFIX
1341 +#define COUNTSUFFIX ".cnt"
1342 +#endif /* COUNTSUFFIX */
1343 +#define SIGNAL_TYPE_STRING "void"
1344 +#define MASKTYPE_STRING "long"
1345 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/good.c vim-6.2.532/src/spell/good.c
1346 --- vim-6.2.532.orig/src/spell/good.c 1970-01-01 01:00:00.000000000 +0100
1347 +++ vim-6.2.532/src/spell/good.c 2004-05-08 09:25:23.933181632 +0200
1350 +static char Rcs_Id[] =
1355 + * good.c - see if a word or its root word
1356 + * is in the dictionary.
1358 + * Pace Willisson, 1983
1360 + * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
1361 + * All rights reserved.
1363 + * Redistribution and use in source and binary forms, with or without
1364 + * modification, are permitted provided that the following conditions
1367 + * 1. Redistributions of source code must retain the above copyright
1368 + * notice, this list of conditions and the following disclaimer.
1369 + * 2. Redistributions in binary form must reproduce the above copyright
1370 + * notice, this list of conditions and the following disclaimer in the
1371 + * documentation and/or other materials provided with the distribution.
1372 + * 3. All modifications to the source code must be clearly marked as
1373 + * such. Binary redistributions based on modified source code
1374 + * must be clearly marked as modified versions in the documentation
1375 + * and/or other materials provided with the distribution.
1376 + * 4. All advertising materials mentioning features or use of this software
1377 + * must display the following acknowledgment:
1378 + * This product includes software developed by Geoff Kuenning and
1379 + * other unpaid contributors.
1380 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
1381 + * products derived from this software without specific prior
1382 + * written permission.
1384 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
1385 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1386 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1387 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
1388 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1389 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1390 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1391 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1392 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1393 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1399 + * Revision 1.43 1994/11/02 06:56:05 geoff
1400 + * Remove the anyword feature, which I've decided is a bad idea.
1402 + * Revision 1.42 1994/10/25 05:45:59 geoff
1403 + * Add support for an affix that will work with any word, even if there's
1404 + * no explicit flag.
1406 + * Revision 1.41 1994/05/24 06:23:06 geoff
1407 + * Let tgood decide capitalization questions, rather than doing it ourselves.
1409 + * Revision 1.40 1994/05/17 06:44:10 geoff
1410 + * Add support for controlled compound formation and the COMPOUNDONLY
1411 + * option to affix flags.
1413 + * Revision 1.39 1994/01/25 07:11:31 geoff
1414 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
1419 +#include "ispell.h"
1421 +#ifndef NO_CAPITALIZATION_SUPPORT
1422 +Public Logical cap_ok (ichar_t * word, struct success * hit, int len);
1423 +Local Logical entryhasaffixes (struct dent * dent, struct success * hit);
1424 +#endif /* NO_CAPITALIZATION_SUPPORT */
1425 +Public void flagpr (ichar_t * word, int preflag, int prestrip,
1426 + int preadd, int sufflag, int sufadd);
1427 +Local ichar_t * orig_word;
1430 +#ifndef NO_CAPITALIZATION_SUPPORT
1431 +good (ichar_t *w, int ignoreflagbits, int allhits, int pfxopts, int sfxopts)
1434 +good (ichar_t *w, int ignoreflagbits, int dummy, int pfxopts, int sfxopts)
1435 +#define allhits 0 /* Never actually need more than one hit */
1439 + ichar_t nword[INPUTWORDLEN + MAXAFFIXLEN];
1440 + register ichar_t *p;
1441 + register ichar_t *q;
1443 + register struct dent *dp;
1446 + ** Make an uppercase copy of the word we are checking.
1448 + for (p = w, q = nword; *p; )
1449 + *q++ = mytoupper (*p++);
1457 + (void) printf ("%s", ichartosstr (w, 0));
1460 + else if ((dp = lookup (nword, 1)) != NULL)
1462 + hits[0].dictent = dp;
1463 + hits[0].prefix = NULL;
1464 + hits[0].suffix = NULL;
1465 +#ifndef NO_CAPITALIZATION_SUPPORT
1466 + if (allhits || cap_ok (w, &hits[0], n))
1472 + * If we're looking for compounds, and this root doesn't
1473 + * participate in compound formation, undo the hit.
1475 + if (compoundflag == COMPOUND_CONTROLLED
1476 + && ((pfxopts | sfxopts) & FF_COMPOUNDONLY) != 0
1477 + && hashheader.compoundbit >= 0
1478 + && TSTMASKBIT (dp->mask, hashheader.compoundbit) == 0)
1481 + if (numhits && !allhits)
1484 + /* try stripping off affixes */
1487 + numchars = icharlen (nword);
1491 + (void) putchar ('\n');
1492 + return numhits || (numchars == 1);
1496 + chk_aff (w, nword, n, ignoreflagbits, allhits, pfxopts, sfxopts);
1499 + (void) putchar ('\n');
1504 +#ifndef NO_CAPITALIZATION_SUPPORT
1506 +cap_ok (register ichar_t *word, register struct success *hit, int len)
1508 + register ichar_t * dword;
1509 + register ichar_t * w;
1510 + register struct dent * dent;
1511 + ichar_t dentword[INPUTWORDLEN + MAXAFFIXLEN];
1519 + thiscap = whatcap (word);
1521 + ** All caps is always legal, regardless of affixes.
1523 + preadd = prestrip = sufadd = 0;
1524 + if (thiscap == ALLCAPS)
1526 + else if (thiscap == FOLLOWCASE)
1528 + /* Set up some constants for the while(1) loop below */
1531 + preadd = hit->prefix->affl;
1532 + prestrip = hit->prefix->stripl;
1535 + preadd = prestrip = 0;
1536 + sufadd = hit->suffix ? hit->suffix->affl : 0;
1539 + ** Search the variants for one that matches what we have. Note
1540 + ** that thiscap can't be ALLCAPS, since we already returned
1543 + dent = hit->dictent;
1546 + dentcap = captype (dent->flagfield);
1547 + if (dentcap != thiscap)
1549 + if (dentcap == ANYCASE && thiscap == CAPITALIZED
1550 + && entryhasaffixes (dent, hit))
1553 + else /* captypes match */
1555 + if (thiscap != FOLLOWCASE)
1557 + if (entryhasaffixes (dent, hit))
1563 + ** Make sure followcase matches exactly.
1564 + ** Life is made more difficult by the
1565 + ** possibility of affixes. Start with
1568 + (void) strtoichar (dentword, dent->word, INPUTWORDLEN, 1);
1570 + limit = word + preadd;
1571 + if (myupper (dword[prestrip]))
1573 + for (w = word; w < limit; w++)
1576 + goto doublecontinue;
1581 + for (w = word; w < limit; w++)
1584 + goto doublecontinue;
1587 + dword += prestrip;
1588 + /* Do root part of word */
1589 + limit = dword + len - preadd - sufadd;
1590 + while (dword < limit)
1592 + if (*dword++ != *w++)
1593 + goto doublecontinue;
1596 + dword = limit - 1;
1597 + if (myupper (*dword))
1602 + goto doublecontinue;
1610 + goto doublecontinue;
1614 + ** All failure paths go to "doublecontinue,"
1615 + ** so if we get here it must match.
1617 + if (entryhasaffixes (dent, hit))
1622 + if ((dent->flagfield & MOREVARIANTS) == 0)
1624 + dent = dent->next;
1627 + /* No matches found */
1632 +** See if this particular capitalization (dent) is legal with these
1633 +** particular affixes.
1636 +entryhasaffixes (register struct dent *dent, register struct success *hit)
1639 + if (hit->prefix && !TSTMASKBIT (dent->mask, hit->prefix->flagbit))
1641 + if (hit->suffix && !TSTMASKBIT (dent->mask, hit->suffix->flagbit))
1643 + return True; /* Yes, these affixes are legal */
1648 + * Print a word and its flag, making sure the case of the output matches
1649 + * the case of the original found in "orig_word".
1652 +flagpr (register ichar_t *word, /* (Modified) word to print */
1653 + int preflag, /* Prefix flag (if any) */
1654 + int prestrip, /* Lth of pfx stripped off orig_word */
1655 + int preadd, /* Length of prefix added to w */
1656 + int sufflag, /* Suffix flag (if any) */
1657 + int sufadd) /* Length of suffix added to w */
1659 + register ichar_t * origp; /* Pointer into orig_word */
1660 + int orig_len; /* Length of orig_word */
1662 + orig_len = icharlen (orig_word);
1664 + * We refuse to print if the cases outside the modification
1665 + * points don't match those just inside. This prevents things
1666 + * like "OEM's" from being turned into "OEM/S" which expands
1667 + * only to "OEM'S".
1671 + origp = orig_word + preadd;
1672 + if (myupper (*origp))
1674 + for (origp = orig_word; origp < orig_word + preadd; origp++)
1676 + if (mylower (*origp))
1682 + for (origp = orig_word; origp < orig_word + preadd; origp++)
1684 + if (myupper (*origp))
1691 + origp = orig_word + orig_len - sufadd;
1692 + if (myupper (origp[-1]))
1694 + for ( ; *origp != 0; origp++)
1696 + if (mylower (*origp))
1702 + origp = orig_word + orig_len - sufadd;
1703 + for ( ; *origp != 0; origp++)
1705 + if (myupper (*origp))
1711 + * The cases are ok. Put out the word, being careful that the
1712 + * prefix/suffix cases match those in the original, and that the
1713 + * unchanged characters from the original actually match it.
1715 + (void) putchar (' ');
1716 + origp = orig_word + preadd;
1717 + if (myupper (*origp))
1719 + while (--prestrip >= 0)
1720 + (void) fputs (printichar ((int) *word++), stdout);
1724 + while (--prestrip >= 0)
1725 + (void) fputs (printichar ((int) mytolower (*word++)), stdout);
1727 + for (prestrip = orig_len - preadd - sufadd; --prestrip >= 0; word++)
1728 + (void) fputs (printichar ((int) *origp++), stdout);
1729 + if (origp > orig_word)
1731 + if (myupper (*origp))
1732 + (void) fputs (ichartosstr (word, 0), stdout);
1737 + (void) fputs (printichar ((int) mytolower (*word++)), stdout);
1741 + * Now put out the flags
1743 + (void) putchar (hashheader.flagmarker);
1745 + (void) putchar (preflag);
1747 + (void) putchar (sufflag);
1749 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/hash.c vim-6.2.532/src/spell/hash.c
1750 --- vim-6.2.532.orig/src/spell/hash.c 1970-01-01 01:00:00.000000000 +0100
1751 +++ vim-6.2.532/src/spell/hash.c 2004-05-08 09:25:23.934181480 +0200
1754 + * hash.c - a simple hash function for ispell
1756 + * Pace Willisson, 1983
1758 + * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
1759 + * All rights reserved.
1761 + * Redistribution and use in source and binary forms, with or without
1762 + * modification, are permitted provided that the following conditions
1765 + * 1. Redistributions of source code must retain the above copyright
1766 + * notice, this list of conditions and the following disclaimer.
1767 + * 2. Redistributions in binary form must reproduce the above copyright
1768 + * notice, this list of conditions and the following disclaimer in the
1769 + * documentation and/or other materials provided with the distribution.
1770 + * 3. All modifications to the source code must be clearly marked as
1771 + * such. Binary redistributions based on modified source code
1772 + * must be clearly marked as modified versions in the documentation
1773 + * and/or other materials provided with the distribution.
1774 + * 4. All advertising materials mentioning features or use of this software
1775 + * must display the following acknowledgment:
1776 + * This product includes software developed by Geoff Kuenning and
1777 + * other unpaid contributors.
1778 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
1779 + * products derived from this software without specific prior
1780 + * written permission.
1782 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
1783 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1784 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1785 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
1786 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1787 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1788 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1789 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1790 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1791 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1797 + * Revision 1.20 1994/01/25 07:11:34 geoff
1798 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
1802 +#include "ispell.h"
1805 + * The following hash algorithm is due to Ian Dall, with slight modifications
1806 + * by Geoff Kuenning to reflect the results of testing with the English
1807 + * dictionaries actually distributed with ispell.
1809 +#define HASHSHIFT 5
1811 +#ifdef NO_CAPITALIZATION_SUPPORT
1812 +#define HASHUPPER(c) c
1813 +#else /* NO_CAPITALIZATION_SUPPORT */
1814 +#define HASHUPPER(c) mytoupper(c)
1815 +#endif /* NO_CAPITALIZATION_SUPPORT */
1819 + register ichar_t * s,
1820 + register int hashtblsize)
1822 + register long h = 0;
1825 +#ifdef ICHAR_IS_CHAR
1826 + for (i = 4; i-- && *s != 0; )
1827 + h = (h << 8) | HASHUPPER (*s++);
1828 +#else /* ICHAR_IS_CHAR */
1829 + for (i = 2; i-- && *s != 0; )
1830 + h = (h << 16) | HASHUPPER (*s++);
1831 +#endif /* ICHAR_IS_CHAR */
1835 + * We have to do circular shifts the hard way, since C doesn't
1836 + * have them even though the hardware probably does. Oh, well.
1838 + h = (h << HASHSHIFT) |
1839 + ((h >> (32 - HASHSHIFT)) & ((1 << HASHSHIFT) - 1));
1840 + h ^= HASHUPPER (*s++);
1842 + return (unsigned long) h % hashtblsize;
1844 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/i_proto.h vim-6.2.532/src/spell/i_proto.h
1845 --- vim-6.2.532.orig/src/spell/i_proto.h 1970-01-01 01:00:00.000000000 +0100
1846 +++ vim-6.2.532/src/spell/i_proto.h 2004-05-08 09:25:23.936181176 +0200
1848 +Global int addvheader (struct dent * ent);
1849 +Global void askmode (void);
1850 +Global void backup (void);
1851 +#ifndef NO_CAPITALIZATION_SUPPORT
1852 +Global Logical cap_ok (ichar_t * word, struct success * hit, int len);
1853 +#endif /* NO_CAPITALIZATION_SUPPORT */
1854 +Global void chupcase (char * s);
1855 +Global void checkfile (void);
1856 +Global void checkline (FILE * ofile);
1857 +Global void chk_aff (ichar_t * word, ichar_t * ucword, int len,
1858 + int ignoreflagbits, int allhits, int pfxopts, int sfxopts);
1859 +Global int combinecaps (struct dent * hdr, struct dent * newent);
1860 +Global int compoundgood (ichar_t * word, int pfxopts);
1861 +Global void copyout (char ** cc, int cnt);
1862 +Global void correct (char * ctok, int ctokl, ichar_t * itok, int itokl,
1864 +Global char * do_regex_lookup (char * expr, int whence);
1865 +Global SIGNAL_TYPE done (int);
1866 +Global void dumpmode (void);
1867 +Global void erase (void);
1868 +Global int expand_pre (char * croot, ichar_t * rootword,
1869 + MASKTYPE mask[], int option, char *extra);
1870 +Global int expand_suf (char * croot, ichar_t * rootword,
1871 + MASKTYPE mask[], int crossonly, int option, char * extra);
1872 +Global int findfiletype (char * name, int searchnames,
1873 + int * deformatter);
1874 +Global void flagpr (ichar_t * word, int preflag, int prestrip,
1875 + int preadd, int sufflag, int sufadd);
1876 +Global void givehelp (int interactive);
1877 +Global int good (ichar_t * word, int ignoreflagbits, int allhits,
1878 + int pfxopts, int sfxopts);
1879 +Global int hash (ichar_t * word, int hashtablesize);
1880 +#ifndef ICHAR_IS_CHAR
1881 +Global int icharcmp (ichar_t * s1, ichar_t * s2);
1882 +Global ichar_t * icharcpy (ichar_t * out, ichar_t * in);
1883 +Global int icharlen (ichar_t * str);
1884 +Global int icharncmp (ichar_t * s1, ichar_t * s2, int n);
1885 +#endif /* ICHAR_IS_CHAR */
1886 +Global int ichartostr (char * out, ichar_t * in, int outlen,
1888 +Global char * ichartosstr (ichar_t * in, int canonical);
1889 +Global void inverse (void);
1890 +Global struct dent * lookup (ichar_t * word, int dotree);
1891 +Global void lowcase (ichar_t * string);
1892 +Global int makedent (char * lbuf, int lbuflen, struct dent * d);
1893 +Global void makepossibilities (ichar_t * word);
1894 +Global void move (int row, int col);
1895 +Global void normal (void);
1896 +Global char * printichar (int in);
1898 +Global int shellescape (char * buf);
1899 +Global void shescape (char * buf);
1901 +#ifndef REGEX_LOOKUP
1902 +Global int shellescape (char * buf);
1903 +#endif /* REGEX_LOOKUP */
1905 +Global char * skipoverword (char * bufp);
1906 +Global void stop (void);
1907 +Global int stringcharlen (char * bufp, int canonical);
1908 +Global int strtoichar (ichar_t * out, char * in, int outlen,
1910 +Global ichar_t * strtosichar (char * in, int canonical);
1911 +Global void terminit (void);
1912 +Global void toutent (FILE * outfile, struct dent * hent, int onlykeep);
1913 +Global void treeinit (char * persdict, char * LibDict);
1914 +Global void treeinsert (char * word, int wordlen, int keep);
1915 +Global struct dent * treelookup (ichar_t * word);
1916 +Global void treeoutput (void);
1917 +Global void upcase (ichar_t * string);
1918 +#ifndef NO_CAPITALIZATION_SUPPORT
1919 +Global long whatcap (ichar_t * word);
1921 +Global char * xgets (char * string, int size, FILE * stream);
1922 +Global void yyinit (void);
1923 +Global Logical yyopen (char * file);
1924 +Global int yyparse (void);
1926 +#include <string.h>
1928 +#ifdef REGEX_LOOKUP
1930 +Global char * regcmp (const char * expr, const char * terminator, ...);
1931 +Global char * regex (const char * pat, const char * subject, ...);
1933 +Global char * re_comp (const char * expr);
1934 +Global int * re_exec (const char * pat);
1938 +Global int tgetent (char * buf, const char * termname);
1939 +Global int tgetnum (const char * id);
1940 +Global char * tgetstr (const char * id, char ** area);
1941 +Global char * tgoto (const char * cm, int col, int row);
1942 +Global char * tputs (const char * str, int pad, int (*func) (int ch);
1945 +Global char * mypath_rindex(char const *str, char c);
1946 +Global void save_root_cap (ichar_t * word, ichar_t * pattern,
1947 + int prestrip, int preadd, int sufstrip, int sufadd,
1948 + struct dent * firstdent, struct flagent * pfxent,
1949 + struct flagent * sufent,
1950 + ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN],
1952 +Global int casecmp (char * a, char * b, int canonical);
1953 +Global int ins_root_cap (ichar_t * word, ichar_t * pattern,
1954 + int prestrip, int preadd, int sufstrip, int sufadd,
1955 + struct dent * firstdent, struct flagent * pfxent,
1956 + struct flagent * sufent);
1957 +Global int insert(register ichar_t * word);
1958 +Global char * linit (char *);
1959 +Global char * last_slash (char *file);
1960 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/ispell.h vim-6.2.532/src/spell/ispell.h
1961 --- vim-6.2.532.orig/src/spell/ispell.h 1970-01-01 01:00:00.000000000 +0100
1962 +++ vim-6.2.532/src/spell/ispell.h 2004-05-08 09:25:23.940180568 +0200
1969 + * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
1970 + * All rights reserved.
1972 + * Redistribution and use in source and binary forms, with or without
1973 + * modification, are permitted provided that the following conditions
1976 + * 1. Redistributions of source code must retain the above copyright
1977 + * notice, this list of conditions and the following disclaimer.
1978 + * 2. Redistributions in binary form must reproduce the above copyright
1979 + * notice, this list of conditions and the following disclaimer in the
1980 + * documentation and/or other materials provided with the distribution.
1981 + * 3. All modifications to the source code must be clearly marked as
1982 + * such. Binary redistributions based on modified source code
1983 + * must be clearly marked as modified versions in the documentation
1984 + * and/or other materials provided with the distribution.
1985 + * 4. All advertising materials mentioning features or use of this software
1986 + * must display the following acknowledgment:
1987 + * This product includes software developed by Geoff Kuenning and
1988 + * other unpaid contributors.
1989 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
1990 + * products derived from this software without specific prior
1991 + * written permission.
1993 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
1994 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1995 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1996 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
1997 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1998 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1999 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2000 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2001 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2002 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2008 + * Revision 1.68 1995/03/06 02:42:41 geoff
2009 + * Be vastly more paranoid about parenthesizing macro arguments. This
2010 + * fixes a bug in defmt.c where a complex argument was passed to
2013 + * Revision 1.67 1995/01/03 19:24:12 geoff
2014 + * Get rid of a non-global declaration.
2016 + * Revision 1.66 1994/12/27 23:08:49 geoff
2017 + * Fix a lot of subtly bad assumptions about the widths of ints and longs
2018 + * which only show up on 64-bit machines like the Cray and the DEC Alpha.
2020 + * Revision 1.65 1994/11/02 06:56:10 geoff
2021 + * Remove the anyword feature, which I've decided is a bad idea.
2023 + * Revision 1.64 1994/10/25 05:46:18 geoff
2024 + * Add the FF_ANYWORD flag for defining an affix that will apply to any
2025 + * word, even if not explicitly specified. (Good for French.)
2027 + * Revision 1.63 1994/09/16 04:48:28 geoff
2028 + * Make stringdups and laststringch unsigned ints, and dupnos a plain
2029 + * int, so that we can handle more than 128 stringchars and stringchar
2032 + * Revision 1.62 1994/09/01 06:06:39 geoff
2033 + * Change erasechar/killchar to uerasechar/ukillchar to avoid
2034 + * shared-library problems on HP systems.
2036 + * Revision 1.61 1994/08/31 05:58:35 geoff
2037 + * Add contextoffset, used in -a mode to handle extremely long lines.
2039 + * Revision 1.60 1994/05/17 06:44:15 geoff
2040 + * Add support for controlled compound formation and the COMPOUNDONLY
2041 + * option to affix flags.
2043 + * Revision 1.59 1994/03/15 06:25:16 geoff
2044 + * Change deftflag's initialization so we can tell if -t/-n appeared.
2046 + * Revision 1.58 1994/02/07 05:53:28 geoff
2047 + * Add typecasts to the the 7-bit versions of ichar* routines
2049 + * Revision 1.57 1994/01/25 07:11:48 geoff
2050 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
2055 +#include "config.h"
2058 +#define SET_SIZE 128
2060 +#define SET_SIZE 256
2063 +#define MASKSIZE (MASKBITS / MASKTYPE_WIDTH)
2065 +/* The following is really testing for MASKSIZE <= 1, but cpp can't do that */
2066 +#if MASKBITS <= MASKTYPE_WIDTH
2067 +#define SETMASKBIT(mask, bit) ((mask)[0] |= (MASKTYPE) 1 << (bit))
2068 +#define CLRMASKBIT(mask, bit) ((mask)[0] &= (MASKTYPE) ~(1 << (bit)))
2069 +#define TSTMASKBIT(mask, bit) ((mask)[0] & ((MASKTYPE) 1 << (bit)))
2071 +#define SETMASKBIT(mask, bit) \
2072 + ((mask)[(bit) / MASKTYPE_WIDTH] |= \
2073 + (MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1)))
2074 +#define CLRMASKBIT(mask, bit) \
2075 + ((mask)[(bit) / MASKTYPE_WIDTH] &= \
2076 + ~((MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1))))
2077 +#define TSTMASKBIT(mask, bit) \
2078 + ((mask)[(bit) / MASKTYPE_WIDTH] & \
2079 + ((MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1))))
2083 +#define FULLMASKSET
2088 +#define BITTOCHAR(bit) ((bit) + 'A')
2089 +#define CHARTOBIT(ch) ((ch) - 'A')
2091 +#define LARGESTFLAG 26 /* 5 are needed for flagfield below */
2092 +#define FLAGBASE ((MASKTYPE_WIDTH) - 6)
2094 +# if MASKBITS <= 64
2096 +#define BITTOCHAR(bit) ((bit) + 'A')
2097 +#define CHARTOBIT(ch) ((ch) - 'A')
2099 +#define LARGESTFLAG (64 - 6) /* 5 are needed for flagfield below */
2100 +#define FLAGBASE ((MASKTYPE_WIDTH) - 6)
2103 +#define BITTOCHAR(bit) (bit)
2104 +#define CHARTOBIT(ch) (ch)
2106 +#define LARGESTFLAG MASKBITS /* flagfield is a separate field */
2112 +** Data type for internal word storage. If necessary, we use shorts rather
2113 +** than chars so that string characters can be encoded as a single unit.
2115 +#if (SET_SIZE + MAXSTRINGCHARS) <= 256
2117 +#define ICHAR_IS_CHAR
2121 +#ifdef ICHAR_IS_CHAR
2122 +typedef unsigned char ichar_t; /* Internal character */
2123 +#define icharlen(s) strlen ((char *) (s))
2124 +#define icharcpy(a, b) strcpy ((char *) (a), (char *) (b))
2125 +#define icharcmp(a, b) strcmp ((char *) (a), (char *) (b))
2126 +#define icharncmp(a, b, n) strncmp ((char *) (a), (char *) (b), (n))
2127 +#define chartoichar(x) ((ichar_t) (x))
2129 +typedef unsigned short ichar_t; /* Internal character */
2130 +#define chartoichar(x) ((ichar_t) (unsigned char) (x))
2135 + struct dent * next;
2137 + MASKTYPE mask[MASKSIZE];
2144 +** Flags in the directory entry. If FULLMASKSET is undefined, these are
2145 +** stored in the highest bits of the last longword of the mask field. If
2146 +** FULLMASKSET is defined, they are stored in the extra "flags" field.
2147 +#ifndef NO_CAPITALIZATION_SUPPORT
2149 +** If a word has only one capitalization form, and that form is not
2150 +** FOLLOWCASE, it will have exactly one entry in the dictionary. The
2151 +** legal capitalizations will be indicated by the 2-bit capitalization
2152 +** field, as follows:
2154 +** ALLCAPS The word must appear in all capitals.
2155 +** CAPITALIZED The word must be capitalized (e.g., London).
2156 +** It will also be accepted in all capitals.
2157 +** ANYCASE The word may appear in lowercase, capitalized,
2158 +** or all-capitals.
2160 +** Regardless of the capitalization flags, the "word" field of the entry
2161 +** will point to an all-uppercase copy of the word. This is to simplify
2162 +** the large portion of the code that doesn't care about capitalization.
2163 +** Ispell will generate the correct version when needed.
2165 +** If a word has more than one capitalization, there will be multiple
2166 +** entries for it, linked together by the "next" field. The initial
2167 +** entry for such words will be a dummy entry, primarily for use by code
2168 +** that ignores capitalization. The "word" field of this entry will
2169 +** again point to an all-uppercase copy of the word. The "mask" field
2170 +** will contain the logical OR of the mask fields of all variants.
2171 +** A header entry is indicated by a capitalization type of ALLCAPS,
2172 +** with the MOREVARIANTS bit set.
2174 +** The following entries will define the individual variants. Each
2175 +** entry except the last has the MOREVARIANTS flag set, and each
2176 +** contains one of the following capitalization options:
2178 +** ALLCAPS The word must appear in all capitals.
2179 +** CAPITALIZED The word must be capitalized (e.g., London).
2180 +** It will also be accepted in all capitals.
2181 +** FOLLOWCASE The word must be capitalized exactly like the
2182 +** sample in the entry. Prefix (suffix) characters
2183 +** must be rendered in the case of the first (last)
2184 +** "alphabetic" character. It will also be accepted
2185 +** in all capitals. ("Alphabetic" means "mentioned
2186 +** in a 'casechars' statement".)
2187 +** ANYCASE The word may appear in lowercase, capitalized,
2188 +** or all-capitals.
2190 +** The "mask" field for the entry contains only the affix flag bits that
2191 +** are legal for that capitalization. The "word" field will be null
2192 +** except for FOLLOWCASE entries, where it will point to the
2193 +** correctly-capitalized spelling of the root word.
2195 +** It is worth discussing why the ALLCAPS option is used in
2196 +** the header entry. The header entry accepts an all-capitals
2197 +** version of the root plus every affix (this is always legal, since
2198 +** words get capitalized in headers and so forth). Further, all of
2199 +** the following variant entries will reject any all-capitals form
2200 +** that is illegal due to an affix.
2202 +** Finally, note that variations in the KEEP flag can cause a multiple-variant
2203 +** entry as well. For example, if the personal dictionary contains "ALPHA",
2204 +** (KEEP flag set) and the user adds "alpha" with the KEEP flag clear, a
2205 +** multiple-variant entry will be created so that "alpha" will be accepted
2206 +** but only "ALPHA" will actually be kept.
2210 +#define flagfield flags
2212 +#define flagfield mask[MASKSIZE - 1]
2214 +#define USED ((MASKTYPE) 1 << (FLAGBASE + 0))
2215 +#define KEEP ((MASKTYPE) 1 << (FLAGBASE + 1))
2216 +#ifdef NO_CAPITALIZATION_SUPPORT
2217 +#define ALLFLAGS (USED | KEEP)
2218 +#else /* NO_CAPITALIZATION_SUPPORT */
2219 +#define ANYCASE ((MASKTYPE) 0 << (FLAGBASE + 2))
2220 +#define ALLCAPS ((MASKTYPE) 1 << (FLAGBASE + 2))
2221 +#define CAPITALIZED ((MASKTYPE) 2 << (FLAGBASE + 2))
2222 +#define FOLLOWCASE ((MASKTYPE) 3 << (FLAGBASE + 2))
2223 +#define CAPTYPEMASK ((MASKTYPE) 3 << (FLAGBASE + 2))
2224 +#define MOREVARIANTS ((MASKTYPE) 1 << (FLAGBASE + 4))
2225 +#define ALLFLAGS (USED | KEEP | CAPTYPEMASK | MOREVARIANTS)
2226 +#define captype(x) ((x) & CAPTYPEMASK)
2227 +#endif /* NO_CAPITALIZATION_SUPPORT */
2230 + * Language tables used to encode prefix and suffix information.
2234 + ichar_t * strip; /* String to strip off */
2235 + ichar_t * affix; /* Affix to append */
2236 + short flagbit; /* Flag bit this ent matches */
2237 + short stripl; /* Length of strip */
2238 + short affl; /* Length of affix */
2239 + short numconds; /* Number of char conditions */
2240 + short flagflags; /* Modifiers on this flag */
2241 + char conds[SET_SIZE + MAXSTRINGCHARS]; /* Adj. char conds */
2245 + * Bits in flagflags
2247 +#define FF_CROSSPRODUCT (1 << 0) /* Affix does cross-products */
2248 +#define FF_COMPOUNDONLY (1 << 1) /* Afx works in compounds */
2250 +union ptr_union /* Aid for building flg ptrs */
2252 + struct flagptr * fp; /* Pointer to more indexing */
2253 + struct flagent * ent; /* First of a list of ents */
2258 + union ptr_union pu; /* Ent list or more indexes */
2259 + int numents; /* If zero, pu.fp is valid */
2263 + * Description of a single string character type.
2267 + char * name; /* Name of the type */
2268 + char * deformatter; /* Deformatter to use */
2269 + char * suffixes; /* File suffixes, null seps */
2273 + * Header placed at the beginning of the hash file.
2277 + unsigned short magic; /* Magic number for ID */
2278 + unsigned short compileoptions; /* How we were compiled */
2279 + short maxstringchars; /* Max # strchrs we support */
2280 + short maxstringcharlen; /* Max strchr len supported */
2281 + short compoundmin; /* Min lth of compound parts */
2282 + short compoundbit; /* Flag 4 compounding roots */
2283 + unsigned int stringsize; /* Size of string table */
2284 + int lstringsize; /* Size of lang. str tbl */
2285 + unsigned int tblsize; /* No. entries in hash tbl */
2286 + int stblsize; /* No. entries in sfx tbl */
2287 + int ptblsize; /* No. entries in pfx tbl */
2288 + int sortval; /* Largest sort ID assigned */
2289 + int nstrchars; /* No. strchars defined */
2290 + int nstrchartype; /* No. strchar types */
2291 + int strtypestart; /* Start of strtype table */
2292 + char nrchars[5]; /* Nroff special characters */
2293 + char texchars[13]; /* TeX special characters */
2294 +#define TeXleftparen texchars[0]
2295 +#define TeXrightparen texchars[1]
2296 +#define TeXleftsquare texchars[2]
2297 +#define TeXrightsquare texchars[3]
2298 +#define TeXleftcurly texchars[4]
2299 +#define TeXrightcurly texchars[5]
2300 +#define TeXlefttangle texchars[6]
2301 +#define TeXrighttangle texchars[7]
2302 +#define TeXbackslash texchars[8]
2303 +#define TeXdollar texchars[9]
2304 +#define TeXstar texchars[10]
2305 +#define TeXdot texchars[11]
2306 +#define TeXpercent texchars[12]
2307 + char compoundflag; /* Compund-word handling */
2308 + char defhardflag; /* Default tryveryhard flag */
2309 + char flagmarker; /* "Start-of-flags" char */
2310 + unsigned short sortorder[SET_SIZE + MAXSTRINGCHARS]; /* Sort ordering */
2311 + ichar_t lowerconv[SET_SIZE + MAXSTRINGCHARS]; /* Lower-conversion table */
2312 + ichar_t upperconv[SET_SIZE + MAXSTRINGCHARS]; /* Upper-conversion table */
2313 + char wordchars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for chars found in wrds */
2314 + char upperchars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for uppercase chars */
2315 + char lowerchars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for lowercase chars */
2316 + char boundarychars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for boundary chars */
2317 + char stringstarts[SET_SIZE]; /* NZ if char can start str */
2318 + char stringchars[MAXSTRINGCHARS][MAXSTRINGCHARLEN + 1]; /* String chars */
2319 + unsigned int stringdups[MAXSTRINGCHARS]; /* No. of "base" char */
2320 + int dupnos[MAXSTRINGCHARS]; /* Dup char ID # */
2321 + unsigned short magic2; /* Second magic for dbl chk */
2324 +/* hash table magic number */
2325 +#define SPELL_MAGIC 0x9602
2327 +/* compile options, put in the hash header for consistency checking */
2328 +# define MAGICNOTUSED1 0x01
2329 +# define MAGICNOTUSED2 0x02
2331 +# define MAGICMASKSET 0x00
2333 +# if MASKBITS <= 64
2334 +# define MAGICMASKSET 0x04
2336 +# if MASKBITS <= 128
2337 +# define MAGICMASKSET 0x08
2339 +# define MAGICMASKSET 0x0C
2344 +#define COMPILEOPTIONS (MAGICNOTUSED1 | MAGICNOTUSED2 | MAGICMASKSET)
2347 + * Structure used to record data about successful lookups; these values
2348 + * are used in the ins_root_cap routine to produce correct capitalizations.
2352 + struct dent * dictent; /* Header of dict entry chain for wd */
2353 + struct flagent * prefix; /* Prefix flag used, or NULL */
2354 + struct flagent * suffix; /* Suffix flag used, or NULL */
2358 +** Offsets into the nroff special-character array
2360 +#define NRLEFTPAREN hashheader.nrchars[0]
2361 +#define NRRIGHTPAREN hashheader.nrchars[1]
2362 +#define NRDOT hashheader.nrchars[2]
2363 +#define NRBACKSLASH hashheader.nrchars[3]
2364 +#define NRSTAR hashheader.nrchars[4]
2367 +** Values for compoundflag
2369 +#define COMPOUND_NEVER 0 /* Compound words are never good */
2370 +#define COMPOUND_ANYTIME 1 /* Accept run-together words */
2371 +#define COMPOUND_CONTROLLED 2 /* Compounds controlled by afx flags */
2374 +** The isXXXX macros normally only check ASCII range, and don't support
2375 +** the character sets of other languages. These private versions handle
2376 +** whatever character sets have been defined in the affix files.
2378 +#define myupper(X) (hashheader.upperchars[(X)])
2379 +#define mylower(X) (hashheader.lowerchars[(X)])
2380 +#define myspace(X) (((X) > 0) && ((X) < 0x80) \
2381 + && isspace((unsigned char) (X)))
2382 +#define iswordch(X) (hashheader.wordchars[(X)])
2383 +#define isboundarych(X) (hashheader.boundarychars[(X)])
2384 +#define isstringstart(X) (hashheader.stringstarts[(unsigned char) (X)])
2385 +#define mytolower(X) (hashheader.lowerconv[(X)])
2386 +#define mytoupper(X) (hashheader.upperconv[(X)])
2389 +** These macros are similar to the ones above, but they take into account
2390 +** the possibility of string characters. Note well that they take a POINTER,
2391 +** not a character.
2393 +** The "l_" versions set "len" to the length of the string character as a
2394 +** handy side effect. (Note that the global "laststringch" is also set,
2395 +** and sometimes used, by these macros.)
2397 +** The "l1_" versions go one step further and guarantee that the "len"
2398 +** field is valid for *all* characters, being set to 1 even if the macro
2399 +** returns false. This macro is a great example of how NOT to write
2402 +#define isstringch(ptr, canon) (isstringstart (*(ptr)) \
2403 + && stringcharlen ((ptr), (canon)) > 0)
2404 +#define l_isstringch(ptr, len, canon) \
2405 + (isstringstart (*(ptr)) \
2406 + && (len = stringcharlen ((ptr), (canon))) \
2408 +#define l1_isstringch(ptr, len, canon) \
2410 + isstringstart (*(ptr)) \
2412 + stringcharlen ((ptr), (canon))) \
2414 + ? 1 : (len = 1, 0)))
2417 + * Sizes of buffers returned by ichartosstr/strtosichar.
2419 +#define ICHARTOSSTR_SIZE (INPUTWORDLEN + 4 * MAXAFFIXLEN + 4)
2420 +#define STRTOSICHAR_SIZE ((INPUTWORDLEN + 4 * MAXAFFIXLEN + 4) \
2421 + * sizeof (ichar_t))
2424 + * termcap variables
2427 +# define S_EXTERN /* nothing */
2430 +#define Global extern
2431 +# define S_EXTERN extern
2437 +S_EXTERN char * BC; /* backspace if not ^H */
2438 +S_EXTERN char * cd; /* clear to end of display */
2439 +S_EXTERN char * cl; /* clear display */
2440 +S_EXTERN char * cm; /* cursor movement */
2441 +S_EXTERN char * ho; /* home */
2442 +S_EXTERN char * nd; /* non-destructive space */
2443 +S_EXTERN char * so; /* standout */
2444 +S_EXTERN char * se; /* standout end */
2445 +S_EXTERN int sg; /* space taken by so/se */
2446 +S_EXTERN char * ti; /* terminal initialization sequence */
2447 +S_EXTERN char * te; /* terminal termination sequence */
2448 +S_EXTERN int li; /* lines */
2449 +S_EXTERN int co; /* columns */
2451 +S_EXTERN int contextsize; /* number of lines of context to show */
2452 +S_EXTERN char contextbufs[MAXCONTEXT][BUFSIZ]; /* Context of current line */
2453 +S_EXTERN int contextoffset; /* Offset of line start in contextbufs[0] */
2454 +S_EXTERN char * currentchar; /* Location in contextbufs */
2455 +S_EXTERN char ctoken[INPUTWORDLEN + MAXAFFIXLEN]; /* Current token as char */
2456 +S_EXTERN ichar_t itoken[INPUTWORDLEN + MAXAFFIXLEN]; /* Ctoken as ichar_t str */
2458 +S_EXTERN char termcap[2048]; /* termcap entry */
2459 +S_EXTERN char termstr[2048]; /* for string values */
2460 +S_EXTERN char * termptr; /* pointer into termcap, used by tgetstr */
2462 +S_EXTERN int numhits; /* number of hits in dictionary lookups */
2463 +S_EXTERN struct success
2464 + hits[MAX_HITS]; /* table of hits gotten in lookup */
2466 +S_EXTERN char * hashstrings; /* Strings in hash table */
2467 +S_EXTERN struct hashheader
2468 + hashheader; /* Header of hash table */
2469 +S_EXTERN struct dent *
2470 + hashtbl; /* Main hash table, for dictionary */
2471 +S_EXTERN int hashsize; /* Size of main hash table */
2474 +S_EXTERN int aflag; /* NZ if -a or -A option specified */
2475 +S_EXTERN int cflag; /* NZ if -c (crunch) option */
2476 +S_EXTERN int lflag; /* NZ if -l (list) option */
2477 +S_EXTERN int incfileflag; /* whether xgets() acts exactly like gets() */
2478 +Global Logical nodictflag; /* NZ if dictionary not needed */
2480 +S_EXTERN int uerasechar; /* User's erase character, from stty */
2481 +S_EXTERN int ukillchar; /* User's kill character */
2483 +S_EXTERN unsigned int laststringch; /* Number of last string character */
2484 +S_EXTERN int defdupchar; /* Default duplicate string type */
2486 +S_EXTERN unsigned int numpflags; /* Number of prefix flags in table */
2487 +S_EXTERN unsigned int numsflags; /* Number of suffix flags in table */
2488 +S_EXTERN struct flagptr *pflagindex;
2489 + /* Fast index to pflaglist */
2490 +S_EXTERN struct flagent *pflaglist; /* Prefix flag control list */
2491 +S_EXTERN struct flagptr *sflagindex;
2492 + /* Fast index to sflaglist */
2493 +S_EXTERN struct flagent *sflaglist; /* Suffix flag control list */
2495 +S_EXTERN struct strchartype * /* String character type collection */
2498 +S_EXTERN FILE * infile; /* File being corrected */
2499 +S_EXTERN FILE * outfile; /* Corrected copy of infile */
2501 +S_EXTERN char * askfilename; /* File specified in -f option */
2503 +S_EXTERN int changes; /* NZ if changes made to cur. file */
2504 +S_EXTERN int readonly; /* NZ if current file is readonly */
2505 +S_EXTERN int quit; /* NZ if we're done with this file */
2507 +#define MAXPOSSIBLE 100 /* Max no. of possibilities to generate */
2509 +S_EXTERN char possibilities[MAXPOSSIBLE][INPUTWORDLEN + MAXAFFIXLEN];
2510 + /* Table of possible corrections */
2511 +S_EXTERN int pcount; /* Count of possibilities generated */
2512 +S_EXTERN int maxposslen; /* Length of longest possibility */
2513 +S_EXTERN int easypossibilities; /* Number of "easy" corrections found */
2514 + /* ..(defined as those using legal affixes) */
2516 +Global Logical inited;
2518 + * The following array contains a list of characters that should be tried
2519 + * in "missingletter." Note that lowercase characters are omitted.
2521 +S_EXTERN int Trynum; /* Size of "Try" array */
2522 +S_EXTERN ichar_t Try[SET_SIZE + MAXSTRINGCHARS];
2525 + * Initialized variables. These are generated using macros so that they
2526 + * may be consistently declared in all programs. Numerous examples of
2527 + * usage are given below.
2530 +#define S_INIT(decl, init) decl = init
2532 +#define S_INIT(decl, init) extern decl
2536 +S_INIT (int minimenusize, 2); /* MUST be either 2 or zero */
2537 +#else /* MINIMENU */
2538 +S_INIT (int minimenusize, 0); /* MUST be either 2 or zero */
2539 +#endif /* MINIMENU */
2541 +S_INIT (int eflag, 0); /* NZ for expand mode */
2542 +S_INIT (int dumpflag, 0); /* NZ to do dump mode */
2543 +S_INIT (int fflag, 0); /* NZ if -f specified */
2545 +S_INIT (int sflag, 0); /* NZ to stop self after EOF */
2547 +S_INIT (int vflag, 0); /* NZ to display characters as M-xxx */
2548 +S_INIT (int xflag, DEFNOBACKUPFLAG); /* NZ to suppress backups */
2549 +S_INIT (int deftflag, -1); /* NZ for TeX mode by default */
2550 +S_INIT (int tflag, DEFTEXFLAG); /* NZ for TeX mode in current file */
2551 +S_INIT (int prefstringchar, -1); /* Preferred string character type */
2553 +S_INIT (int terse, 0); /* NZ for "terse" mode */
2555 +S_INIT (char tempfile[MAXPATHLEN], ""); /* Name of file we're spelling into */
2557 +S_INIT (int minword, MINWORD); /* Longest always-legal word */
2558 +S_INIT (int sortit, 1); /* Sort suggestions alphabetically */
2559 +S_INIT (int compoundflag, -1); /* How to treat compounds: see above */
2560 +S_INIT (int tryhardflag, -1); /* Always call tryveryhard */
2562 +S_INIT (char * currentfile, NULL); /* Name of current input file */
2564 +/* Odd numbers for math mode in LaTeX; even for LR or paragraph mode */
2565 +S_INIT (int math_mode, 0);
2566 +/* P -- paragraph or LR mode
2567 + * b -- parsing a \begin statement
2568 + * e -- parsing an \end statement
2569 + * r -- parsing a \ref type of argument.
2570 + * m -- looking for a \begin{minipage} argument.
2572 +S_INIT (char LaTeX_Mode, 'P');
2574 +#include "i_proto.h"
2575 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/local.h vim-6.2.532/src/spell/local.h
2576 --- vim-6.2.532.orig/src/spell/local.h 1970-01-01 01:00:00.000000000 +0100
2577 +++ vim-6.2.532/src/spell/local.h 2004-05-08 09:25:23.942180264 +0200
2580 + * Written by Eli Zaretskii <eliz@is.elta.co.il>
2582 + * This is local.h file suitable for compiling Ispell on MS-DOS systems
2583 + * with version 2.x of DJGPP port of GNU C/C++ compiler.
2591 + * WARNING WARNING WARNING
2593 + * This file is *NOT* a normal C header file! Although it uses C
2594 + * syntax and is included in C programs, it is also processed by shell
2595 + * scripts that are very stupid about format.
2597 + * Do not try to use #if constructs to configure this file for more
2598 + * than one configuration. Do not place whitespace after the "#" in
2599 + * "#define". Do not attempt to disable lines by commenting them out.
2600 + * Do not use backslashes to reduce the length of long lines.
2601 + * None of these things will work the way you expect them to.
2603 + * WARNING WARNING WARNING
2607 +** Things that normally go in a Makefile. Define these just like you
2608 +** might in the Makefile, except you should use #define instead of
2609 +** make's assignment syntax. Everything must be double-quoted, and
2610 +** (unlike make) you can't use any sort of $-syntax to pick up the
2611 +** values of other definitions.
2615 +#define CFLAGS "-O2 -g"
2616 +#define YACC "bison -y"
2619 +** TERMLIB - DJGPP doesn't have one, it uses direct screen writes.
2624 +** Where to install various components of ispell. BINDIR contains
2625 +** binaries. LIBDIR contains hash tables and affix files. ELISPDIR
2626 +** contains emacs lisp files (if any) and TEXINFODIR contains emacs
2627 +** TeXinfo files. MAN1DIR and MAN1EXT will hold the chapter-1 and
2628 +** chapter-4 manual pages, respectively.
2630 +** If you intend to use multiple dictionary files, I would suggest
2631 +** LIBDIR be a directory which will contain nothing else, so sensible
2632 +** names can be constructed for the -d option without conflict.
2634 +#define BINDIR "/usr/bin"
2635 +#define LIBDIR "/usr/lib/ispell"
2636 +#define ELISPDIR "/usr/lib/emacs/site-lisp"
2637 +#define TEXINFODIR "/usr/share/info"
2638 +#define MAN1DIR "/usr/share/man/man1"
2639 +#define MAN4DIR "/usr/share/man/man4"
2642 +** List of all hash files (languages) which will be supported by ispell.
2644 +** This variable has a complex format so that many options can be
2645 +** specified. The format is as follows:
2647 +** <language>[,<make-options>...] [<language> [,<make-options> ...] ...]
2651 +** language is the name of a subdirectory of the
2652 +** "languages" directory
2653 +** make-options are options that are to be passed to "make" in
2654 +** the specified directory. The make-options
2655 +** should not, in general, specify a target, as
2656 +** this will be provided by the make process.
2658 +** For example, if LANGUAGES is:
2660 +** "{american,EXTRADICT=/usr/dict/words /usr/dict/web2} {deutsch}",
2662 +** then the American-English and Deutsch (German) languages will be supported,
2663 +** and when the English dictionary is built, the variable
2664 +** 'EXTRADICT=/usr/dict/words /usr/dict/web2' will be passed to the makefile.
2666 +** Notes on the syntax: The makefile is not very robust. If you have
2667 +** make problems, or if make seems to in the language-subdirs
2668 +** dependency, check your syntax. The makefile adds single quotes to
2669 +** the individual variables in the LANGUAGES specification, so don't
2670 +** use quotes of any kind.
2672 +** In the future, the first language listed in this variable will
2673 +** become the default, and the DEFHASH, DEFLANG, and DEFPAFF,
2674 +** variables will all become obsolete. So be sure to put your default
2675 +** language first, to make later conversion easier!
2677 +** Notes on options for the various languages will be found in the
2678 +** Makefiles for those languages. Some of those languages may require
2679 +** you to also change various limits limits like MASKBITS or the
2680 +** length parameters.
2682 +** A special note on the English language: because the British and
2683 +** American dialects use different spelling, you should usually select
2684 +** one or the other of these. If you select both, the setting of
2685 +** MASTERHASH will determine which becomes the language linked to
2686 +** DEFHASH (which will usually be named english.hash).
2688 +** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2689 +** !!! Note the pathname for the `words' file: it might be different !!!
2690 +** !!! If you don't have this file, make EXTRADICT empty !!!
2691 +** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2693 +#define LANGUAGES "{american,MASTERDICTS=americax.med,HASHFILES=amermedx.hash,EXTRADICT=/usr/lib/ispell/words}"
2696 +** Master hash file for DEFHASH. This is the name of a hash file
2697 +** built by a language Makefile. It should be the most-popular hash
2698 +** file on your system, because it is the one that will be used by
2699 +** default. It must be listed in LANGUAGES, above.
2701 +#define MASTERHASH "polish.hash"
2704 +** Default native-language hash file. This is the name given to the
2705 +** hash table that will be used if no language is specified to
2706 +** ispell. It is a link to MASTERHASH, above.
2708 +#define DEFHASH "polish.hash"
2711 +** If your sort command accepts the -T switch to set temp file
2712 +** locations (try it out; on some systems it exists but is
2713 +** undocumented), make the following variable the null string.
2714 +** Otherwise leave it as the sed script.
2716 +** With DJGPP, you will probably use GNU Sort which accepts -T, so:
2721 +** If your system has the rename(2) system call, define HAS_RENAME and
2722 +** ispell will use that call to rename backup files. Otherwise, it
2723 +** will use link/unlink. There is no harm in this except on MS-DOS,
2724 +** which might not support link/unlink (DJGPP does, but also has rename).
2726 +#define HAS_RENAME 1
2728 +/* environment variable for user's word list */
2730 +#define PDICTVAR "WORDLIST"
2734 +** Prefix part of default private dictionary. Under MS-DOS 8.3
2735 +** filename limitation, we are in trouble...
2737 +#define DEFPDICT ".ispell_"
2739 +/* old place to look for default word list */
2740 +#define OLDPDICT ".isp."
2743 +** mktemp template for temporary file - MUST contain 6 consecutive X's.
2744 +** On MSDOS the directory part of TEMPNAME is only used if neither $TMP
2745 +** nor $TEMP nor $TMPDIR (in that order) are defined. If any of these
2746 +** variables is defined, the filename part of TEMPNAME is appended to
2749 +#define TEMPNAME "/tmp/isXXXXXX"
2752 +** If REGEX_LOOKUP is NOT defined, the lookup command (L) will use the look(1)
2753 +** command (if available) or the egrep command. If REGEX_LOOKUP is defined,
2754 +** the lookup command will use the internal dictionary and the
2755 +** regular-expression library (which you must supply separately.
2756 +** DJGPP v2 has POSIX regexp functions.
2758 +#ifndef FEAT_SPELL_HL
2759 +#define REGEX_LOOKUP 1
2763 +** Choose the proper type of regular-expression routines here. BSD
2764 +** and public-domain systems have routines called re_comp and re_exec;
2765 +** System V uses regcmp and regex.
2767 +#include <sys/types.h>
2769 +#define REGCTYPE regex_t *
2770 +#define REGCMP(re,str) (regcomp (re, str, 0), re)
2771 +#define REGEX(re, str, dummy) \
2772 + (re != 0 && regexec (re, str, 0, 0, 0) == 0 ? (char *)1 : NULL)
2773 +#define REGFREE(re) \
2776 + re = (regex_t *)calloc (1, sizeof (regex_t)); \
2783 +** The 2 following definitions are only meaningfull if you don't use
2784 +** any regex library.
2786 +/* path to egrep (use speeded up version if available);
2787 + defined without explicit path, since there are no
2788 + standard places for programs on MS-DOS. */
2789 +#define EGREPCMD "egrep -i"
2791 +/* path to wordlist for Lookup command (typically /usr/dict/{words|web2}) */
2792 +/* note that /usr/dict/web2 is usually a bad idea due to obscure words */
2796 +** FIXME: The filename truncation below is not flexible enough for DJGPP
2797 +** which can support long filenames on some platforms, since we
2798 +** will only know if the support is available at runtime.
2801 +/* max file name length (will truncate to fit BAKEXT) if not in sys/param.h */
2803 +#define MAXNAMLEN NAME_MAX
2805 +#define MAXNAMLEN 12
2808 +#define MAXEXTLEN 4 /* max. extension length including '.' */
2809 +#define MAXBASENAMELEN 8 /* max. base filename length without ext */
2811 +/* define if you want .bak file names truncated to MAXNAMLEN characters */
2812 +/* On MS-DOS, we really have no choice... */
2813 +#define TRUNCATEBAK 1
2816 +** This is the extension that will be added to backup files.
2817 +** On MS-DOS, it makes sense to use the shortest possible extension.
2822 +** Define the following to suppress the 8-bit character feature.
2823 +** FIXME: does this defeat support of foreign languages?
2825 +/*#define NO8BIT 1 */
2831 +** Define this if you want to use the shell for interpretation of commands
2832 +** issued via the "L" command, "^Z" under System V, and "!". If this is
2833 +** not defined then a direct spawnvp() will be used in place of the
2834 +** normal system(). This may speed up these operations if the SHELL
2835 +** environment variable points to a Unix-like shell (such as `sh' or `bash').
2837 +** However, if you undefine USESH, commands which use pipes, redirection
2838 +** and shell wildcards won't work, and you will need support for the SIGTSTP
2839 +** signal, for the above commands to work at all.
2845 +** Define this if you want to be able to type any command at a "type space
2846 +** to continue" prompt.
2848 +#define COMMANDFORSPACE 1
2851 +** The next three variables are used to provide a variable-size context
2852 +** display at the bottom of the screen. Normally, the user will see
2853 +** a number of lines equal to CONTEXTPCT of his screen, rounded down
2854 +** (thus, with CONTEXTPCT == 10, a 24-line screen will produce two lines
2855 +** of context). The context will never be greater than MAXCONTEXT or
2856 +** less than MINCONTEXT. To disable this feature entirely, set MAXCONTEXT
2857 +** and MINCONTEXT to the same value. To round context percentages up,
2858 +** define CONTEXTROUNDUP.
2860 +** Warning: don't set MAXCONTEXT ridiculously large. There is a
2861 +** static buffer of size MAXCONTEXT*BUFSIZ; since BUFSIZ is frequently
2862 +** 1K or larger, this can create a remarkably large executable.
2864 +#define CONTEXTPCT 20 /* Use 20% of the screen for context */
2865 +#define MINCONTEXT 2 /* Always show at least 2 lines of context */
2866 +#define MAXCONTEXT 10 /* Never show more than 10 lines of context */
2867 +#define CONTEXTROUNDUP 1 /* Round context up */
2870 +** Define this if you want the "mini-menu," which gives the most important
2871 +** options at the bottom of the screen, to be the default (in any case, it
2872 +** can be controlled with the "-M" switch).
2877 +** Redefine GETKEYSTROKE() to whatever appropriate on some MS-DOS systems
2878 +** where getchar() doesn't operate properly in raw mode.
2883 +#define GETKEYSTROKE() getxkey()
2885 +#define GETKEYSTROKE() getchar()
2889 +** We include <fcntl.h> to have the definition of O_BINARY. The
2890 +** configuration script will notice this and define MSDOS_BINARY_OPEN.
2895 +** Environment variable to use to locate the home directory. On DOS
2896 +** systems we set this to ISPELL_HOME to avoid conflicts with
2897 +** other programs that look for a HOME environment variable. We're not on DOS.
2899 +#define HOME "HOME"
2900 +#define PDICTHOME "."
2901 +#define OPTIONVAR "ISPELL_OPTIONS"
2902 +#define LIBRARYVAR "ISPELL_DICTDIR"
2905 +** On MS-DOS systems, we define the following variables so that
2906 +** ispell's files have legal suffixes. Note that these suffixes
2907 +** must agree with the way you've defined dictionary files which
2908 +** incorporate these suffixes.
2910 +** Actually, it is not recommended at all to change the suffixes,
2911 +** since they are hardwired in the Makefile's under languages/
2912 +** subdirectory, and MS-DOS will silently truncate excess letters anyway.
2914 +#define HASHSUFFIX ".hash"
2915 +#define STATSUFFIX ".sta"
2916 +#define COUNTSUFFIX ".cnt"
2917 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/lookup.c vim-6.2.532/src/spell/lookup.c
2918 --- vim-6.2.532.orig/src/spell/lookup.c 1970-01-01 01:00:00.000000000 +0100
2919 +++ vim-6.2.532/src/spell/lookup.c 2004-05-08 09:25:23.945179808 +0200
2922 +static char Rcs_Id[] =
2927 + * lookup.c - see if a word appears in the dictionary
2929 + * Pace Willisson, 1983
2931 + * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
2932 + * All rights reserved.
2934 + * Redistribution and use in source and binary forms, with or without
2935 + * modification, are permitted provided that the following conditions
2938 + * 1. Redistributions of source code must retain the above copyright
2939 + * notice, this list of conditions and the following disclaimer.
2940 + * 2. Redistributions in binary form must reproduce the above copyright
2941 + * notice, this list of conditions and the following disclaimer in the
2942 + * documentation and/or other materials provided with the distribution.
2943 + * 3. All modifications to the source code must be clearly marked as
2944 + * such. Binary redistributions based on modified source code
2945 + * must be clearly marked as modified versions in the documentation
2946 + * and/or other materials provided with the distribution.
2947 + * 4. All advertising materials mentioning features or use of this software
2948 + * must display the following acknowledgment:
2949 + * This product includes software developed by Geoff Kuenning and
2950 + * other unpaid contributors.
2951 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
2952 + * products derived from this software without specific prior
2953 + * written permission.
2955 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
2956 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2957 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2958 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
2959 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2960 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2961 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2962 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2963 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2964 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2970 + * Revision 1.42 1995/01/08 23:23:42 geoff
2971 + * Support MSDOS_BINARY_OPEN when opening the hash file to read it in.
2973 + * Revision 1.41 1994/01/25 07:11:51 geoff
2974 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
2978 +#include "ispell.h"
2980 +#include <stdlib.h>
2987 +Local void dumpindex (struct flagptr * indexp, int depth);
2988 +#endif /* INDEXDUMP */
2990 +Public Logical inited = False;
2995 +linit (char * hashname)
2999 + register struct dent * dp;
3000 + struct flagent * entry;
3001 + struct flagptr * ind;
3004 + register ichar_t * cp;
3009 + if(hashtbl != NULL)
3013 + if(pflagindex != NULL)
3015 + pflagindex = NULL;
3016 + if(sflagindex != NULL)
3018 + sflagindex = NULL;
3019 + if((pflagindex = (struct flagptr *)calloc(SET_SIZE + MAXSTRINGCHARS,
3020 + sizeof(struct flagptr))) == NULL)
3022 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3025 + if((sflagindex = (struct flagptr *)calloc(SET_SIZE + MAXSTRINGCHARS,
3026 + sizeof(struct flagptr))) == NULL)
3028 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3032 + if ((hashfd = open (hashname, 0 | MSDOS_BINARY_OPEN)) < 0)
3034 + (void) sprintf(err_buf, CANT_OPEN, hashname);
3038 + hashsize = read (hashfd, (char *) &hashheader, sizeof hashheader);
3039 + if (hashsize < sizeof hashheader)
3042 + (void) sprintf(err_buf, LOOKUP_C_CANT_READ, hashname);
3043 + else if (hashsize == 0)
3044 + (void) sprintf(err_buf, LOOKUP_C_NULL_HASH, hashname);
3046 + (void) sprintf(err_buf, LOOKUP_C_SHORT_HASH (hashname, hashsize,
3047 + (int) sizeof hashheader));
3048 + (void) close (hashfd);
3051 + else if (hashheader.magic != SPELL_MAGIC)
3053 + (void) sprintf(err_buf,
3054 + LOOKUP_C_BAD_MAGIC (hashname, (unsigned int) SPELL_MAGIC,
3055 + (unsigned int) hashheader.magic));
3056 + (void) close (hashfd);
3059 + else if (hashheader.magic2 != SPELL_MAGIC)
3061 + (void) sprintf(err_buf,
3062 + LOOKUP_C_BAD_MAGIC2 (hashname, (unsigned int) SPELL_MAGIC,
3063 + (unsigned int) hashheader.magic2));
3064 + (void) close (hashfd);
3067 + else if (hashheader.compileoptions != COMPILEOPTIONS
3068 + || hashheader.maxstringchars != MAXSTRINGCHARS
3069 + || hashheader.maxstringcharlen != MAXSTRINGCHARLEN)
3071 + (void) sprintf(err_buf,
3072 + LOOKUP_C_BAD_OPTIONS ((unsigned int) hashheader.compileoptions,
3073 + hashheader.maxstringchars, hashheader.maxstringcharlen,
3074 + (unsigned int) COMPILEOPTIONS, MAXSTRINGCHARS, MAXSTRINGCHARLEN));
3075 + (void) close (hashfd);
3081 + * Dictionary is not needed - create an empty dummy table. We
3082 + * actually have to have one entry since the hash
3083 + * algorithm involves a divide by the table size
3084 + * (actually modulo, but zero is still unacceptable).
3085 + * So we create an empty entry.
3087 + hashsize = 1; /* This prevents divides by zero */
3088 + hashtbl = (struct dent *) calloc (1, sizeof (struct dent));
3089 + if (hashtbl == NULL)
3091 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3092 + (void) close (hashfd);
3095 + hashtbl[0].word = NULL;
3096 + hashtbl[0].next = NULL;
3097 + hashtbl[0].flagfield &= ~(USED | KEEP);
3098 + /* The flag bits don't matter, but calloc cleared them. */
3099 + if(hashstrings != NULL)
3100 + free(hashstrings);
3101 + if((hashstrings = (char *) calloc (1, (unsigned) hashheader.lstringsize))
3104 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3105 + (void) close (hashfd);
3111 + if(hashtbl != NULL)
3113 + if((hashtbl = (struct dent *)
3114 + malloc ((unsigned) hashheader.tblsize * sizeof (struct dent))) == NULL)
3116 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3117 + (void) close (hashfd);
3120 + hashsize = hashheader.tblsize;
3121 + if(hashstrings != NULL)
3122 + free(hashstrings);
3123 + if((hashstrings = (char *) malloc ((unsigned) hashheader.stringsize)) == NULL)
3125 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3126 + (void) close (hashfd);
3130 + numsflags = hashheader.stblsize;
3131 + numpflags = hashheader.ptblsize;
3132 + if(sflaglist != NULL)
3134 + if((sflaglist = (struct flagent *)
3135 + malloc ((numsflags + numpflags) * sizeof (struct flagent))) == NULL)
3137 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3138 + (void) close (hashfd);
3141 + pflaglist = sflaglist + numsflags;
3146 + * Read just the strings for the language table, and
3147 + * skip over the rest of the strings and all of the
3150 + if (read (hashfd, hashstrings, (unsigned) hashheader.lstringsize)
3151 + != hashheader.lstringsize)
3153 + (void) sprintf(err_buf, LOOKUP_C_BAD_FORMAT);
3154 + (void) close (hashfd);
3157 + (void) lseek (hashfd,
3158 + (long) hashheader.stringsize - (long) hashheader.lstringsize
3159 + + (long) hashheader.tblsize * (long) sizeof (struct dent), 1);
3163 + if ((unsigned int)read (hashfd, hashstrings,
3164 + (unsigned int) hashheader.stringsize) != hashheader.stringsize
3165 + || (unsigned int)read (hashfd, (char *) hashtbl, (unsigned)
3166 + hashheader.tblsize * sizeof (struct dent))
3167 + != (unsigned int) hashheader.tblsize * sizeof (struct dent))
3169 + (void) sprintf(err_buf, LOOKUP_C_BAD_FORMAT);
3170 + (void) close (hashfd);
3174 + if ((unsigned int)read (hashfd, (char *) sflaglist,
3175 + (unsigned int) (numsflags + numpflags) * sizeof (struct flagent))
3176 + != (unsigned int)(numsflags + numpflags) * sizeof (struct flagent))
3178 + (void) sprintf(err_buf, LOOKUP_C_BAD_FORMAT);
3179 + (void) close (hashfd);
3182 + (void) close (hashfd);
3186 + for (i = hashsize, dp = hashtbl; --i >= 0; dp++)
3188 + if (dp->word == (char *) -1)
3191 + dp->word = &hashstrings [ (int)(dp->word) ];
3192 + if (dp->next == (struct dent *) -1)
3195 + dp->next = &hashtbl [ (int)(dp->next) ];
3199 + for (i = numsflags + numpflags, entry = sflaglist; --i >= 0; entry++)
3201 + if (entry->stripl)
3202 + entry->strip = (ichar_t *) &hashstrings[(int) entry->strip];
3204 + entry->strip = NULL;
3206 + entry->affix = (ichar_t *) &hashstrings[(int) entry->affix];
3208 + entry->affix = NULL;
3211 + ** Warning - 'entry' and 'i' are reset in the body of the loop
3212 + ** below. Don't try to optimize it by (e.g.) moving the decrement
3213 + ** of i into the loop condition.
3215 + for (i = numsflags, entry = sflaglist; i > 0; i--, entry++)
3217 + if (entry->affl == 0)
3220 + ind = &sflagindex[0];
3225 + cp = entry->affix + entry->affl - 1;
3226 + ind = &sflagindex[*cp];
3228 + while (ind->numents == 0 && ind->pu.fp != NULL)
3230 + if (cp == entry->affix)
3232 + ind = &ind->pu.fp[0];
3237 + ind = &ind->pu.fp[*--cp];
3242 + if (ind->numents == 0)
3243 + ind->pu.ent = entry;
3246 + ** If this index entry has more than MAXSEARCH flags in
3247 + ** it, we will split it into subentries to reduce the
3248 + ** searching. However, the split doesn't make sense in
3249 + ** two cases: (a) if we are already at the end of the
3250 + ** current affix, or (b) if all the entries in the list
3251 + ** have identical affixes. Since the list is sorted, (b)
3252 + ** is true if the first and last affixes in the list
3255 + if (!viazero && ind->numents >= MAXSEARCH &&
3256 + icharcmp (entry->affix, ind->pu.ent->affix) != 0)
3258 + /* Sneaky trick: back up and reprocess */
3259 + entry = ind->pu.ent - 1; /* -1 is for entry++ in loop */
3260 + i = numsflags - (entry - sflaglist);
3261 + if((ind->pu.fp = (struct flagptr *)
3262 + calloc ((unsigned) (SET_SIZE + hashheader.nstrchars),
3263 + sizeof (struct flagptr))) == NULL)
3265 + (void) sprintf(err_buf, LOOKUP_C_NO_LANG_SPACE);
3272 + ** Warning - 'entry' and 'i' are reset in the body of the loop
3273 + ** below. Don't try to optimize it by (e.g.) moving the decrement
3274 + ** of i into the loop condition.
3276 + for (i = numpflags, entry = pflaglist; i > 0; i--, entry++)
3278 + if (entry->affl == 0)
3281 + ind = &pflagindex[0];
3286 + cp = entry->affix;
3287 + ind = &pflagindex[*cp++];
3289 + while (ind->numents == 0 && ind->pu.fp != NULL)
3293 + ind = &ind->pu.fp[0];
3298 + ind = &ind->pu.fp[*cp++];
3303 + if (ind->numents == 0)
3304 + ind->pu.ent = entry;
3307 + ** If this index entry has more than MAXSEARCH flags in
3308 + ** it, we will split it into subentries to reduce the
3309 + ** searching. However, the split doesn't make sense in
3310 + ** two cases: (a) if we are already at the end of the
3311 + ** current affix, or (b) if all the entries in the list
3312 + ** have identical affixes. Since the list is sorted, (b)
3313 + ** is true if the first and last affixes in the list
3316 + if (!viazero && ind->numents >= MAXSEARCH
3317 + && icharcmp (entry->affix, ind->pu.ent->affix) != 0)
3319 + /* Sneaky trick: back up and reprocess */
3320 + entry = ind->pu.ent - 1; /* -1 is for entry++ in loop */
3321 + i = numpflags - (entry - pflaglist);
3323 + (struct flagptr *) calloc (SET_SIZE + hashheader.nstrchars,
3324 + sizeof (struct flagptr));
3325 + if (ind->pu.fp == NULL)
3327 + (void) sprintf(err_buf, LOOKUP_C_NO_LANG_SPACE);
3334 + (void) sprintf(err_buf, "Prefix index table:");
3335 + dumpindex (pflagindex, 0);
3336 + (void) sprintf(err_buf, "Suffix index table:");
3337 + dumpindex (sflagindex, 0);
3339 + if (hashheader.nstrchartype == 0)
3343 + chartypes = (struct strchartype *)
3344 + calloc (1, hashheader.nstrchartype * sizeof (struct strchartype));
3345 + if (chartypes == NULL)
3347 + (void) sprintf(err_buf, LOOKUP_C_NO_LANG_SPACE);
3350 + for (i = 0, nextchar = hashheader.strtypestart;
3351 + i < hashheader.nstrchartype; i++)
3353 + chartypes[i].name = &hashstrings[nextchar];
3354 + nextchar += strlen (chartypes[i].name) + 1;
3355 + chartypes[i].deformatter = &hashstrings[nextchar];
3356 + nextchar += strlen (chartypes[i].deformatter) + 1;
3357 + chartypes[i].suffixes = &hashstrings[nextchar];
3358 + while (hashstrings[nextchar] != '\0')
3359 + nextchar += strlen (&hashstrings[nextchar]) + 1;
3370 + register struct flagptr * indexp,
3371 + register int depth)
3376 + char stripbuf[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
3378 + for (i = 0; i < SET_SIZE + hashheader.nstrchars; i++, indexp++)
3380 + if (indexp->numents == 0 && indexp->pu.fp != NULL)
3382 + for (j = depth; --j >= 0; )
3383 + (void) putc (' ', stderr);
3384 + if (i >= ' ' && i <= '~')
3385 + (void) putc (i, stderr);
3387 + (void) fprintf (stderr, "0x%x", i);
3388 + (void) putc ('\n', stderr);
3389 + dumpindex (indexp->pu.fp, depth + 1);
3391 + else if (indexp->numents)
3393 + for (j = depth; --j >= 0; )
3394 + (void) putc (' ', stderr);
3395 + if (i >= ' ' && i <= '~')
3396 + (void) putc (i, stderr);
3398 + (void) fprintf (stderr, "0x%x", i);
3399 + (void) fprintf (stderr, " -> %d entries\n", indexp->numents);
3400 + for (k = 0; k < indexp->numents; k++)
3402 + for (j = depth; --j >= 0; )
3403 + (void) putc (' ', stderr);
3404 + if (indexp->pu.ent[k].stripl)
3406 + (void) ichartostr (stripbuf, indexp->pu.ent[k].strip,
3407 + sizeof stripbuf, 1);
3408 + (void) fprintf (stderr, " entry %d (-%s,%s)\n",
3409 + &indexp->pu.ent[k] - sflaglist,
3411 + indexp->pu.ent[k].affl
3412 + ? ichartosstr (indexp->pu.ent[k].affix, 1) : "-");
3415 + (void) fprintf (stderr, " entry %d (%s)\n",
3416 + &indexp->pu.ent[k] - sflaglist,
3417 + ichartosstr (indexp->pu.ent[k].affix, 1));
3424 +/* n is length of s */
3425 +Public struct dent *
3426 +lookup (register ichar_t *s, int dotree)
3429 + register struct dent * dp;
3430 + register char * s1;
3431 + char schar[INPUTWORDLEN + MAXAFFIXLEN];
3433 + dp = &hashtbl[hash (s, hashsize)];
3434 + if (ichartostr (schar, s, sizeof schar, 1))
3435 + (void) fprintf (stderr, WORD_TOO_LONG (schar));
3436 + for ( ; dp != NULL; dp = dp->next)
3438 + /* quick strcmp, but only for equality */
3440 + if (s1 && s1[0] == schar[0] && strcmp (s1 + 1, schar + 1) == 0)
3442 +#ifndef NO_CAPITALIZATION_SUPPORT
3443 + while (dp->flagfield & MOREVARIANTS) /* Skip variations */
3449 + dp = treelookup (s);
3455 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/makedent.c vim-6.2.532/src/spell/makedent.c
3456 --- vim-6.2.532.orig/src/spell/makedent.c 1970-01-01 01:00:00.000000000 +0100
3457 +++ vim-6.2.532/src/spell/makedent.c 2004-05-08 09:25:23.953178592 +0200
3460 + * Copyright 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
3461 + * All rights reserved.
3463 + * Redistribution and use in source and binary forms, with or without
3464 + * modification, are permitted provided that the following conditions
3467 + * 1. Redistributions of source code must retain the above copyright
3468 + * notice, this list of conditions and the following disclaimer.
3469 + * 2. Redistributions in binary form must reproduce the above copyright
3470 + * notice, this list of conditions and the following disclaimer in the
3471 + * documentation and/or other materials provided with the distribution.
3472 + * 3. All modifications to the source code must be clearly marked as
3473 + * such. Binary redistributions based on modified source code
3474 + * must be clearly marked as modified versions in the documentation
3475 + * and/or other materials provided with the distribution.
3476 + * 4. All advertising materials mentioning features or use of this software
3477 + * must display the following acknowledgment:
3478 + * This product includes software developed by Geoff Kuenning and
3479 + * other unpaid contributors.
3480 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
3481 + * products derived from this software without specific prior
3482 + * written permission.
3484 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
3485 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3486 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3487 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
3488 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3489 + * DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3490 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3491 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3492 + * LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3493 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3499 + * Revision 1.45 1994/12/27 23:08:52 geoff
3500 + * Add code to makedent to reject words that contain non-word characters.
3501 + * This helps protect people who use ISO 8-bit characters when ispell
3502 + * isn't configured for that option.
3504 + * Revision 1.44 1994/10/25 05:46:20 geoff
3505 + * Fix some incorrect declarations in the lint versions of some routines.
3507 + * Revision 1.43 1994/09/16 03:32:34 geoff
3508 + * Issue an error message for bad affix flags
3510 + * Revision 1.42 1994/02/07 04:23:43 geoff
3511 + * Correctly identify the deformatter when changing file types
3513 + * Revision 1.41 1994/01/25 07:11:55 geoff
3514 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
3518 +#include "ispell.h"
3519 +#include <stdlib.h>
3522 +Global int makedent(char * lbuf, int lbuflen, struct dent * ent);
3523 +#ifndef NO_CAPITALIZATION_SUPPORT
3524 +Global long whatcap(ichar_t * word);
3526 +Global int addvheader(struct dent * ent);
3527 +Global int combinecaps(struct dent * hdr, struct dent * newent);
3528 +#ifndef NO_CAPITALIZATION_SUPPORT
3529 +Local void forcevheader(struct dent * hdrp, struct dent * oldp,
3530 + struct dent * newp);
3531 +#endif /* NO_CAPITALIZATION_SUPPORT */
3532 +Local int combine_two_entries(struct dent * hdrp,
3533 + struct dent * oldp, struct dent * newp);
3534 +Local int acoversb(struct dent * enta, struct dent * entb);
3535 +Global void upcase(ichar_t * string);
3536 +Global void lowcase(ichar_t * string);
3537 +Global void chupcase(char * s);
3538 +Local int issubset(struct dent * ent1, struct dent * ent2);
3539 +Local void combineaffixes(struct dent * ent1, struct dent * ent2);
3540 +Global void toutent(FILE * outfile, struct dent * hent, int onlykeep);
3541 +Local void toutword(FILE * outfile, char * word, struct dent * cent);
3542 +Local void flagout(FILE * outfile, int flag);
3543 +Global int stringcharlen(char * bufp, int canonical);
3544 +Global int strtoichar(ichar_t * out, char * in, int outlen,
3546 +Global int ichartostr(char * out, ichar_t * in, int outlen,
3548 +Global ichar_t * strtosichar(char * in, int canonical);
3549 +Global char * ichartosstr(ichar_t * in, int canonical);
3550 +Global char * printichar(int in);
3551 +#ifndef ICHAR_IS_CHAR
3552 +Global ichar_t * icharcpy(ichar_t * out, ichar_t * in);
3553 +Global int icharlen(ichar_t * str);
3554 +Global int icharcmp(ichar_t * s1, ichar_t * s2);
3555 +Global int icharncmp(ichar_t * s1, ichar_t * s2, int n);
3556 +#endif /* ICHAR_IS_CHAR */
3557 +Global int findfiletype(char * name, int searchnames,
3558 + int * deformatter);
3560 +Local Logical has_marker;
3563 + * Fill in a directory entry, including setting the capitalization flags, and
3564 + * allocate and initialize memory for the d->word field. Returns -1
3565 + * if there was trouble. The input word must be in canonical form.
3574 + ichar_t ibuf[INPUTWORDLEN + MAXAFFIXLEN];
3580 + /* Strip off any trailing newline */
3581 + len = strlen(lbuf) - 1;
3582 + if(lbuf[len] == '\n')
3586 + /* WARNING: flagfield might be the same as mask! See ispell.h. */
3588 + (void) bzero ((char *) d->mask, sizeof (d->mask));
3589 + d->flagfield |= USED;
3590 + d->flagfield &= ~KEEP;
3592 + p = index(lbuf, hashheader.flagmarker);
3597 + ** Convert the word to an ichar_t and back; this makes sure that
3598 + ** it is in canonical form and thus that the length is correct.
3600 + if(strtoichar(ibuf, lbuf, INPUTWORDLEN * sizeof (ichar_t), 1)
3601 + || ichartostr(lbuf, ibuf, lbuflen, 1))
3603 + (void) fprintf(stderr, WORD_TOO_LONG (lbuf));
3607 + ** Make sure the word is well-formed(contains only legal characters).
3609 + for(ip = ibuf; *ip != 0; ip++)
3611 + if(!iswordch(*ip))
3613 + /* Boundary characters are legal as long as they're not at edges */
3614 + if(!isboundarych(*ip) || ip == ibuf || ip[1] == 0)
3616 + (void) fprintf(stderr, MAKEDENT_C_BAD_WORD_CHAR, lbuf);
3621 + len = strlen(lbuf);
3622 +#ifndef NO_CAPITALIZATION_SUPPORT
3624 + ** Figure out the capitalization rules from the capitalization of
3625 + ** the sample entry.
3627 + d->flagfield |= whatcap(ibuf);
3630 + if(len > INPUTWORDLEN - 1)
3632 + (void) fprintf(stderr, WORD_TOO_LONG (lbuf));
3636 + d->word = malloc((unsigned) len + 1);
3637 + if(d->word == NULL)
3639 + (void) fprintf(stderr, MAKEDENT_C_NO_WORD_SPACE, lbuf);
3643 + (void) strcpy (d->word, lbuf);
3644 +#ifdef NO_CAPITALIZATION_SUPPORT
3645 + chupcase(d->word);
3646 +#else /* NO_CAPITALIZATION_SUPPORT */
3647 + if(captype(d->flagfield) != FOLLOWCASE)
3648 + chupcase(d->word);
3649 +#endif /* NO_CAPITALIZATION_SUPPORT */
3654 + while(*p != '\0' && *p != '\n')
3656 + bit = CHARTOBIT((unsigned char) *p);
3657 + if(bit >= 0 && bit <= LARGESTFLAG)
3658 + SETMASKBIT(d->mask, bit);
3660 + (void) fprintf (stderr, BAD_FLAG, (unsigned char) *p);
3662 + if(*p == hashheader.flagmarker)
3663 + p++; /* Handle old-format dictionaries too */
3668 +#ifndef NO_CAPITALIZATION_SUPPORT
3670 +** Classify the capitalization of a sample entry. Returns one of the
3671 +** four capitalization codes ANYCASE, ALLCAPS, CAPITALIZED, or FOLLOWCASE.
3675 +whatcap(register ichar_t * word)
3677 + register ichar_t * p;
3679 + for(p = word; *p; p++)
3694 + ** No uppercase letters follow the lowercase ones.
3695 + ** If there is more than one uppercase letter, it's
3696 + ** "followcase". If only the first one is capitalized,
3697 + ** it's "capitalize". If there are no capitals
3698 + ** at all, it's ANYCASE.
3700 + if(myupper(word[0]))
3702 + for(p = word + 1; *p != '\0'; p++)
3704 + return FOLLOWCASE;
3705 + return CAPITALIZED;
3711 + return FOLLOWCASE; /* .../lower/upper */
3716 +** Add a variant-capitalization header to a word. This routine may be
3717 +** called even for a followcase word that doesn't yet have a header.
3719 +** Returns 0 if all was ok, -1 if allocation error.
3722 +addvheader(register struct dent *dp) /* Entry to update */
3724 + register struct dent * tdent; /* Copy of entry */
3727 + ** Add a second entry with the correct capitalization, and then make
3728 + ** dp into a special dummy entry.
3730 + tdent = (struct dent *) malloc (sizeof (struct dent));
3733 + (void) fprintf(stderr, MAKEDENT_C_NO_WORD_SPACE, dp->word);
3737 + if(captype(tdent->flagfield) != FOLLOWCASE)
3738 + tdent->word = NULL;
3741 + /* Followcase words need a copy of the capitalization */
3742 + tdent->word = malloc((unsigned int) strlen (tdent->word) + 1);
3743 + if(tdent->word == NULL)
3745 + (void) fprintf (stderr, MAKEDENT_C_NO_WORD_SPACE, dp->word);
3746 + free((char *) tdent);
3749 + (void) strcpy(tdent->word, dp->word);
3751 + chupcase(dp->word);
3753 + dp->flagfield &= ~CAPTYPEMASK;
3754 + dp->flagfield |= (ALLCAPS | MOREVARIANTS);
3757 +#endif /* NO_CAPITALIZATION_SUPPORT */
3760 +** Combine and resolve the entries describing two capitalizations of the same
3761 +** word. This may require allocating yet more entries.
3763 +** Hdrp is a pointer into a hash table. If the word covered by hdrp has
3764 +** variations, hdrp must point to the header. Newp is a pointer to temporary
3765 +** storage, and space is malloc'ed if newp is to be kept. The newp->word
3766 +** field must have been allocated with mymalloc, so that this routine may free
3767 +** the space if it keeps newp but not the word.
3769 +** Return value: 0 if the word was added, 1 if the word was combined
3770 +** with an existing entry, and -1 if trouble occurred(e.g., malloc).
3771 +** If 1 is returned, newp->word may have been be freed using myfree.
3773 +** Life is made much more difficult by the KEEP flag's possibilities. We
3774 +** must ensure that a !KEEP word doesn't find its way into the personal
3775 +** dictionary as a result of this routine's actions. However, a !KEEP
3776 +** word that has affixes must have come from the main dictionary, so it
3777 +** is acceptable to combine entries in that case(got that?).
3779 +** The net result of all this is a set of rules that is a bloody pain
3780 +** to figure out. Basically, we want to choose one of the following actions:
3782 +** (1) Add newp's affixes and KEEP flag to oldp, and discard newp.
3783 +** (2) Add oldp's affixes and KEEP flag to newp, replace oldp with
3784 +** newp, and discard newp.
3785 +#ifndef NO_CAPITALIZATION_SUPPORT
3786 +** (3) Insert newp as a new entry in the variants list. If there is
3787 +** currently no variant header, this requires adding one. Adding a
3788 +** header splits into two sub-cases:
3790 +** (3a) If oldp is ALLCAPS and the KEEP flags match, just turn it
3791 +** into the header.
3792 +** (3b) Otherwise, add a new entry to serve as the header.
3793 +** To ease list linking, this is done by copying oldp into
3794 +** the new entry, and then performing(3a).
3796 +** After newp has been added as a variant, its affixes and KEEP
3797 +** flag are OR-ed into the variant header.
3800 +** So how to choose which? The default is always case(3), which adds newp
3801 +** as a new entry in the variants list. Cases(1) and (2) are symmetrical
3802 +** except for which entry is discarded. We can use case(1) or (2) whenever
3803 +** one entry "covers" the other. "Covering" is defined as follows:
3805 +** (4) For entries with matching capitalization types, A covers B
3808 +** (4a) B's affix flags are a subset of A's, or the KEEP flags
3810 +** (4b) either the KEEP flags match, or A's KEEP flag is set.
3811 +** (Since A has more suffixes, combining B with it won't
3812 +** cause any extra suffixes to be added to the dictionary.)
3813 +** (4c) If the words are FOLLOWCASE, the capitalizations match
3816 +#ifndef NO_CAPITALIZATION_SUPPORT
3817 +** (5) For entries with mismatched capitalization types, A covers B
3818 +** if(4a) and(4b) are true, and:
3820 +** (5a) B is ALLCAPS, or
3821 +** (5b) A is ANYCASE, and B is CAPITALIZED.
3824 +** For any "hdrp" without variants, oldp is the same as hdrp. Otherwise,
3825 +** the above tests are applied using each variant in turn for oldp.
3829 + struct dent * hdrp, /* Header of entry currently in dictionary */
3830 + register struct dent * newp) /* Entry to add */
3832 + register struct dent *
3833 + oldp; /* Current "oldp" entry */
3834 +#ifndef NO_CAPITALIZATION_SUPPORT
3835 + register struct dent *
3836 + tdent; /* Entry we'll add to the dictionary */
3837 +#endif /* NO_CAPITALIZATION_SUPPORT */
3838 + register int retval = 0; /* Return value from combine_two_entries */
3841 + ** First, see if we can combine the two entries(cases 1 and 2). If
3842 + ** combine_two_entries does so, it will return 1. If it has trouble,
3843 + ** it will return zero.
3846 +#ifdef NO_CAPITALIZATION_SUPPORT
3847 + retval = combine_two_entries(hdrp, oldp, newp);
3848 +#else /* NO_CAPITALIZATION_SUPPORT */
3849 + if((oldp->flagfield &(CAPTYPEMASK | MOREVARIANTS))
3850 + == (ALLCAPS | MOREVARIANTS))
3852 + while(oldp->flagfield & MOREVARIANTS)
3854 + oldp = oldp->next;
3855 + retval = combine_two_entries(hdrp, oldp, newp);
3856 + if(retval != 0) /* Did we combine them? */
3861 + retval = combine_two_entries(hdrp, oldp, newp);
3865 + ** Couldn't combine the two entries. Add a new variant. For
3866 + ** ease, we'll stick it right behind the header, rather than
3867 + ** at the end of the list.
3869 + forcevheader(hdrp, oldp, newp);
3870 + tdent = (struct dent *) malloc (sizeof (struct dent));
3873 + (void) fprintf (stderr, MAKEDENT_C_NO_WORD_SPACE, newp->word);
3877 + tdent->next = hdrp->next;
3878 + hdrp->next = tdent;
3879 + tdent->flagfield |= (hdrp->flagfield & MOREVARIANTS);
3880 + hdrp->flagfield |= MOREVARIANTS;
3881 + combineaffixes(hdrp, newp);
3882 + hdrp->flagfield |= (newp->flagfield & KEEP);
3883 + if(captype(newp->flagfield) == FOLLOWCASE)
3884 + tdent->word = newp->word;
3887 + tdent->word = NULL;
3888 + free(newp->word); /* newp->word isn't needed */
3891 +#endif /* NO_CAPITALIZATION_SUPPORT */
3895 +#ifndef NO_CAPITALIZATION_SUPPORT
3897 +** The following routine implements steps 3a and 3b in the commentary
3898 +** for "combinecaps".
3902 + register struct dent * hdrp,
3903 + struct dent * oldp,
3904 + struct dent * newp)
3907 + if((hdrp->flagfield &(CAPTYPEMASK | MOREVARIANTS)) == ALLCAPS
3908 + && ((oldp->flagfield ^ newp->flagfield) & KEEP) == 0)
3909 + return; /* Caller will set MOREVARIANTS */
3910 + else if((hdrp->flagfield &(CAPTYPEMASK | MOREVARIANTS))
3911 + != (ALLCAPS | MOREVARIANTS))
3912 + (void) addvheader(hdrp);
3914 +#endif /* NO_CAPITALIZATION_SUPPORT */
3917 +** This routine implements steps 4 and 5 of the commentary for "combinecaps".
3919 +** Returns 1 if newp can be discarded, 0 if nothing done.
3922 +combine_two_entries(
3923 + struct dent *hdrp, /*(Possible) header of variant chain */
3924 + register struct dent *oldp, /* Pre-existing dictionary entry */
3925 + register struct dent *newp) /* Entry to possibly combine */
3928 + if(acoversb(oldp, newp))
3930 + /* newp is superfluous. Drop it, preserving affixes and keep flag */
3931 + combineaffixes(oldp, newp);
3932 + oldp->flagfield |= (newp->flagfield & KEEP);
3933 + hdrp->flagfield |= (newp->flagfield & KEEP);
3937 + else if(acoversb(newp, oldp))
3940 + ** oldp is superfluous. Replace it with newp, preserving affixes and
3943 + combineaffixes(newp, oldp);
3944 +#ifdef NO_CAPITALIZATION_SUPPORT
3945 + newp->flagfield |= (oldp->flagfield & KEEP);
3946 +#else /* NO_CAPITALIZATION_SUPPORT */
3947 + newp->flagfield |= (oldp->flagfield & (KEEP | MOREVARIANTS));
3948 +#endif /* NO_CAPITALIZATION_SUPPORT */
3949 + hdrp->flagfield |= (newp->flagfield & KEEP);
3950 + newp->next = oldp->next;
3952 + ** We really want to free oldp->word, but that might be part of
3953 + ** "hashstrings". So we'll futz around to arrange things so we can
3954 + ** free newp->word instead. This depends very much on the fact
3955 + ** that both words are the same length.
3957 + if(oldp->word != NULL)
3958 + (void) strcpy (oldp->word, newp->word);
3959 + free(newp->word); /* No longer needed */
3960 + newp->word = oldp->word;
3962 +#ifndef NO_CAPITALIZATION_SUPPORT
3963 + /* We may need to add a header if newp is followcase */
3964 + if(captype(newp->flagfield) == FOLLOWCASE
3965 + && (hdrp->flagfield & (CAPTYPEMASK | MOREVARIANTS))
3966 + != (ALLCAPS | MOREVARIANTS))
3967 + (void) addvheader (hdrp);
3968 +#endif /* NO_CAPITALIZATION_SUPPORT */
3976 +** Determine if enta covers entb, according to the rules in steps 4 and 5
3977 +** of the commentary for "combinecaps".
3981 + register struct dent * enta, /* "A" in the rules */
3982 + register struct dent * entb) /* "B" in the rules */
3984 + int subset; /* NZ if entb is a subset of enta */
3986 + if((subset = issubset(entb, enta)) != 0)
3988 + /* entb is a subset of enta; thus enta might cover entb */
3989 + if(((enta->flagfield ^ entb->flagfield) & KEEP) != 0
3990 + && (enta->flagfield & KEEP) == 0) /* Inverse of condition (4b) */
3995 + /* not a subset; KEEP flags must match exactly(both (4a) and (4b)) */
3996 + if(((enta->flagfield ^ entb->flagfield) & KEEP) != 0)
4000 + /* Rules(4a) and (4b) are satisfied; check for capitalization match */
4001 +#ifdef NO_CAPITALIZATION_SUPPORT
4003 + return subset; /* Just so it gets used */
4005 + return 1; /* All words match */
4007 +#else /* NO_CAPITALIZATION_SUPPORT */
4008 + if(((enta->flagfield ^ entb->flagfield) & CAPTYPEMASK) == 0)
4010 + if(captype(enta->flagfield) != FOLLOWCASE /* Condition (4c) */
4011 + || strcmp(enta->word, entb->word) == 0)
4012 + return 1; /* Perfect match */
4016 + else if(subset == 0) /* No flag subset, refuse */
4017 + return 0; /* ..near matches */
4018 + else if(captype(entb->flagfield) == ALLCAPS)
4020 + else if(captype(enta->flagfield) == ANYCASE
4021 + && captype(entb->flagfield) == CAPITALIZED)
4025 +#endif /* NO_CAPITALIZATION_SUPPORT */
4029 +upcase(register ichar_t * s)
4034 + *s = mytoupper(*s);
4040 +lowcase(register ichar_t * s)
4045 + *s = mytolower(*s);
4051 + * Upcase variant that works on normal strings. Note that it is a lot
4052 + * slower than the normal upcase. The input must be in canonical form.
4059 + is = strtosichar(s, 1);
4061 + (void) ichartostr (s, is, strlen (s) + 1, 1);
4065 +** See if one affix field is a subset of another. Returns NZ if ent1
4066 +** is a subset of ent2. The KEEP flag is not taken into consideration.
4070 + register struct dent * ent1,
4071 + register struct dent * ent2)
4073 +/* The following is really testing for MASKSIZE > 1, but cpp can't do that */
4075 + register int flagword;
4078 +#define MASKMAX MASKSIZE
4080 +#define MASKMAX MASKSIZE - 1
4081 +#endif /* FULLMASKSET */
4082 + for(flagword = MASKMAX; --flagword >= 0; )
4084 + if((ent1->mask[flagword] & ent2->mask[flagword])
4085 + != ent1->mask[flagword])
4088 +#endif /* MASKBITS > 32 */
4090 + return((ent1->mask[MASKSIZE - 1] & ent2->mask[MASKSIZE - 1])
4091 + == ent1->mask[MASKSIZE - 1]);
4093 + if(((ent1->mask[MASKSIZE - 1] & ent2->mask[MASKSIZE - 1])
4094 + ^ ent1->mask[MASKSIZE - 1]) & ~ALLFLAGS)
4098 +#endif /* FULLMASKSET */
4102 +** Add ent2's affix flags to ent1.
4106 + register struct dent * ent1,
4107 + register struct dent * ent2)
4109 +/* The following is really testing for MASKSIZE > 1, but cpp can't do that */
4111 + register int flagword;
4115 + /* MASKMAX is defined in issubset, just above */
4116 + for(flagword = MASKMAX; --flagword >= 0; )
4117 + ent1->mask[flagword] |= ent2->mask[flagword];
4118 +#endif /* MASKBITS > 32 */
4119 +#ifndef FULLMASKSET
4120 + ent1->mask[MASKSIZE - 1] |= ent2->mask[MASKSIZE - 1] & ~ALLFLAGS;
4125 +** Write out a dictionary entry, including capitalization variants.
4126 +** If onlykeep is true, only those variants with KEEP set will be
4131 + register FILE * toutfile,
4132 + struct dent * hent,
4133 + register int onlykeep)
4135 +#ifdef NO_CAPITALIZATION_SUPPORT
4136 + if(!onlykeep || (hent->flagfield & KEEP))
4137 + toutword(toutfile, hent->word, hent);
4139 + register struct dent * cent;
4140 + ichar_t wbuf[INPUTWORDLEN + MAXAFFIXLEN];
4143 + if(strtoichar(wbuf, cent->word, INPUTWORDLEN, 1))
4144 + (void) fprintf(stderr, WORD_TOO_LONG (cent->word));
4147 + if(!onlykeep || (cent->flagfield & KEEP))
4149 + switch(captype (cent->flagfield))
4153 + toutword(toutfile, ichartosstr (wbuf, 1), cent);
4156 + if((cent->flagfield & MOREVARIANTS) == 0 || cent != hent)
4159 + toutword(toutfile, ichartosstr (wbuf, 1), cent);
4164 + wbuf[0] = mytoupper(wbuf[0]);
4165 + toutword(toutfile, ichartosstr (wbuf, 1), cent);
4168 + toutword(toutfile, cent->word, cent);
4172 + if(cent->flagfield & MOREVARIANTS)
4173 + cent = cent->next;
4182 + register FILE * toutfile,
4184 + register struct dent * cent)
4188 + has_marker = False;
4189 + (void) fprintf (toutfile, "%s", word);
4190 + for(bit = 0; bit < LARGESTFLAG; bit++)
4192 + if(TSTMASKBIT(cent->mask, bit))
4193 + flagout(toutfile, BITTOCHAR (bit));
4195 + (void) fprintf (toutfile, "\n");
4200 + register FILE * toutfile,
4204 + (void) putc(hashheader.flagmarker, toutfile);
4205 + has_marker = True;
4206 + (void) putc (flag, toutfile);
4210 + * If the string under the given pointer begins with a string character,
4211 + * return the length of that "character". If not, return 0.
4212 + * May be called any time, but it's best if "isstrstart" is first
4213 + * used to filter out unnecessary calls.
4215 + * As a side effect, "laststringch" is set to the number of the string
4216 + * found, or to -1 if none was found. This can be useful for such things
4217 + * as case conversion.
4222 + int canonical) /* NZ if input is in canonical form */
4224 +#ifdef SLOWMULTIPLY
4225 + static char * sp[MAXSTRINGCHARS];
4226 + static int m_inited = 0;
4227 +#endif /* SLOWMULTIPLY */
4228 + register char * bufcur;
4229 + register char * stringcur;
4230 + register int stringno;
4231 + register int lowstringno;
4232 + register int highstringno;
4235 +#ifdef SLOWMULTIPLY
4239 + for(stringno = 0; stringno < MAXSTRINGCHARS; stringno++)
4240 + sp[stringno] = &hashheader.stringchars[stringno][0];
4242 +#endif /* SLOWMULTIPLY */
4244 + highstringno = hashheader.nstrchars - 1;
4245 + dupwanted = canonical ? 0 : defdupchar;
4246 + while(lowstringno <= highstringno)
4248 + stringno = (lowstringno + highstringno) >> 1;
4249 +#ifdef SLOWMULTIPLY
4250 + stringcur = sp[stringno];
4251 +#else /* SLOWMULTIPLY */
4252 + stringcur = &hashheader.stringchars[stringno][0];
4253 +#endif /* SLOWMULTIPLY */
4258 + if(((*bufcur++ ^ *stringcur) & 0x7F) != 0)
4260 + if(*bufcur++ != *stringcur)
4261 +#endif /* NO8BIT */
4264 + ** We can't use autoincrement above because of the
4269 + if(*stringcur == '\0')
4271 + if(hashheader.dupnos[stringno] == dupwanted)
4273 + /* We have a match */
4274 + laststringch = hashheader.stringdups[stringno];
4275 +#ifdef SLOWMULTIPLY
4276 + return stringcur - sp[stringno];
4277 +#else /* SLOWMULTIPLY */
4278 + return stringcur - &hashheader.stringchars[stringno][0];
4279 +#endif /* SLOWMULTIPLY */
4284 + /* No match - choose which side to search on */
4286 + if((*--bufcur & 0x7F) <(*stringcur & 0x7F))
4287 + highstringno = stringno - 1;
4288 + else if((*bufcur & 0x7F) >(*stringcur & 0x7F))
4289 + lowstringno = stringno + 1;
4291 + if(*--bufcur < *stringcur)
4292 + highstringno = stringno - 1;
4293 + else if(*bufcur > *stringcur)
4294 + lowstringno = stringno + 1;
4295 +#endif /* NO8BIT */
4296 + else if(dupwanted < hashheader.dupnos[stringno])
4297 + highstringno = stringno - 1;
4299 + lowstringno = stringno + 1;
4301 + laststringch = -1;
4302 + return 0; /* Not a string character */
4306 + * Convert an external string to an ichar_t string. If necessary, the parity
4307 + * bit is stripped off as part of the process.
4309 + * Returns NZ if the output string overflowed.
4313 + register ichar_t * out, /* Where to put result */
4314 + register char * in, /* String to convert */
4315 + int outlen, /* Size of output buffer, *BYTES* */
4316 + int canonical) /* NZ if input is in canonical form */
4318 + register int len; /* Length of next character */
4320 + outlen /= sizeof(ichar_t); /* Convert to an ichar_t count */
4321 + for( ; --outlen > 0 && *in != '\0'; in += len)
4323 + if(l1_isstringch(in, len, canonical))
4324 + *out++ = SET_SIZE + laststringch;
4326 + *out++ = *in & S_NOPARITY;
4329 + return outlen <= 0;
4333 + * Convert an ichar_t string to an external string.
4335 + * WARNING: the resulting string may wind up being longer than the
4336 + * original. In fact, even the sequence strtoichar->ichartostr may
4337 + * produce a result longer than the original, because the output form
4338 + * may use a different string type set than the original input form.
4340 + * Returns NZ if the output string overflowed.
4344 + register char * out, /* Where to put result */
4345 + register ichar_t * in, /* String to convert */
4346 + int outlen, /* Size of output buffer, bytes */
4347 + int canonical) /* NZ for canonical form */
4349 + register unsigned int ch; /* Next character to store */
4350 + register unsigned int i; /* Index into duplicates list */
4351 + register char * scharp; /* Pointer into a string char */
4353 + while(--outlen > 0 && (ch = *in++) != 0)
4356 + *out++ = (char) ch;
4362 + for(i = hashheader.nstrchars; --i >= 0; )
4364 + if(hashheader.dupnos[i] == defdupchar
4365 + && hashheader.stringdups[i] == ch)
4372 + scharp = hashheader.stringchars[(unsigned) ch];
4373 + while((*out++ = *scharp++) != '\0')
4379 + return outlen <= 0;
4383 + * Convert a string to an ichar_t, storing the result in a static area.
4387 + char * in, /* String to convert */
4388 + int canonical) /* NZ if input is in canonical form */
4390 + static ichar_t out[STRTOSICHAR_SIZE / sizeof(ichar_t)];
4392 + if(strtoichar(out, in, sizeof out, canonical))
4393 + (void) fprintf(stderr, WORD_TOO_LONG (in));
4398 + * Convert an ichar_t to a string, storing the result in a static area.
4402 + ichar_t * in, /* Internal string to convert */
4403 + int canonical) /* NZ for canonical conversion */
4405 + static char out[ICHARTOSSTR_SIZE];
4407 + if(ichartostr(out, in, sizeof out, canonical))
4408 + (void) fprintf(stderr, WORD_TOO_LONG (out));
4413 + * Convert a single ichar to a printable string, storing the result in
4419 + static char out[MAXSTRINGCHARLEN + 1];
4423 + out[0] = (char) in;
4427 + (void) strcpy(out, hashheader.stringchars[(unsigned) in - SET_SIZE]);
4431 +#ifndef ICHAR_IS_CHAR
4433 + * Copy an ichar_t.
4437 + register ichar_t * out, /* Destination */
4438 + register ichar_t * in) /* Source */
4440 + ichar_t * origout; /* Copy of destination for return */
4443 + while((*out++ = *in++) != 0)
4449 + * Return the length of an ichar_t.
4452 +icharlen(register ichar_t * in) /* String to count */
4454 + register int len; /* Length so far */
4456 + for(len = 0; *in++ != 0; len++)
4462 + * Compare two ichar_t's.
4466 + register ichar_t * s1,
4467 + register ichar_t * s2)
4472 + if(*s1++ != *s2++)
4473 + return *--s1 - *--s2;
4479 + * Strncmp for two ichar_t's.
4483 + register ichar_t * s1,
4484 + register ichar_t * s2,
4488 + while(--n >= 0 && *s1 != 0)
4490 + if(*s1++ != *s2++)
4491 + return *--s1 - *--s2;
4499 +#endif /* ICHAR_IS_CHAR */
4503 + char * name, /* Name to look up in suffix table */
4504 + int searchnames, /* NZ to search name field of table */
4505 + int * deformatter) /* Where to set deformatter type */
4507 + char * cp; /* Pointer into suffix list */
4508 + int cplen; /* Length of current suffix */
4509 + register int i; /* Index into type table */
4510 + int len; /* Length of the name */
4513 + * Note: for now, the deformatter is set to 1 for tex, 0 for nroff.
4514 + * Further, we assume that it's one or the other, so that a test
4515 + * for tex is sufficient. This needs to be generalized.
4517 + len = strlen(name);
4520 + for(i = 0; i < hashheader.nstrchartype; i++)
4522 + if(strcmp(name, chartypes[i].name) == 0)
4524 + if(deformatter != NULL)
4526 + (strcmp (chartypes[i].deformatter, "tex") == 0);
4531 + for(i = 0; i < hashheader.nstrchartype; i++)
4533 + for(cp = chartypes[i].suffixes; *cp != '\0'; cp += cplen + 1)
4535 + cplen = strlen(cp);
4536 + if(len >= cplen && strcmp(&name[len - cplen], cp) == 0)
4538 + if(deformatter != NULL)
4540 + (strcmp (chartypes[i].deformatter, "tex") == 0);
4549 +mypath_rindex(char const *str, char c)
4553 + x = (char *)str + strlen(str);
4557 + if(*x == '\\' || *x == '/' || *x == ':')
4566 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/msgs.h vim-6.2.532/src/spell/msgs.h
4567 --- vim-6.2.532.orig/src/spell/msgs.h 1970-01-01 01:00:00.000000000 +0100
4568 +++ vim-6.2.532/src/spell/msgs.h 2004-05-08 09:25:23.956178136 +0200
4573 + * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
4574 + * All rights reserved.
4576 + * Redistribution and use in source and binary forms, with or without
4577 + * modification, are permitted provided that the following conditions
4580 + * 1. Redistributions of source code must retain the above copyright
4581 + * notice, this list of conditions and the following disclaimer.
4582 + * 2. Redistributions in binary form must reproduce the above copyright
4583 + * notice, this list of conditions and the following disclaimer in the
4584 + * documentation and/or other materials provided with the distribution.
4585 + * 3. All modifications to the source code must be clearly marked as
4586 + * such. Binary redistributions based on modified source code
4587 + * must be clearly marked as modified versions in the documentation
4588 + * and/or other materials provided with the distribution.
4589 + * 4. All advertising materials mentioning features or use of this software
4590 + * must display the following acknowledgment:
4591 + * This product includes software developed by Geoff Kuenning and
4592 + * other unpaid contributors.
4593 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
4594 + * products derived from this software without specific prior
4595 + * written permission.
4597 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
4598 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4599 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4600 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
4601 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4602 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4603 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4604 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
4605 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
4606 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4612 + * Messages header file.
4614 + * This file contains all text strings that are written by any of the
4615 + * C programs in the ispell package. The strings are collected here so that
4616 + * you can have the option of translating them into your local language for
4617 + * the benefit of your users.
4619 + * Anyone who goes to the effort of making a translation may wish to return
4620 + * the translated strings to me, geoff@ITcorp.com, so that I can include
4621 + * them in a later distribution under #ifdef control.
4623 + * Besides the strings in this header file, you may also want to translate
4624 + * the strings in version.h, which give the version and copyright information.
4625 + * However, any translation of these strings MUST accurately preserve the
4626 + * legal rights under international law; you may wish to consult a lawyer
4627 + * about this since you will be responsible for the results of any
4628 + * incorrect translation.
4630 + * Most of the strings below are simple printf format strings. If the printf
4631 + * takes more than one parameter, the string is given as a parameterized
4632 + * macro in case your local language needs a different word order.
4637 + * Revision 1.31 1994/12/27 23:08:57 geoff
4638 + * Add a message to be issued if a word contains illegal characters.
4640 + * Revision 1.30 1994/10/25 05:46:40 geoff
4641 + * Improve a couple of error messages relating to affix flags.
4643 + * Revision 1.29 1994/10/04 03:46:23 geoff
4644 + * Add a missing carriage return in the help message
4646 + * Revision 1.28 1994/09/16 05:07:00 geoff
4647 + * Add the BAD_FLAG message, and start a sentence in another message with
4648 + * an uppercase letter.
4650 + * Revision 1.27 1994/07/28 05:11:38 geoff
4651 + * Log message for previous revision: add BHASH_C_ZERO_COUNT.
4653 + * Revision 1.26 1994/07/28 04:53:49 geoff
4655 + * Revision 1.25 1994/05/24 04:54:36 geoff
4656 + * Add error messages for affix-flag checking.
4658 + * Revision 1.24 1994/01/25 07:12:42 geoff
4659 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
4664 + * The following strings are used in numerous places:
4666 +#define BAD_FLAG "\nIllegal affix flag character '%c'\n"
4667 +#define CANT_OPEN "Can't open %s"
4668 +#define CANT_CREATE "Can't create %s\n"
4669 +#define WORD_TOO_LONG(w) "\nWord '%s' too long at line %d of %s, truncated\n", \
4670 + w, __LINE__, __FILE__
4673 + * The following strings are used in buildhash.c:
4675 +#define BHASH_C_NO_DICT "No dictionary (%s)\n"
4676 +#define BHASH_C_NO_COUNT "No count file\n"
4677 +#define BHASH_C_BAD_COUNT "Bad count file\n"
4678 +#define BHASH_C_ZERO_COUNT "No words in dictionary\n"
4679 + /* I think this message looks better when it's nearly 80 characters wide,
4680 + * thus the ugly formatting in the next two defines. GK 9-87 */
4681 +#define BHASH_C_BAFF_1(max, excess) \
4682 + " Warning: this language table may exceed the maximum total affix length\nof %d by up to %d bytes. You should either increase MAXAFFIXLEN in config.X\nor shorten your largest affix/strip string difference. (This is the\n", \
4684 +#define BHASH_C_BAFF_2 \
4685 + "difference between the affix length and the strip length in a given\nreplacement rule, or the affix length if there is no strip string\nin that rule.)\n"
4686 +#define BHASH_C_OVERFLOW "Hash table overflowed by %d words\n"
4687 +#define BHASH_C_CANT_OPEN_DICT "Can't open dictionary\n"
4688 +#define BHASH_C_NO_SPACE "Couldn't allocate hash table\n"
4689 +#define BHASH_C_COLLISION_SPACE "\ncouldn't allocate space for collision\n"
4690 +#define BHASH_C_COUNTING "Counting words in dictionary ...\n"
4691 +#define BHASH_C_WORD_COUNT "\n%d words\n"
4692 +#define BHASH_C_USAGE "Usage: buildhash [-s] dict-file aff-file hash-file\n\tbuildhash -c count aff-file\n"
4695 + * The following strings are used in correct.c:
4697 +#define CORR_C_HELP_1 "Whenever a word is found that is not in the dictionary,\n"
4698 +#define CORR_C_HELP_2 "it is printed on the first line of the screen. If the dictionary\n"
4699 +#define CORR_C_HELP_3 "contains any similar words, they are listed with a number\n"
4700 +#define CORR_C_HELP_4 "next to each one. You have the option of replacing the word\n"
4701 +#define CORR_C_HELP_5 "completely, or choosing one of the suggested words.\n"
4702 + /* You may add HELP_6 through HELP_9 if your language needs more lines */
4703 +#define CORR_C_HELP_6 ""
4704 +#define CORR_C_HELP_7 ""
4705 +#define CORR_C_HELP_8 ""
4706 +#define CORR_C_HELP_9 ""
4707 +#define CORR_C_HELP_COMMANDS "\nCommands are:\n\n"
4708 +#define CORR_C_HELP_R_CMD "R Replace the misspelled word completely.\n"
4709 +#define CORR_C_HELP_BLANK "Space Accept the word this time only.\n"
4710 +#define CORR_C_HELP_A_CMD "A Accept the word for the rest of this session.\n"
4711 +#define CORR_C_HELP_I_CMD "I Accept the word, and put it in your private dictionary.\n"
4712 +#define CORR_C_HELP_U_CMD "U Accept and add lowercase version to private dictionary.\n"
4713 +#define CORR_C_HELP_0_CMD "0-n Replace with one of the suggested words.\n"
4714 +#define CORR_C_HELP_L_CMD "L Look up words in system dictionary.\n"
4715 +#define CORR_C_HELP_X_CMD "X Write the rest of this file, ignoring misspellings,\n and start next file.\n"
4716 +#define CORR_C_HELP_Q_CMD "Q Quit immediately. Asks for confirmation.\n Leaves file unchanged.\n"
4717 +#define CORR_C_HELP_BANG "! Shell escape.\n"
4718 +#define CORR_C_HELP_REDRAW "^L Redraw screen.\n"
4719 +#define CORR_C_HELP_SUSPEND "^Z Suspend program.\n"
4720 +#define CORR_C_HELP_HELP "? Show this help screen.\n"
4721 +#define CORR_C_HELP_TYPE_SPACE "-- Type space to continue --"
4723 +#define CORR_C_FILE_LABEL " File: %s"
4724 +#define CORR_C_READONLY "[READONLY]"
4725 +#define CORR_C_MINI_MENU "[SP] <number> R)epl A)ccept I)nsert L)ookup U)ncap Q)uit e(X)it or ? for help\n"
4726 +#define CORR_C_CONFIRM_QUIT "Are you sure you want to throw away your changes? "
4727 +#define CORR_C_REPLACE_WITH "Replace with: "
4728 +#define CORR_C_LOOKUP_PROMPT "Lookup string ('*' is wildcard): "
4729 +#define CORR_C_MORE_PROMPT "-- more --"
4730 +#define CORR_C_BLANK_MORE " "
4731 +#define CORR_C_END_LOOK "--end--"
4734 + * The following strings are used in defmt.c:
4736 +#define DEFMT_C_TEX_MATH_ERROR "****ERROR in parsing TeX math mode!\n"
4737 +#define DEFMT_C_LR_MATH_ERROR "***ERROR in LR to math-mode switch.\n"
4740 + * The following strings are used in icombine.c:
4742 +#define ICOMBINE_C_BAD_TYPE "icombine: unrecognized formatter type '%s'\n"
4743 +#define ICOMBINE_C_USAGE "Usage: icombine [-T suffix] [aff-file] < wordlist\n"
4746 + * The following strings are used in ispell.c:
4748 +#define ISPELL_C_USAGE1 "Usage: %s [-dfile | -pfile | -wchars | -Wn | -t | -n | -x | -b | -S | -B | -C | -P | -m | -Lcontext | -M | -N | -Ttype | -V] file .....\n"
4749 +#define ISPELL_C_USAGE2 " %s [-dfile | -pfile | -wchars | -Wn | -t | -n | -Ttype] -l\n"
4751 +#define ISPELL_C_USAGE3 " %s [-dfile | -pfile | -ffile | -Wn | -t | -n | -s | -B | -C | -P | -m | -Ttype] {-a | -A}\n"
4753 +#define ISPELL_C_USAGE3 " %s [-dfile | -pfile | -ffile | -Wn | -t | -n | -B | -C | -P | -m | -Ttype] {-a | -A}\n"
4755 +#define ISPELL_C_USAGE4 " %s [-dfile] [-wchars | -Wn] -c\n"
4756 +#define ISPELL_C_USAGE5 " %s [-dfile] [-wchars] -e[1-4]\n"
4757 +#define ISPELL_C_USAGE6 " %s [-dfile] [-wchars] -D\n"
4758 +#define ISPELL_C_USAGE7 " %s -v\n"
4759 +#define ISPELL_C_TEMP_DISAPPEARED "temporary file disappeared (%s)\n"
4760 +#define ISPELL_C_BAD_TYPE "ispell: unrecognized formatter type '%s'\n"
4761 +#define ISPELL_C_NO_FILE "ispell: specified file does not exist\n"
4762 +#define ISPELL_C_NO_FILES "ispell: specified files do not exist\n"
4763 +#define ISPELL_C_CANT_WRITE "Warning: Can't write to %s\n"
4764 +#define ISPELL_C_OPTIONS_ARE "Compiled-in options:\n"
4766 +#define ISPELL_C_NO_OPTIONS_SPACE "ispell: no memory to read default options\n"
4770 + * The following strings are used in lookup.c:
4772 +#define LOOKUP_C_CANT_READ "Trouble reading hash table %s"
4773 +#define LOOKUP_C_NULL_HASH "Null hash table %s"
4774 +#define LOOKUP_C_SHORT_HASH(name, gotten, wanted) \
4775 + "Truncated hash table %s: got %d bytes, expected %d", \
4776 + name, gotten, wanted
4777 +#define LOOKUP_C_BAD_MAGIC(name, wanted, gotten) \
4778 + "Illegal format hash table %s - expected magic 0x%x, got 0x%x", \
4779 + name, wanted, gotten
4780 +#define LOOKUP_C_BAD_MAGIC2(name, wanted, gotten) \
4781 + "Illegal format hash table %s - \nexpected magic2 0x%x, got 0x%x", \
4782 + name, wanted, gotten
4783 +#define LOOKUP_C_BAD_OPTIONS(gotopts, gotchars, gotlen, wantedopts, wantedchars, wantedlen) \
4784 + "Hash table options don't agree with buildhash - 0x%x/%d/%d vs. 0x%x/%d/%d", \
4785 + gotopts, gotchars, gotlen, \
4786 + wantedopts, wantedchars, wantedlen
4787 +#define LOOKUP_C_NO_HASH_SPACE "Couldn't allocate space for hash table"
4788 +#define LOOKUP_C_BAD_FORMAT "Illegal format hash table"
4789 +#define LOOKUP_C_NO_LANG_SPACE "Couldn't allocate space for language tables"
4792 + * The following strings are used in makedent.c:
4794 +#define MAKEDENT_C_NO_WORD_SPACE "\nCouldn't allocate space for word '%s'\n"
4795 +#define MAKEDENT_C_BAD_WORD_CHAR "\nWord '%s' contains illegal characters\n"
4798 + * The following strings are used in parse.y:
4800 +#define PARSE_Y_8_BIT "Eighth bit ignored (recompile ispell without NO8BIT)"
4801 +#define PARSE_Y_NO_WORD_STRINGS "wordchars statement may not specify string characters"
4802 +#define PARSE_Y_UNMATCHED "Unmatched charset lengths"
4803 +#define PARSE_Y_NO_BOUNDARY_STRINGS "boundarychars statement may not specify string characters"
4804 +#define PARSE_Y_LONG_STRING "String character is too long"
4805 +#define PARSE_Y_NULL_STRING "String character must have nonzero length"
4806 +#define PARSE_Y_MANY_STRINGS "Too many string characters"
4807 +#define PARSE_Y_NO_SUCH_STRING "No such string character"
4808 +#define PARSE_Y_MULTIPLE_STRINGS "Alternate string character was already defined"
4809 +#define PARSE_Y_LENGTH_MISMATCH "Upper and lower versions of string character must be same length"
4810 +#define PARSE_Y_WRONG_NROFF "Incorrect character count in nroffchars statement"
4811 +#define PARSE_Y_WRONG_TEX "Incorrect character count in TeXchars statement"
4812 +#define PARSE_Y_DOUBLE_COMPOUND "Compoundwords option may only appear once"
4813 +#define PARSE_Y_LONG_FLAG "Flag must be single character"
4814 +#define PARSE_Y_BAD_FLAG "Flag must be alphabetic"
4815 +#define PARSE_Y_DUP_FLAG "Duplicate flag"
4816 +#define PARSE_Y_NO_SPACE "Out of memory"
4817 +#define PARSE_Y_NEED_BLANK "Single characters must be separated by a blank"
4818 +#define PARSE_Y_MANY_CONDS "Too many conditions; 8 maximum"
4819 +#define PARSE_Y_EOF "Unexpected EOF in quoted string"
4820 +#define PARSE_Y_LONG_QUOTE "Quoted string too long, max 256 characters"
4821 +#define PARSE_Y_ERROR_FORMAT(file, lineno, error) \
4822 + "%s line %d: %s\n", file, lineno, error
4823 +#define PARSE_Y_MALLOC_TROUBLE "yyopen: trouble allocating memory\n"
4824 +#define PARSE_Y_UNGRAB_PROBLEM "Internal error: ungrab buffer overflow"
4825 +#define PARSE_Y_BAD_DEFORMATTER "Deformatter must be either 'nroff' or 'tex'"
4826 +#define PARSE_Y_BAD_NUMBER "Illegal digit in number"
4829 + * The following strings are used in term.c:
4831 +#define TERM_C_SMALL_SCREEN "Screen too small: need at least %d lines\n"
4832 +#define TERM_C_NO_BATCH "Can't deal with non-interactive use yet.\n"
4833 +#define TERM_C_CANT_FORK "Couldn't fork, try later.\n"
4834 +#define TERM_C_TYPE_SPACE "\n-- Type space to continue --"
4837 + * The following strings are used in tree.c:
4839 +#define TREE_C_CANT_UPDATE "Warning: Cannot update personal dictionary (%s)\n"
4840 +#define TREE_C_NO_SPACE "Ran out of space for personal dictionary\n"
4841 +#define TREE_C_TRY_ANYWAY "Continuing anyway (with reduced performance).\n"
4844 + * The following strings are used in unsq.c:
4846 +#define UNSQ_C_BAD_COUNT "Illegal count character 0x%x\n"
4847 +#define UNSQ_C_SURPRISE_EOF "Unexpected EOF\n"
4848 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/tgood.c vim-6.2.532/src/spell/tgood.c
4849 --- vim-6.2.532.orig/src/spell/tgood.c 1970-01-01 01:00:00.000000000 +0100
4850 +++ vim-6.2.532/src/spell/tgood.c 2004-05-08 09:25:23.960177528 +0200
4853 + * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
4854 + * All rights reserved.
4856 + * Redistribution and use in source and binary forms, with or without
4857 + * modification, are permitted provided that the following conditions
4860 + * 1. Redistributions of source code must retain the above copyright
4861 + * notice, this list of conditions and the following disclaimer.
4862 + * 2. Redistributions in binary form must reproduce the above copyright
4863 + * notice, this list of conditions and the following disclaimer in the
4864 + * documentation and/or other materials provided with the distribution.
4865 + * 3. All modifications to the source code must be clearly marked as
4866 + * such. Binary redistributions based on modified source code
4867 + * must be clearly marked as modified versions in the documentation
4868 + * and/or other materials provided with the distribution.
4869 + * 4. All advertising materials mentioning features or use of this software
4870 + * must display the following acknowledgment:
4871 + * This product includes software developed by Geoff Kuenning and
4872 + * other unpaid contributors.
4873 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
4874 + * products derived from this software without specific prior
4875 + * written permission.
4877 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
4878 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4879 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4880 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
4881 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4882 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4883 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4884 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
4885 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
4886 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4891 + * Table-driven version of good.c.
4893 + * Geoff Kuenning, July 1987
4898 + * Revision 1.32 1994/11/02 06:56:16 geoff
4899 + * Remove the anyword feature, which I've decided is a bad idea.
4901 + * Revision 1.31 1994/10/25 05:46:25 geoff
4902 + * Add support for the FF_ANYWORD (affix applies to all words, even if
4903 + * flag bit isn't set) flag option.
4905 + * Revision 1.30 1994/05/24 06:23:08 geoff
4906 + * Don't create a hit if "allhits" is clear and capitalization
4907 + * mismatches. This cures a bug where a word could be in the dictionary
4908 + * and yet not found.
4910 + * Revision 1.29 1994/05/17 06:44:21 geoff
4911 + * Add support for controlled compound formation and the COMPOUNDONLY
4912 + * option to affix flags.
4914 + * Revision 1.28 1994/01/25 07:12:13 geoff
4915 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
4920 +#include "ispell.h"
4922 +Global void chk_aff (ichar_t * word, ichar_t * ucword, int len,
4923 + int ignoreflagbits, int allhits, int pfxopts, int sfxopts);
4924 +Local void pfx_list_chk (ichar_t * word, ichar_t * ucword,
4925 + int len, int optflags, int sfxopts, struct flagptr * ind,
4926 + int ignoreflagbits, int allhits);
4927 +Local void chk_suf (ichar_t * word, ichar_t * ucword, int len,
4928 + int optflags, struct flagent * pfxent, int ignoreflagbits,
4930 +Local void suf_list_chk (ichar_t * word, ichar_t * ucword, int len,
4931 + struct flagptr * ind, int optflags, struct flagent * pfxent,
4932 + int ignoreflagbits, int allhits);
4933 +Global int expand_pre (char * croot, ichar_t * rootword,
4934 + MASKTYPE mask[], int option, char * extra);
4935 +Local int pr_pre_expansion (char * croot, ichar_t * rootword,
4936 + struct flagent * flent, MASKTYPE mask[], int option,
4938 +Global int expand_suf (char * croot, ichar_t * rootword,
4939 + MASKTYPE mask[], int optflags, int option, char * extra);
4940 +Local int pr_suf_expansion (char * croot, ichar_t * rootword,
4941 + struct flagent * flent, int option, char * extra);
4942 +Local void forcelc (ichar_t * dst, int len);
4944 +/* Check possible affixes */
4947 + ichar_t * word, /* Word to be checked */
4948 + ichar_t * ucword, /* Upper-case-only copy of word */
4949 + int len, /* The length of word/ucword */
4950 + int ignoreflagbits, /* Ignore whether affix is legal */
4951 + int allhits, /* Keep going after first hit */
4952 + int pfxopts, /* Options to apply to prefixes */
4953 + int sfxopts) /* Options to apply to suffixes */
4955 + register ichar_t * cp; /* Pointer to char to index on */
4956 + struct flagptr * ind; /* Flag index table to test */
4958 + pfx_list_chk (word, ucword, len, pfxopts, sfxopts, &pflagindex[0],
4959 + ignoreflagbits, allhits);
4961 + ind = &pflagindex[*cp++];
4962 + while (ind->numents == 0 && ind->pu.fp != NULL)
4966 + if (ind->pu.fp[0].numents)
4968 + pfx_list_chk (word, ucword, len, pfxopts, sfxopts, &ind->pu.fp[0],
4969 + ignoreflagbits, allhits);
4970 + if (numhits && !allhits && !cflag && !ignoreflagbits)
4973 + ind = &ind->pu.fp[*cp++];
4975 + pfx_list_chk (word, ucword, len, pfxopts, sfxopts, ind, ignoreflagbits,
4977 + if (numhits && !allhits && !cflag && !ignoreflagbits)
4979 + chk_suf (word, ucword, len, sfxopts, (struct flagent *) NULL,
4980 + ignoreflagbits, allhits);
4983 +/* Check some prefix flags */
4986 + ichar_t * word, /* Word to be checked */
4987 + ichar_t * ucword, /* Upper-case-only word */
4988 + int len, /* The length of ucword */
4989 + int optflags, /* Options to apply */
4990 + int sfxopts, /* Options to apply to suffixes */
4991 + struct flagptr * ind, /* Flag index table */
4992 + int ignoreflagbits, /* Ignore whether affix is legal */
4993 + int allhits) /* Keep going after first hit */
4995 + int cond; /* Condition number */
4996 + register ichar_t * cp; /* Pointer into end of ucword */
4997 + struct dent * dent; /* Dictionary entry we found */
4998 + int entcount; /* Number of entries to process */
4999 + register struct flagent *
5000 + flent; /* Current table entry */
5001 + int preadd; /* Length added to tword2 as prefix */
5002 + register int tlen; /* Length of tword */
5003 + ichar_t tword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; /* Tmp cpy */
5004 + ichar_t tword2[sizeof tword]; /* 2nd copy for ins_root_cap */
5006 + for (flent = ind->pu.ent, entcount = ind->numents;
5007 + entcount > 0; flent++, entcount--)
5010 + * If this is a compound-only affix, ignore it unless we're
5011 + * looking for that specific thing.
5013 + if ((flent->flagflags & FF_COMPOUNDONLY) != 0
5014 + && (optflags & FF_COMPOUNDONLY) == 0)
5017 + * In COMPOUND_CONTROLLED mode, the FF_COMPOUNDONLY bit must
5020 + if (compoundflag == COMPOUND_CONTROLLED
5021 + && ((flent->flagflags ^ optflags) & FF_COMPOUNDONLY) != 0)
5024 + * See if the prefix matches.
5026 + tlen = len - flent->affl;
5027 + if (tlen > 0 && (flent->affl == 0 ||
5028 + icharncmp (flent->affix, ucword, flent->affl) == 0) &&
5029 + tlen + flent->stripl >= flent->numconds)
5032 + * The prefix matches. Remove it, replace it by the "strip"
5033 + * string (if any), and check the original conditions.
5035 + if (flent->stripl)
5036 + (void) icharcpy (tword, flent->strip);
5037 + (void) icharcpy (tword + flent->stripl, ucword + flent->affl);
5039 + for (cond = 0; cond < flent->numconds; cond++)
5041 + if ((flent->conds[*cp++] & (1 << cond)) == 0)
5044 + if (cond >= flent->numconds)
5047 + * The conditions match. See if the word is in the
5050 + tlen += flent->stripl;
5052 + flagpr (tword, BITTOCHAR (flent->flagbit), flent->stripl,
5053 + flent->affl, -1, 0);
5054 + else if (ignoreflagbits)
5056 + if ((dent = lookup (tword, 1)) != NULL)
5061 + (void) icharcpy (cp, flent->affix);
5062 + cp += flent->affl;
5065 + preadd = cp - tword2;
5066 + (void) icharcpy (cp, tword);
5068 + if (flent->stripl)
5071 + (void) icharcpy (cp, flent->strip);
5073 + (void) ins_root_cap (tword2, word,
5074 + flent->stripl, preadd,
5075 + 0, (cp - tword2) - tlen - preadd,
5076 + dent, flent, (struct flagent *) NULL);
5079 + else if ((dent = lookup (tword, 1)) != NULL
5080 + && TSTMASKBIT (dent->mask, flent->flagbit))
5082 + if (numhits < MAX_HITS)
5084 + hits[numhits].dictent = dent;
5085 + hits[numhits].prefix = flent;
5086 + hits[numhits].suffix = NULL;
5091 +#ifndef NO_CAPITALIZATION_SUPPORT
5092 + if (cap_ok (word, &hits[0], len))
5095 +#else /* NO_CAPITALIZATION_SUPPORT */
5097 +#endif /* NO_CAPITALIZATION_SUPPORT */
5101 + * Handle cross-products.
5103 + if (flent->flagflags & FF_CROSSPRODUCT)
5104 + chk_suf (word, tword, tlen, sfxopts | FF_CROSSPRODUCT,
5105 + flent, ignoreflagbits, allhits);
5111 +/* Check possible suffixes */
5114 + ichar_t * word, /* Word to be checked */
5115 + ichar_t * ucword, /* Upper-case-only word */
5116 + int len, /* The length of ucword */
5117 + int optflags, /* Affix option flags */
5118 + struct flagent * pfxent, /* Prefix flag entry if cross-prod */
5119 + int ignoreflagbits, /* Ignore whether affix is legal */
5120 + int allhits) /* Keep going after first hit */
5122 + register ichar_t * cp; /* Pointer to char to index on */
5123 + struct flagptr * ind; /* Flag index table to test */
5125 + suf_list_chk (word, ucword, len, &sflagindex[0], optflags, pfxent,
5126 + ignoreflagbits, allhits);
5127 + cp = ucword + len - 1;
5128 + ind = &sflagindex[*cp];
5129 + while (ind->numents == 0 && ind->pu.fp != NULL)
5133 + if (ind->pu.fp[0].numents)
5135 + suf_list_chk (word, ucword, len, &ind->pu.fp[0],
5136 + optflags, pfxent, ignoreflagbits, allhits);
5137 + if (numhits != 0 && !allhits && !cflag && !ignoreflagbits)
5140 + ind = &ind->pu.fp[*--cp];
5142 + suf_list_chk (word, ucword, len, ind, optflags, pfxent,
5143 + ignoreflagbits, allhits);
5148 + ichar_t * word, /* Word to be checked */
5149 + ichar_t * ucword, /* Upper-case-only word */
5150 + int len, /* The length of ucword */
5151 + struct flagptr * ind, /* Flag index table */
5152 + int optflags, /* Affix option flags */
5153 + struct flagent * pfxent, /* Prefix flag entry if crossonly */
5154 + int ignoreflagbits, /* Ignore whether affix is legal */
5155 + int allhits) /* Keep going after first hit */
5157 + register ichar_t * cp; /* Pointer into end of ucword */
5158 + int cond; /* Condition number */
5159 + struct dent * dent; /* Dictionary entry we found */
5160 + int entcount; /* Number of entries to process */
5161 + register struct flagent *
5162 + flent; /* Current table entry */
5163 + int preadd; /* Length added to tword2 as prefix */
5164 + register int tlen; /* Length of tword */
5165 + ichar_t tword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; /* Tmp cpy */
5166 + ichar_t tword2[sizeof tword]; /* 2nd copy for ins_root_cap */
5168 + (void) icharcpy (tword, ucword);
5169 + for (flent = ind->pu.ent, entcount = ind->numents;
5171 + flent++, entcount--)
5173 + if ((optflags & FF_CROSSPRODUCT) != 0
5174 + && (flent->flagflags & FF_CROSSPRODUCT) == 0)
5177 + * If this is a compound-only affix, ignore it unless we're
5178 + * looking for that specific thing.
5180 + if ((flent->flagflags & FF_COMPOUNDONLY) != 0
5181 + && (optflags & FF_COMPOUNDONLY) == 0)
5184 + * In COMPOUND_CONTROLLED mode, the FF_COMPOUNDONLY bit must
5187 + if (compoundflag == COMPOUND_CONTROLLED
5188 + && ((flent->flagflags ^ optflags) & FF_COMPOUNDONLY) != 0)
5191 + * See if the suffix matches.
5193 + tlen = len - flent->affl;
5195 + && (flent->affl == 0
5196 + || icharcmp (flent->affix, ucword + tlen) == 0)
5197 + && tlen + flent->stripl >= flent->numconds)
5200 + * The suffix matches. Remove it, replace it by the "strip"
5201 + * string (if any), and check the original conditions.
5203 + (void) icharcpy (tword, ucword);
5204 + cp = tword + tlen;
5205 + if (flent->stripl)
5207 + (void) icharcpy (cp, flent->strip);
5208 + tlen += flent->stripl;
5209 + cp = tword + tlen;
5213 + for (cond = flent->numconds; --cond >= 0; )
5215 + if ((flent->conds[*--cp] & (1 << cond)) == 0)
5221 + * The conditions match. See if the word is in the
5226 + if (optflags & FF_CROSSPRODUCT)
5227 + flagpr (tword, BITTOCHAR (pfxent->flagbit),
5228 + pfxent->stripl, pfxent->affl,
5229 + BITTOCHAR (flent->flagbit), flent->affl);
5231 + flagpr (tword, -1, 0, 0,
5232 + BITTOCHAR (flent->flagbit), flent->affl);
5234 + else if (ignoreflagbits)
5236 + if ((dent = lookup (tword, 1)) != NULL)
5239 + if ((optflags & FF_CROSSPRODUCT)
5240 + && pfxent->affl != 0)
5242 + (void) icharcpy (cp, pfxent->affix);
5243 + cp += pfxent->affl;
5246 + preadd = cp - tword2;
5247 + (void) icharcpy (cp, tword);
5249 + if ((optflags & FF_CROSSPRODUCT)
5250 + && pfxent->stripl != 0)
5253 + (void) icharcpy (cp, pfxent->strip);
5254 + cp += pfxent->stripl;
5256 + if (flent->stripl)
5259 + (void) icharcpy (cp, flent->strip);
5260 + cp += flent->stripl;
5265 + (void) icharcpy (cp, flent->affix);
5266 + cp += flent->affl;
5268 + (void) ins_root_cap (tword2, word,
5269 + (optflags & FF_CROSSPRODUCT) ? pfxent->stripl : 0,
5271 + flent->stripl, (cp - tword2) - tlen - preadd,
5272 + dent, pfxent, flent);
5275 + else if ((dent = lookup (tword, 1)) != NULL
5276 + && TSTMASKBIT (dent->mask, flent->flagbit)
5277 + && ((optflags & FF_CROSSPRODUCT) == 0
5278 + || TSTMASKBIT (dent->mask, pfxent->flagbit)))
5280 + if (numhits < MAX_HITS)
5282 + hits[numhits].dictent = dent;
5283 + hits[numhits].prefix = pfxent;
5284 + hits[numhits].suffix = flent;
5289 +#ifndef NO_CAPITALIZATION_SUPPORT
5290 + if (cap_ok (word, &hits[0], len))
5293 +#else /* NO_CAPITALIZATION_SUPPORT */
5295 +#endif /* NO_CAPITALIZATION_SUPPORT */
5304 + * Expand a dictionary prefix entry
5308 + char * croot, /* Char version of rootword */
5309 + ichar_t * rootword, /* Root word to expand */
5310 + register MASKTYPE mask[], /* Mask bits to expand on */
5311 + int option, /* Option, see expandmode */
5312 + char * extra) /* Extra info to add to line */
5314 + int entcount; /* No. of entries to process */
5315 + int explength; /* Length of expansions */
5316 + register struct flagent *
5317 + flent; /* Current table entry */
5319 + for (flent = pflaglist, entcount = numpflags, explength = 0;
5320 + entcount > 0; flent++, entcount--)
5322 + if (TSTMASKBIT (mask, flent->flagbit))
5324 + pr_pre_expansion (croot, rootword, flent, mask, option, extra);
5329 +/* Print a prefix expansion */
5332 + char * croot, /* Char version of rootword */
5333 + register ichar_t * rootword, /* Root word to expand */
5334 + register struct flagent * flent, /* Current table entry */
5335 + MASKTYPE mask[], /* Mask bits to expand on */
5336 + int option, /* Option, see expandmode */
5337 + char * extra) /* Extra info to add to line */
5339 + int cond; /* Current condition number */
5340 + register ichar_t * nextc; /* Next case choice */
5341 + int tlen; /* Length of tword */
5342 + ichar_t tword[INPUTWORDLEN + MAXAFFIXLEN]; /* Temp */
5344 + tlen = icharlen (rootword);
5345 + if (flent->numconds > tlen)
5347 + tlen -= flent->stripl;
5350 + tlen += flent->affl;
5351 + for (cond = 0, nextc = rootword; cond < flent->numconds; cond++)
5353 + if ((flent->conds[mytoupper (*nextc++)] & (1 << cond)) == 0)
5357 + * The conditions are satisfied. Copy the word, add the prefix,
5358 + * and make it the proper case. This code is carefully written
5359 + * to match that ins_cap and cap_ok. Note that the affix, as
5360 + * inserted, is uppercase.
5362 + * There is a tricky bit here: if the root is capitalized, we
5363 + * want a capitalized result. If the root is followcase, however,
5364 + * we want to duplicate the case of the first remaining letter
5365 + * of the root. In other words, "Loved/U" should generate "Unloved",
5366 + * but "LOved/U" should generate "UNLOved" and "lOved/U" should
5367 + * produce "unlOved".
5371 + (void) icharcpy (tword, flent->affix);
5372 + nextc = tword + flent->affl;
5374 + (void) icharcpy (nextc, rootword + flent->stripl);
5375 + if (myupper (rootword[0]))
5377 + /* We must distinguish followcase from capitalized and all-upper */
5378 + for (nextc = rootword + 1; *nextc; nextc++)
5380 + if (!myupper (*nextc))
5385 + /* It's a followcase or capitalized word. Figure out which. */
5386 + for ( ; *nextc; nextc++)
5388 + if (myupper (*nextc))
5393 + /* It's followcase. */
5394 + if (!myupper (tword[flent->affl]))
5395 + forcelc (tword, flent->affl);
5399 + /* It's capitalized */
5400 + forcelc (tword + 1, tlen - 1);
5406 + /* Followcase or all-lower, we don't care which */
5407 + if (!myupper (*nextc))
5408 + forcelc (tword, flent->affl);
5411 + (void) printf ("\n%s", croot);
5413 + (void) printf (" %s%s", ichartosstr (tword, 1), extra);
5414 + if (flent->flagflags & FF_CROSSPRODUCT)
5416 + + expand_suf (croot, tword, mask, FF_CROSSPRODUCT, option, extra);
5422 + * Expand a dictionary suffix entry
5424 +int expand_suf (croot, rootword, mask, optflags, option, extra)
5425 + char * croot; /* Char version of rootword */
5426 + ichar_t * rootword; /* Root word to expand */
5427 + register MASKTYPE mask[]; /* Mask bits to expand on */
5428 + int optflags; /* Affix option flags */
5429 + int option; /* Option, see expandmode */
5430 + char * extra; /* Extra info to add to line */
5432 + int entcount; /* No. of entries to process */
5433 + int explength; /* Length of expansions */
5434 + register struct flagent *
5435 + flent; /* Current table entry */
5437 + for (flent = sflaglist, entcount = numsflags, explength = 0;
5439 + flent++, entcount--)
5441 + if (TSTMASKBIT (mask, flent->flagbit))
5443 + if ((optflags & FF_CROSSPRODUCT) == 0
5444 + || (flent->flagflags & FF_CROSSPRODUCT))
5446 + pr_suf_expansion (croot, rootword, flent, option, extra);
5452 +/* Print a suffix expansion */
5453 +static int pr_suf_expansion (croot, rootword, flent, option, extra)
5454 + char * croot; /* Char version of rootword */
5455 + register ichar_t * rootword; /* Root word to expand */
5456 + register struct flagent * flent; /* Current table entry */
5457 + int option; /* Option, see expandmode */
5458 + char * extra; /* Extra info to add to line */
5460 + int cond; /* Current condition number */
5461 + register ichar_t * nextc; /* Next case choice */
5462 + int tlen; /* Length of tword */
5463 + ichar_t tword[INPUTWORDLEN + MAXAFFIXLEN]; /* Temp */
5465 + tlen = icharlen (rootword);
5466 + cond = flent->numconds;
5469 + if (tlen - flent->stripl <= 0)
5471 + for (nextc = rootword + tlen; --cond >= 0; )
5473 + if ((flent->conds[mytoupper (*--nextc)] & (1 << cond)) == 0)
5477 + * The conditions are satisfied. Copy the word, add the suffix,
5478 + * and make it match the case of the last remaining character of the
5479 + * root. Again, this code carefully matches ins_cap and cap_ok.
5481 + (void) icharcpy (tword, rootword);
5482 + nextc = tword + tlen - flent->stripl;
5485 + (void) icharcpy (nextc, flent->affix);
5486 + if (!myupper (nextc[-1]))
5487 + forcelc (nextc, flent->affl);
5492 + (void) printf ("\n%s", croot);
5494 + (void) printf (" %s%s", ichartosstr (tword, 1), extra);
5495 + return tlen + flent->affl - flent->stripl;
5498 +static void forcelc (dst, len) /* Force to lowercase */
5499 + register ichar_t * dst; /* Destination to modify */
5500 + register int len; /* Length to copy */
5503 + for ( ; --len >= 0; dst++)
5504 + *dst = mytolower (*dst);
5506 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/tree.c vim-6.2.532/src/spell/tree.c
5507 --- vim-6.2.532.orig/src/spell/tree.c 1970-01-01 01:00:00.000000000 +0100
5508 +++ vim-6.2.532/src/spell/tree.c 2004-05-08 09:25:23.964176920 +0200
5511 + * tree.c - a hash style dictionary for user's personal words
5513 + * Pace Willisson, 1983
5514 + * Hash support added by Geoff Kuenning, 1987
5516 + * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
5517 + * All rights reserved.
5519 + * Redistribution and use in source and binary forms, with or without
5520 + * modification, are permitted provided that the following conditions
5523 + * 1. Redistributions of source code must retain the above copyright
5524 + * notice, this list of conditions and the following disclaimer.
5525 + * 2. Redistributions in binary form must reproduce the above copyright
5526 + * notice, this list of conditions and the following disclaimer in the
5527 + * documentation and/or other materials provided with the distribution.
5528 + * 3. All modifications to the source code must be clearly marked as
5529 + * such. Binary redistributions based on modified source code
5530 + * must be clearly marked as modified versions in the documentation
5531 + * and/or other materials provided with the distribution.
5532 + * 4. All advertising materials mentioning features or use of this software
5533 + * must display the following acknowledgment:
5534 + * This product includes software developed by Geoff Kuenning and
5535 + * other unpaid contributors.
5536 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
5537 + * products derived from this software without specific prior
5538 + * written permission.
5540 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
5541 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5542 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5543 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
5544 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5545 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5546 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5547 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5548 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5549 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5555 + * Revision 1.56 1995/01/08 23:23:49 geoff
5556 + * Support PDICTHOME for DOS purposes.
5558 + * Revision 1.55 1994/10/25 05:46:27 geoff
5559 + * Fix a comment that looked to some compilers like it might be nested.
5561 + * Revision 1.54 1994/01/25 07:12:15 geoff
5562 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
5567 +#include <stdlib.h>
5569 +#include "ispell.h"
5572 +Local FILE * trydict (char * dictname, char * home,
5573 + char * prefix, char * suffix);
5574 +Local void treeload (FILE * dictf);
5575 +Local struct dent * tinsert (struct dent * proto);
5576 +#if SORTPERSONAL != 0
5577 +Local int pdictcmp (struct dent ** enta, struct dent **entb);
5578 +#endif /* SORTPERSONAL != 0 */
5579 +#ifdef REGEX_LOOKUP
5580 +#endif /* REGEX_LOOKUP */
5582 +Local int cantexpand = 0; /* NZ if an expansion fails */
5583 +Local struct dent * pershtab; /* Aux hash table for personal dict */
5584 +Local int pershsize = 0; /* Space available in aux hash table */
5585 +Local int hcount = 0; /* Number of items in hash table */
5588 + * Hash table sizes. Prime is probably a good idea, though in truth I
5589 + * whipped the algorithm up on the spot rather than looking it up, so
5590 + * who knows what's really best? If we overflow the table, we just
5591 + * use a double-and-add-1 algorithm.
5593 +static int goodsizes[] =
5595 + 53, 223, 907, 3631
5598 +Local char personaldict[MAXPATHLEN];
5599 +Local FILE * dictf;
5600 +Local newwords = 0;
5604 + char * p, /* Value specified in -p switch */
5605 + char * LibDict) /* Root of default dict name */
5607 + int abspath; /* NZ if p is abs path name */
5608 + char * h; /* Home directory name */
5609 + char seconddict[MAXPATHLEN]; /* Name of secondary dict */
5610 + FILE * secondf; /* Access to second dict file */
5613 + ** If -p was not specified, try to get a default name from the
5614 + ** environment. After this point, if p is null, the the value in
5615 + ** personaldict is the only possible name for the personal dictionary.
5616 + ** If p is non-null, then there is a possibility that we should
5617 + ** prepend HOME to get the correct dictionary name.
5620 + p = getenv (PDICTVAR);
5622 + ** if p exists and begins with '/' we don't really need HOME,
5623 + ** but it's not very likely that HOME isn't set anyway (on non-DOS
5630 + for(i = 0; i < pershsize; i++)
5633 + if(x->word != NULL)
5635 + for(x = x->next; x != NULL;)
5639 + if(x->word != NULL)
5646 + if(pershtab != NULL)
5652 + if ((h = getenv (HOME)) == NULL)
5656 +#else /* PDICTHOME */
5658 +#endif /* PDICTHOME */
5664 + * No -p and no PDICTVAR. We will use LibDict and DEFPAFF to
5665 + * figure out the name of the personal dictionary and where it
5666 + * is. The rules are as follows:
5668 + * (1) If there is a local dictionary and a HOME dictionary,
5669 + * both are loaded, but changes are saved in the local one.
5670 + * The dictionary to save changes in is named "personaldict".
5671 + * (2) Dictionaries named after the affix file take precedence
5672 + * over dictionaries with the default suffix (DEFPAFF).
5673 + * (3) Dictionaries named with the new default names
5674 + * (DEFPDICT/DEFPAFF) take precedence over the old ones
5675 + * (OLDPDICT/OLDPAFF).
5676 + * (4) Dictionaries aren't combined unless they follow the same
5678 + * (5) If no dictionary can be found, a new one is created in
5679 + * the home directory, named after DEFPDICT and the affix
5682 + dictf = trydict (personaldict, (char *) NULL, DEFPDICT, LibDict);
5683 + secondf = trydict (seconddict, h, DEFPDICT, LibDict);
5684 + if (dictf == NULL && secondf == NULL)
5686 + dictf = trydict (personaldict, (char *) NULL, DEFPDICT, DEFPAFF);
5687 + secondf = trydict (seconddict, h, DEFPDICT, DEFPAFF);
5689 + if (dictf == NULL && secondf == NULL)
5691 + dictf = trydict (personaldict, (char *) NULL, OLDPDICT, LibDict);
5692 + secondf = trydict (seconddict, h, OLDPDICT, LibDict);
5694 + if (dictf == NULL && secondf == NULL)
5696 + dictf = trydict (personaldict, (char *) NULL, OLDPDICT, OLDPAFF);
5697 + secondf = trydict (seconddict, h, OLDPDICT, OLDPAFF);
5699 + if (personaldict[0] == '\0')
5701 + if (seconddict[0] != '\0')
5702 + (void) strcpy (personaldict, seconddict);
5704 + (void) sprintf (personaldict, "%s/%s%s", h, DEFPDICT, LibDict);
5706 + if (dictf != NULL)
5709 + (void) fclose (dictf);
5711 + if (secondf != NULL)
5713 + treeload (secondf);
5714 + (void) fclose (secondf);
5720 + ** Figure out if p is an absolute path name. Note that beginning
5721 + ** with "./" and "../" is considered an absolute path, since this
5722 + ** still means we can't prepend HOME.
5724 + abspath = (*p == '/' || strncmp (p, "./", 2) == 0
5725 + || strncmp (p, "../", 3) == 0);
5728 + abspath = (*p == '\\' || strncmp (p, ".\\", 2) == 0
5729 + || strncmp (p, "..\\", 3) == 0
5730 + || (p[0] && p[1] == ':'));
5734 + (void) strcpy (personaldict, p);
5735 + if ((dictf = fopen (personaldict, "r")) != NULL)
5738 + (void) fclose (dictf);
5744 + ** The user gave us a relative pathname. We will try it
5745 + ** locally, and if that doesn't work, we'll try the home
5746 + ** directory. If neither exists, it will be created in
5747 + ** the home directory if words are added.
5749 + (void) strcpy (personaldict, p);
5750 + if ((dictf = fopen (personaldict, "r")) != NULL)
5753 + (void) fclose (dictf);
5755 + else if (!abspath)
5757 + /* Try the home */
5758 + (void) sprintf (personaldict, "%s/%s", h, p);
5759 + if ((dictf = fopen (personaldict, "r")) != NULL)
5762 + (void) fclose (dictf);
5766 + * If dictf is null, we couldn't open the dictionary
5767 + * specified in the -p switch. Complain.
5769 + if (dictf == NULL)
5771 + (void) fprintf (stderr, CANT_OPEN, p);
5778 +#ifndef FEAT_SPELL_HL
5779 + if (!lflag && !aflag
5780 + && access (personaldict, 2) < 0 && errno != ENOENT)
5782 + (void) fprintf (stderr, TREE_C_CANT_UPDATE, personaldict);
5783 + (void) sleep ((unsigned) 2);
5789 + * Try to open a dictionary. As a side effect, leaves the dictionary
5790 + * name in "filename" if one is found, and leaves a null string there
5795 + char * filename, /* Where to store the file name */
5796 + char * home, /* Home directory */
5797 + char * prefix, /* Prefix for dictionary */
5798 + char * suffix) /* Suffix for dictionary */
5800 + FILE * dictf; /* Access to dictionary file */
5803 + (void) sprintf (filename, "%s%s", prefix, suffix);
5805 + (void) sprintf (filename, "%s/%s%s", home, prefix, suffix);
5806 + dictf = fopen (filename, "r");
5807 + if (dictf == NULL)
5808 + filename[0] = '\0';
5814 + register FILE * loadfile) /* File to load words from */
5816 + char buf[BUFSIZ]; /* Buffer for reading pers dict */
5818 + while (fgets (buf, sizeof buf, loadfile) != NULL)
5819 + treeinsert (buf, sizeof(buf), 1);
5825 + char * word, /* Word to insert - must be canonical */
5826 + int wordlen, /* Length of the word buffer */
5829 + register int i, len;
5830 + struct dent wordent;
5831 + register struct dent * dp;
5832 + struct dent * olddp;
5833 +#ifndef NO_CAPITALIZATION_SUPPORT
5834 + struct dent * newdp;
5836 + struct dent * oldhtab;
5838 + ichar_t nword[INPUTWORDLEN + MAXAFFIXLEN];
5839 +#ifndef NO_CAPITALIZATION_SUPPORT
5843 + len = strlen(word);
5844 + if((word[len - 1] == '\n') || (word[len - 1] == '\r'))
5845 + word[len - 1] = '\0', len--;
5846 + if((word[len - 1] == '\n') || (word[len - 1] == '\r'))
5847 + word[len - 1] = '\0';
5849 + * Expand hash table when it is MAXPCT % full.
5851 + if (!cantexpand && (hcount * 100) / MAXPCT >= pershsize)
5853 + oldhsize = pershsize;
5854 + oldhtab = pershtab;
5855 + for (i = 0; i < sizeof goodsizes / sizeof (goodsizes[0]); i++)
5856 + if (goodsizes[i] > pershsize)
5858 + if (i >= sizeof goodsizes / sizeof goodsizes[0])
5859 + pershsize += pershsize + 1;
5861 + pershsize = goodsizes[i];
5863 + (struct dent *) calloc ((unsigned) pershsize, sizeof (struct dent));
5864 + if (pershtab == NULL)
5866 + (void) fprintf (stderr, TREE_C_NO_SPACE);
5868 + * Try to continue anyway, since our overflow
5869 + * algorithm can handle an overfull (100%+) table,
5870 + * and the malloc very likely failed because we
5871 + * already have such a huge table, so small mallocs
5872 + * for overflow entries will still work.
5874 + if (oldhtab == NULL)
5875 + exit (1); /* No old table, can't go on */
5876 + (void) fprintf (stderr, TREE_C_TRY_ANYWAY);
5877 + cantexpand = 1; /* Suppress further messages */
5878 + pershsize = oldhsize; /* Put things back */
5879 + pershtab = oldhtab; /* ... */
5880 + newwords = 1; /* And pretend it worked */
5885 + * Re-insert old entries into new table
5887 + for (i = 0; i < oldhsize; i++)
5890 + if (dp->flagfield & USED)
5892 +#ifdef NO_CAPITALIZATION_SUPPORT
5893 + (void) tinsert (dp);
5895 + newdp = tinsert (dp);
5896 + isvariant = (dp->flagfield & MOREVARIANTS);
5899 +#ifdef NO_CAPITALIZATION_SUPPORT
5900 + while (dp != NULL)
5902 + (void) tinsert (dp);
5905 + free ((char *) olddp);
5908 + while (dp != NULL)
5912 + isvariant = dp->flagfield & MOREVARIANTS;
5913 + olddp = newdp->next;
5917 + newdp->next = olddp;
5921 + isvariant = dp->flagfield & MOREVARIANTS;
5922 + newdp = tinsert (dp);
5925 + free ((char *) olddp);
5931 + if (oldhtab != NULL)
5932 + free ((char *) oldhtab);
5937 + ** We're ready to do the insertion. Start by creating a sample
5938 + ** entry for the word.
5940 + if (makedent (word, wordlen, &wordent) < 0)
5941 + return; /* Word must be too big or something */
5943 + wordent.flagfield |= KEEP;
5945 + ** Now see if word or a variant is already in the table. We use the
5946 + ** capitalized version so we'll find the header, if any.
5948 + (void) strtoichar (nword, word, sizeof nword, 1);
5950 + if ((dp = lookup (nword, 1)) != NULL)
5952 + /* It exists. Combine caps and set the keep flag. */
5953 + if (combinecaps (dp, &wordent) < 0)
5955 + free (wordent.word);
5961 + /* It's new. Insert the word. */
5962 + dp = tinsert (&wordent);
5963 +#ifndef NO_CAPITALIZATION_SUPPORT
5964 + if (captype (dp->flagfield) == FOLLOWCASE)
5965 + (void) addvheader (dp);
5972 +Local struct dent *
5974 + struct dent * proto) /* Prototype entry to copy */
5976 + ichar_t iword[INPUTWORDLEN + MAXAFFIXLEN];
5977 + register int hcode;
5978 + register struct dent * hp; /* Next trial entry in hash table */
5979 + register struct dent * php; /* Prev. value of hp, for chaining */
5981 + if (strtoichar (iword, proto->word, sizeof iword, 1))
5982 + (void) fprintf (stderr, WORD_TOO_LONG (proto->word));
5983 +#ifdef NO_CAPITALIZATION_SUPPORT
5986 + hcode = hash (iword, pershsize);
5988 + hp = &pershtab[hcode];
5989 + if (hp->flagfield & USED)
5991 + while (hp != NULL)
5996 + hp = (struct dent *) calloc (1, sizeof (struct dent));
5999 + (void) fprintf (stderr, TREE_C_NO_SPACE);
6010 +Public struct dent *
6011 +treelookup (register ichar_t * word)
6014 + register int hcode;
6015 + register struct dent * hp;
6016 + char chword[INPUTWORDLEN + MAXAFFIXLEN];
6018 + if (pershsize <= 0)
6020 + (void) ichartostr (chword, word, sizeof chword, 1);
6021 + hcode = hash (word, pershsize);
6022 + hp = &pershtab[hcode];
6023 + while (hp != NULL && (hp->flagfield & USED))
6025 + if (strcmp (chword, hp->word) == 0)
6027 +#ifndef NO_CAPITALIZATION_SUPPORT
6028 + while (hp->flagfield & MOREVARIANTS)
6033 + if (hp != NULL && (hp->flagfield & USED))
6039 +#if SORTPERSONAL != 0
6040 +/* Comparison routine for sorting the personal dictionary with qsort */
6043 + struct dent ** enta,
6044 + struct dent ** entb)
6047 + /* The parentheses around *enta and *entb below are NECESSARY!
6048 + ** Otherwise the compiler reads it as *(enta->word), or
6049 + ** enta->word[0], which is illegal (but pcc takes it and
6050 + ** produces wrong code).
6052 + return casecmp ((*enta)->word, (*entb)->word, 1);
6060 + register struct dent * cent; /* Current entry */
6061 + register struct dent * lent; /* Linked entry */
6062 +#if SORTPERSONAL != 0
6063 + int pdictsize; /* Number of entries to write */
6064 + struct dent ** sortlist; /* List of entries to be sorted */
6065 + register struct dent ** sortptr; /* Handy pointer into sortlist */
6067 + register struct dent * ehtab; /* End of pershtab, for fast looping */
6069 + if (newwords == 0)
6072 + if ((dictf = fopen (personaldict, "w")) == NULL)
6074 + (void) fprintf (stderr, CANT_CREATE, personaldict);
6078 +#if SORTPERSONAL != 0
6080 + ** If we are going to sort the personal dictionary, we must know
6081 + ** how many items are going to be sorted.
6084 + if (hcount >= SORTPERSONAL)
6088 + for (cent = pershtab, ehtab = pershtab + pershsize; cent < ehtab;
6091 + for (lent = cent; lent != NULL; lent = lent->next)
6093 + if ((lent->flagfield & (USED | KEEP)) == (USED | KEEP))
6095 +#ifndef NO_CAPITALIZATION_SUPPORT
6096 + while (lent->flagfield & MOREVARIANTS)
6097 + lent = lent->next;
6101 + for (cent = hashtbl, ehtab = hashtbl + hashsize; cent < ehtab; cent++)
6103 + if ((cent->flagfield & (USED | KEEP)) == (USED | KEEP))
6106 + ** We only want to count variant headers
6107 + ** and standalone entries. These happen
6108 + ** to share the characteristics in the
6109 + ** test below. This test will appear
6110 + ** several more times in this routine.
6112 +#ifndef NO_CAPITALIZATION_SUPPORT
6113 + if (captype (cent->flagfield) != FOLLOWCASE
6114 + && cent->word != NULL)
6119 + sortlist = (struct dent **) malloc (pdictsize * sizeof (struct dent));
6121 + if (sortlist == NULL)
6124 + for (cent = pershtab, ehtab = pershtab + pershsize; cent < ehtab;
6127 + for (lent = cent; lent != NULL; lent = lent->next)
6129 + if ((lent->flagfield & (USED | KEEP)) == (USED | KEEP))
6131 + toutent (dictf, lent, 1);
6132 +#ifndef NO_CAPITALIZATION_SUPPORT
6133 + while (lent->flagfield & MOREVARIANTS)
6134 + lent = lent->next;
6139 + for (cent = hashtbl, ehtab = hashtbl + hashsize; cent < ehtab; cent++)
6141 + if ((cent->flagfield & (USED | KEEP)) == (USED | KEEP))
6143 +#ifndef NO_CAPITALIZATION_SUPPORT
6144 + if (captype (cent->flagfield) != FOLLOWCASE
6145 + && cent->word != NULL)
6147 + toutent (dictf, cent, 1);
6150 +#if SORTPERSONAL != 0
6154 + ** Produce dictionary in sorted order. We used to do this
6155 + ** destructively, but that turns out to fail because in some modes
6156 + ** the dictionary is written more than once. So we build an
6157 + ** auxiliary pointer table (in sortlist) and sort that. This
6158 + ** is faster anyway, though it uses more memory.
6160 + sortptr = sortlist;
6161 + for (cent = pershtab, ehtab = pershtab + pershsize; cent < ehtab; cent++)
6163 + for (lent = cent; lent != NULL; lent = lent->next)
6165 + if ((lent->flagfield & (USED | KEEP)) == (USED | KEEP))
6167 + *sortptr++ = lent;
6168 +#ifndef NO_CAPITALIZATION_SUPPORT
6169 + while (lent->flagfield & MOREVARIANTS)
6170 + lent = lent->next;
6175 + for (cent = hashtbl, ehtab = hashtbl + hashsize; cent < ehtab; cent++)
6177 + if ((cent->flagfield & (USED | KEEP)) == (USED | KEEP))
6179 +#ifndef NO_CAPITALIZATION_SUPPORT
6180 + if (captype (cent->flagfield) != FOLLOWCASE
6181 + && cent->word != NULL)
6183 + *sortptr++ = cent;
6186 + /* Sort the list */
6187 + qsort ((char *) sortlist, (unsigned) pdictsize,
6188 + sizeof (sortlist[0]),
6189 + (int (*) (const void *, const void *)) pdictcmp);
6190 + /* Write it out */
6191 + for (sortptr = sortlist; --pdictsize >= 0; )
6192 + toutent (dictf, *sortptr++, 1);
6193 + free ((char *) sortlist);
6198 + (void) fclose (dictf);
6201 +#ifdef REGEX_LOOKUP
6203 +/* check the hashed dictionary for words matching the regex. return the */
6204 +/* a matching string if found else return NULL */
6207 + char * expr, /* regular expression to use in the match */
6208 + int whence) /* 0 = start at the beg with new regx, else */
6209 + /* continue from cur point w/ old regex */
6211 + static struct dent * curent;
6212 + static int curindex;
6213 + static struct dent * curpersent;
6214 + static int curpersindex;
6215 + static REGCTYPE cmp_expr = (REGCTYPE)0;
6216 + char dummy[INPUTWORDLEN + MAXAFFIXLEN];
6221 + is = strtosichar (expr, 0);
6223 + expr = ichartosstr (is, 1);
6224 + REGFREE (cmp_expr); /* free previous compiled pattern, if any */
6225 + cmp_expr = REGCMP (cmp_expr, expr);
6228 + curpersent = pershtab;
6232 + /* search the dictionary until the word is found or the words run out */
6233 + for ( ; curindex < hashsize; curent++, curindex++)
6235 + if (curent->word != NULL
6236 + && REGEX (cmp_expr, curent->word, dummy) != NULL)
6239 + /* Everybody's gotta write a wierd expression once in a while! */
6240 + return curent++->word;
6243 + /* Try the personal dictionary too */
6244 + for ( ; curpersindex < pershsize; curpersent++, curpersindex++)
6246 + if ((curpersent->flagfield & USED) != 0
6247 + && curpersent->word != NULL
6248 + && REGEX (cmp_expr, curpersent->word, dummy) != NULL)
6251 + /* Everybody's gotta write a wierd expression once in a while! */
6252 + return curpersent++->word;
6257 +#endif /* REGEX_LOOKUP */
6258 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/util.c vim-6.2.532/src/spell/util.c
6259 --- vim-6.2.532.orig/src/spell/util.c 1970-01-01 01:00:00.000000000 +0100
6260 +++ vim-6.2.532/src/spell/util.c 2004-05-08 09:25:23.966176616 +0200
6263 +#include "ispell.h"
6265 +Local char *myrindex(char *s, char c);
6271 + int canonical) /* NZ for canonical string chars */
6273 + register ichar_t * ap;
6274 + register ichar_t * bp;
6275 + ichar_t inta[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
6276 + ichar_t intb[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
6278 + (void) strtoichar (inta, a, sizeof inta, canonical);
6279 + (void) strtoichar (intb, b, sizeof intb, canonical);
6280 + for (ap = inta, bp = intb; *ap != 0; ap++, bp++)
6285 + return hashheader.sortorder[*ap];
6286 + else if (mylower (*ap))
6288 + if (mylower (*bp) || mytoupper (*ap) != *bp)
6289 + return (int) hashheader.sortorder[*ap] -
6290 + (int) hashheader.sortorder[*bp];
6294 + if (myupper (*bp) || mytolower (*ap) != *bp)
6295 + return (int) hashheader.sortorder[*ap] -
6296 + (int) hashheader.sortorder[*bp];
6301 + return -(int) hashheader.sortorder[*bp];
6302 + for (ap = inta, bp = intb; *ap; ap++, bp++)
6306 + return (int) hashheader.sortorder[*ap] -
6307 + (int) hashheader.sortorder[*bp];
6315 + register ichar_t * word,
6316 + register ichar_t * pattern,
6321 + struct dent * firstdent,
6322 + struct flagent * pfxent,
6323 + struct flagent * sufent)
6325 + int i; /* Index into savearea */
6326 + ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN];
6327 + int nsaved; /* Number of words saved */
6330 + save_root_cap (word, pattern, prestrip, preadd, sufstrip, sufadd,
6331 + firstdent, pfxent, sufent, savearea, &nsaved);
6332 + for (i = 0; i < nsaved; i++)
6334 + if (insert (savearea[i]) < 0)
6342 + register ichar_t * word, /* Word to be saved */
6343 + register ichar_t * pattern, /* Capitalization pattern */
6344 + int prestrip, /* No. chars stripped from front */
6345 + int preadd, /* No. chars added to front of root */
6346 + int sufstrip, /* No. chars stripped from back */
6347 + int sufadd, /* No. chars added to back of root */
6348 + struct dent * firstdent, /* First dent for root */
6349 + struct flagent * pfxent, /* Pfx-flag entry for word */
6350 + struct flagent * sufent, /* Sfx-flag entry for word */
6351 + ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN],
6352 + /* Room to save words */
6353 + int * nsaved) /* Number saved so far (updated) */
6355 +#ifndef NO_CAPITALIZATION_SUPPORT
6356 + register struct dent * dent;
6357 +#endif /* NO_CAPITALIZATION_SUPPORT */
6359 + ichar_t newword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
6360 +#ifndef NO_CAPITALIZATION_SUPPORT
6361 + register ichar_t * p;
6365 +#endif /* NO_CAPITALIZATION_SUPPORT */
6367 + if (*nsaved >= MAX_CAPS)
6369 + (void) icharcpy (newword, word);
6370 + firstisupper = myupper (pattern[0]);
6371 +#ifdef NO_CAPITALIZATION_SUPPORT
6373 + ** Apply the old, simple-minded capitalization rules.
6377 + if (myupper (pattern[1]))
6381 + lowcase (newword);
6382 + newword[0] = mytoupper (newword[0]);
6386 + lowcase (newword);
6387 + (void) icharcpy (savearea[*nsaved], newword);
6390 +#else /* NO_CAPITALIZATION_SUPPORT */
6391 +#define flagsareok(dent) \
6392 + ((pfxent == NULL \
6393 + || TSTMASKBIT (dent->mask, pfxent->flagbit)) \
6394 + && (sufent == NULL \
6395 + || TSTMASKBIT (dent->mask, sufent->flagbit)))
6398 + if ((dent->flagfield & (CAPTYPEMASK | MOREVARIANTS)) == ALLCAPS)
6400 + upcase (newword); /* Uppercase required */
6401 + (void) icharcpy (savearea[*nsaved], newword);
6405 + for (p = pattern; *p; p++)
6412 + upcase (newword); /* Pattern was all caps */
6413 + (void) icharcpy (savearea[*nsaved], newword);
6417 + for (p = pattern + 1; *p; p++)
6425 + ** The pattern was all-lower or capitalized. If that's
6426 + ** legal, insert only that version.
6430 + if (captype (dent->flagfield) == CAPITALIZED
6431 + || captype (dent->flagfield) == ANYCASE)
6433 + lowcase (newword);
6434 + newword[0] = mytoupper (newword[0]);
6435 + (void) icharcpy (savearea[*nsaved], newword);
6442 + if (captype (dent->flagfield) == ANYCASE)
6444 + lowcase (newword);
6445 + (void) icharcpy (savearea[*nsaved], newword);
6450 + while (dent->flagfield & MOREVARIANTS)
6452 + dent = dent->next;
6453 + if (captype (dent->flagfield) == FOLLOWCASE
6454 + || !flagsareok (dent))
6458 + if (captype (dent->flagfield) == CAPITALIZED)
6460 + lowcase (newword);
6461 + newword[0] = mytoupper (newword[0]);
6462 + (void) icharcpy (savearea[*nsaved], newword);
6469 + if (captype (dent->flagfield) == ANYCASE)
6471 + lowcase (newword);
6472 + (void) icharcpy (savearea[*nsaved], newword);
6480 + ** Either the sample had complex capitalization, or the simple
6481 + ** capitalizations (all-lower or capitalized) are illegal.
6482 + ** Insert all legal capitalizations, including those that are
6483 + ** all-lower or capitalized. If the prototype is capitalized,
6484 + ** capitalized all-lower samples. Watch out for affixes.
6487 + p = strtosichar (dent->word, 1);
6488 + len = icharlen (p);
6489 + if (dent->flagfield & MOREVARIANTS)
6490 + dent = dent->next; /* Skip place-holder entry */
6493 + if (flagsareok (dent))
6495 + if (captype (dent->flagfield) != FOLLOWCASE)
6497 + lowcase (newword);
6498 + if (firstisupper || captype (dent->flagfield) == CAPITALIZED)
6499 + newword[0] = mytoupper (newword[0]);
6500 + (void) icharcpy (savearea[*nsaved], newword);
6502 + if (*nsaved >= MAX_CAPS)
6507 + /* Followcase is the tough one. */
6508 + p = strtosichar (dent->word, 1);
6509 + (void) bcopy ((char *) (p + prestrip),
6510 + (char *) (newword + preadd),
6511 + (len - prestrip - sufstrip) * sizeof (ichar_t));
6512 + if (myupper (p[prestrip]))
6514 + for (i = 0; i < preadd; i++)
6515 + newword[i] = mytoupper (newword[i]);
6519 + for (i = 0; i < preadd; i++)
6520 + newword[i] = mytolower (newword[i]);
6522 + limit = len + preadd + sufadd - prestrip - sufstrip;
6523 + i = len + preadd - prestrip - sufstrip;
6524 + p += len - sufstrip - 1;
6527 + for (p = newword + i; i < limit; i++, p++)
6528 + *p = mytoupper (*p);
6532 + for (p = newword + i; i < limit; i++, p++)
6533 + *p = mytolower (*p);
6535 + (void) icharcpy (savearea[*nsaved], newword);
6537 + if (*nsaved >= MAX_CAPS)
6541 + if ((dent->flagfield & MOREVARIANTS) == 0)
6542 + break; /* End of the line */
6543 + dent = dent->next;
6546 +#endif /* NO_CAPITALIZATION_SUPPORT */
6549 +insert(register ichar_t * word)
6552 + register char * realword;
6554 + realword = ichartosstr (word, 0);
6555 + for (i = 0; i < pcount; i++)
6556 + if (strcmp (possibilities[i], realword) == 0)
6559 + (void) strcpy (possibilities[pcount++], realword);
6560 + i = strlen (realword);
6561 + if (i > maxposslen)
6563 + if (pcount >= MAXPOSSIBLE)
6569 +** A trivial wrapper for rindex (file '/') on Unix, but
6570 +** saves a lot of ifdef-ing on MS-DOS.
6574 +last_slash (char *file)
6577 + char *slash = myrindex (file, '/');
6580 + ** Can have a backslash or a colon; both mean the basename
6581 + ** begins right after them.
6583 + char *bs = myrindex (file, '\\');
6586 + ** We can have both forward- and backslashes; return the
6587 + ** place of rightmost one of either gender.
6589 + if (slash == NULL || (bs != NULL && bs > slash))
6591 + if (slash == NULL && file[0] != '\0' && file[1] == ':')
6598 +myrindex(char *s, register char c)
6603 + x = s + strlen(s) - 1;
6613 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/version.h vim-6.2.532/src/spell/version.h
6614 --- vim-6.2.532.orig/src/spell/version.h 1970-01-01 01:00:00.000000000 +0100
6615 +++ vim-6.2.532/src/spell/version.h 2004-05-08 09:25:23.968176312 +0200
6618 + * Since the strings in this file are printed out when the "-v" switch is
6619 + * given to ispell, you may want to translate them into your native language.
6620 + * However, any translation of these strings MUST accurately preserve the
6621 + * legal rights under international law; you may wish to consult a lawyer
6622 + * about this since you will be responsible for the results of any
6623 + * incorrect translation.
6626 +Local char *Version_ID[] = {
6627 + "@(#) International Ispell Version 3.1.20 10/10/95",
6628 + "@(#) Copyright (c), 1983, by Pace Willisson",
6629 + "@(#) International version Copyright (c) 1987, 1988, 1990-1995,",
6630 + "@(#) by Geoff Kuenning, Granada Hills, CA. All rights reserved.",
6632 + "@(#) Redistribution and use in source and binary forms, with or without",
6633 + "@(#) modification, are permitted provided that the following conditions",
6636 + "@(#) 1. Redistributions of source code must retain the above copyright",
6637 + "@(#) notice, this list of conditions and the following disclaimer.",
6638 + "@(#) 2. Redistributions in binary form must reproduce the above",
6639 + "@(#) copyright notice, this list of conditions and the following",
6640 + "@(#) disclaimer in the documentation and/or other materials provided",
6641 + "@(#) with the distribution.",
6642 + "@(#) 3. All modifications to the source code must be clearly marked as",
6643 + "@(#) such. Binary redistributions based on modified source code",
6644 + "@(#) must be clearly marked as modified versions in the documentation",
6645 + "@(#) and/or other materials provided with the distribution.",
6646 + "@(#) 4. All advertising materials mentioning features or use of this",
6647 + "@(#) software must display the following acknowledgment:",
6648 + "@(#) This product includes software developed by Geoff Kuenning and",
6649 + "@(#) other unpaid contributors.",
6650 + "@(#) 5. The name of Geoff Kuenning may not be used to endorse or promote",
6651 + "@(#) products derived from this software without specific prior",
6652 + "@(#) written permission.",
6654 + "@(#) THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS",
6655 + "@(#) IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT",
6656 + "@(#) LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS",
6657 + "@(#) FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GEOFF",
6658 + "@(#) KUENNING OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,",
6659 + "@(#) INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
6660 + "@(#) (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR",
6661 + "@(#) SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)",
6662 + "@(#) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,",
6663 + "@(#) STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)",
6664 + "@(#) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED",
6665 + "@(#) OF THE POSSIBILITY OF SUCH DAMAGE.",
6669 +static char RCS_Version_ID[] =
6674 + * Revision 1.44 1995/10/11 05:03:28 geoff
6675 + * Upgrade to patch level 20
6677 + * Revision 1.43 1995/10/11 04:58:26 geoff
6678 + * Upgrade to patch 19
6680 + * Revision 1.42 1995/01/15 01:23:26 geoff
6681 + * Upgrade to patch level 18
6683 + * Revision 1.41 1995/01/15 01:14:30 geoff
6684 + * Upgrade to patch level 17
6686 + * Revision 1.40 1995/01/15 01:03:55 geoff
6687 + * Upgrade to patch level 16
6689 + * Revision 1.39 1995/01/15 01:01:01 geoff
6690 + * Upgrade to patch level 15
6692 + * Revision 1.38 1995/01/15 00:54:19 geoff
6693 + * Upgrade to patch level 14
6695 + * Revision 1.37 1994/11/21 07:03:01 geoff
6696 + * Update to patch level 13.
6698 + * Revision 1.36 1994/11/01 06:28:31 geoff
6699 + * Update to patch level 12
6701 + * Revision 1.35 1994/11/01 06:12:42 geoff
6702 + * Update to patch level 11
6704 + * Revision 1.34 1994/11/01 06:01:15 geoff
6705 + * Update to patch level 10
6707 + * Revision 1.33 1994/11/01 05:36:43 geoff
6708 + * Update to patch level 9
6710 + * Revision 1.32 1994/05/25 04:38:59 geoff
6711 + * Update to patch level 8
6713 + * Revision 1.31 1994/05/18 03:07:26 geoff
6714 + * Update to patch level 7
6716 + * Revision 1.30 1994/05/17 06:21:05 geoff
6717 + * Version update for ispell.el release
6719 + * Revision 1.29 1994/04/27 04:14:18 geoff
6720 + * Update to patch level 5
6722 + * Revision 1.28 1994/03/21 02:00:50 geoff
6723 + * Update to patch level 4
6725 + * Revision 1.27 1994/02/23 04:52:31 geoff
6726 + * Update to latest version.
6728 + * Revision 1.26 1994/02/08 05:59:20 geoff
6731 + * Revision 1.25 1994/02/07 08:58:28 geoff
6732 + * Get rid of a comma that confuses patch
6734 + * Revision 1.24 1994/02/07 08:24:23 geoff
6735 + * Upate patch level
6737 + * Revision 1.23 1994/01/25 07:12:21 geoff
6738 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
6741 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell/wm.h vim-6.2.532/src/spell/wm.h
6742 --- vim-6.2.532.orig/src/spell/wm.h 1970-01-01 01:00:00.000000000 +0100
6743 +++ vim-6.2.532/src/spell/wm.h 2004-05-08 09:25:23.969176160 +0200
6746 +enum _logical {False,True};
6747 +typedef enum _logical Logical;
6751 +typedef unsigned int Word;
6752 +typedef unsigned char Byte;
6755 +#define Local static
6757 diff -burN -x '*.orig' vim-6.2.532.orig/src/spell.c vim-6.2.532/src/spell.c
6758 --- vim-6.2.532.orig/src/spell.c 1970-01-01 01:00:00.000000000 +0100
6759 +++ vim-6.2.532/src/spell.c 2004-05-08 09:25:23.970176008 +0200
6761 +#include "spell/wm.h"
6764 +#include "ispell.h"
6765 +#define MAXWORDLEN 80
6767 +#ifdef FEAT_SPELL_HL
6769 +int spell_flag = 0;
6772 +ex_spell(exarg_T *eap)
6775 + if(strcmp(eap->arg, "on") == 0)
6780 + if(!reload_dict())
6784 + else if(STRCMP(eap->arg, "off") == 0)
6787 + EMSG2("Invalid :spell %s", eap->arg);
6788 + redraw_all_later(NOT_VALID);
6796 + if(spell_flag == 0)
6798 + spell_save_private_dict();
6800 + if(STRCMP(p_spell_lang, "") == 0)
6802 + EMSG("dictionary not defined");
6803 + do_cmdline((char_u *)"spell off", NULL, NULL, DOCMD_VERBOSE);
6807 + if ((err = linit(hashname)) != NULL)
6810 + do_cmdline((char_u *)"spell off", NULL, NULL, DOCMD_VERBOSE);
6814 + treeinit (NULL, p_spell_lang);
6818 +static colnr_T last_col;
6819 +static ichar_t curr_word[MAXWORDLEN + 1]; /* assume max. keyword len is 80 */
6820 +static char word_to_spell[MAXWORDLEN + 1];
6822 +static Logical in_word;
6824 +int my_is_char(char_u ccc);
6827 +get_spell_attr(spell_col, col, line)
6828 + colnr_T spell_col;
6836 + if(spell_col == 0)
6837 + last_col = 0, in_word = False, last_attr = 0;
6839 + if((spell_col < last_col) && in_word)
6840 + return(last_attr);
6841 + else if(spell_col >= last_col)
6845 + line_ptr = &line[spell_col];
6846 + curr_col = spell_col;
6847 + if(iswordch((ichar_t)(*line_ptr)) && *line_ptr)
6849 + while((spell_col > 0) && my_is_char(*(line_ptr - 1)))
6850 + spell_col--, line_ptr--;
6851 + while(isboundarych((ichar_t)(*(line_ptr))))
6852 + spell_col++, line_ptr++;
6854 + line_ptr = &line[spell_col];
6855 + curr_col = spell_col;
6856 + while(my_is_char(*line_ptr) && *line_ptr &&
6857 + ((curr_col - spell_col) < MAXWORDLEN))
6858 + curr_col++, line_ptr++;
6859 + while(isboundarych((ichar_t)(*(line_ptr - 1))))
6860 + curr_col--, line_ptr--;
6862 + if(curr_col - spell_col > 1)
6864 + /*for(i = 0; i < curr_col - spell_col; i++)
6865 + curr_word[i] = line[spell_col + i];
6866 + curr_word[curr_col - spell_col] = NUL;*/
6867 + strtoichar(curr_word,line+spell_col,(curr_col-spell_col+1)*sizeof(ichar_t),0);
6870 +/* for(i = 0; curr_word[i]; i++)
6871 + fprintf(stderr, "%c", curr_word[i]);
6872 + fprintf(stderr, "-%d\n", good((ichar_t *)curr_word, 0, 0, 0, 0)); wm */
6873 + if(good((ichar_t *)curr_word, 0, 0, 0, 0) == 0)
6874 + last_attr = hl_attr(HLF_SPELL);
6875 + last_col = curr_col;
6878 + return(last_attr);
6885 + if(iswordch((ichar_t)ccc) || isboundarych((ichar_t)ccc))
6892 +static ichar_t *itok;
6895 +set_to_private_dict(char *line, int cursor_col, int convert_to_lower)
6902 + b = line + cursor_col;
6906 + if(iswordch((ichar_t)(*b)) || isboundarych((ichar_t)(*b)))
6908 + while((iswordch((ichar_t)(*(b - 1))) ||
6909 + isboundarych((ichar_t)(*(b - 1)))) &&
6911 + b--, cursor_col--;
6912 + while(isboundarych((ichar_t)(*b)))
6914 + while((iswordch((ichar_t)(*(e))) || isboundarych((ichar_t)(*(e)))) &&
6917 + while(isboundarych((ichar_t)(*(e - 1))))
6919 + for(i = 0; b < e;)
6920 + word_to_spell[i++] = *b++;
6921 + word_to_spell[i] = '\0';
6922 + if(!convert_to_lower)
6923 + treeinsert (ichartosstr (strtosichar (word_to_spell, 0), 1),
6924 + ICHARTOSSTR_SIZE, 1);
6927 + itok = strtosichar (word_to_spell, 0);
6929 + treeinsert (ichartosstr (itok, 1), ICHARTOSSTR_SIZE, 1);
6931 + redraw_all_later(NOT_VALID);
6937 +spell_save_private_dict(void)
6944 diff -burN -x '*.orig' vim-6.2.532.orig/src/syntax.c vim-6.2.532/src/syntax.c
6945 --- vim-6.2.532.orig/src/syntax.c 2004-05-08 08:55:12.000000000 +0200
6946 +++ vim-6.2.532/src/syntax.c 2004-05-08 09:25:23.987173424 +0200
6947 @@ -5922,6 +5922,9 @@
6948 "VertSplit term=reverse cterm=reverse gui=reverse",
6949 "Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg",
6950 "VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold",
6951 +#ifdef FEAT_SPELL_HL
6952 + "Spell term=reverse ctermbg=NONE ctermfg=White guibg=NONE guifg=Red",
6954 "DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red",
6957 @@ -5942,6 +5945,9 @@
6958 "FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
6959 "SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
6960 "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue",
6961 +#ifdef FEAT_SPELL_HL
6962 + "Spell term=reverse ctermbg=NONE ctermfg=White guibg=NONE guifg=Red",
6964 "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta",
6965 "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan",
6967 @@ -5963,6 +5969,9 @@
6968 "FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
6969 "SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
6970 "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue",
6971 +#ifdef FEAT_SPELL_HL
6972 + "Spell term=reverse ctermbg=NONE ctermfg=White guibg=NONE guifg=Red",
6974 "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta",
6975 "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan",
6977 diff -burN -x '*.orig' vim-6.2.532.orig/src/version.c vim-6.2.532/src/version.c
6978 --- vim-6.2.532.orig/src/version.c 2004-05-08 08:55:13.000000000 +0200
6979 +++ vim-6.2.532/src/version.c 2004-05-08 09:25:23.992172664 +0200
6980 @@ -474,6 +474,11 @@
6984 +#ifdef FEAT_SPELL_HL
6989 /* only interesting on Unix systems */
6990 #if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__))
6992 @@ -2201,7 +2206,7 @@
7001 diff -burN -x '*.orig' vim-6.2.532.orig/src/version.h vim-6.2.532/src/version.h
7002 --- vim-6.2.532.orig/src/version.h 2004-05-08 08:55:13.000000000 +0200
7003 +++ vim-6.2.532/src/version.h 2004-05-08 09:25:23.993172512 +0200
7006 #define VIM_VERSION_NODOT "vim63"
7007 #define VIM_VERSION_SHORT "6.3"
7008 +#ifdef FEAT_SPELL_HL
7009 +#define VIM_VERSION_MEDIUM "6.3 + ispell 3.1.20 WM-3"
7011 #define VIM_VERSION_MEDIUM "6.3"
7013 #define VIM_VERSION_LONG "VIM - Vi IMproved 6.3 (2004 June 7)"
7014 #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 6.3 (2004 June 7, compiled "
7015 diff -burN -x '*.orig' vim-6.2.532.orig/src/vim.h vim-6.2.532/src/vim.h
7016 --- vim-6.2.532.orig/src/vim.h 2004-05-08 08:55:11.000000000 +0200
7017 +++ vim-6.2.532/src/vim.h 2004-05-08 09:27:06.192635832 +0200
7018 @@ -1084,13 +1084,14 @@
7019 , HLF_DED /* Deleted diff line */
7020 , HLF_TXD /* Text Changed in diff line */
7021 , HLF_SC /* Sign column */
7022 + , HLF_SPELL /* spell - string in dictionary WM */
7023 , HLF_COUNT /* MUST be the last one */
7026 /* the HL_FLAGS must be in the same order as the HLF_ enums! */
7027 #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
7028 'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
7029 - 'f', 'F', 'A', 'C', 'D', 'T', '>'}
7030 + 'f', 'F', 'A', 'C', 'D', 'T', '>', 'Z'}