1 diff -urBbN vim64.org/src/edit.c vim64/src/edit.c
2 --- vim64.org/src/edit.c 2005-04-08 11:16:31.000000000 +0200
3 +++ vim64/src/edit.c 2005-10-17 12:49:17.442845032 +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 @@ -1231,6 +1235,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 -urBbN vim64.org/src/eval.c vim64/src/eval.c
39 --- vim64.org/src/eval.c 2004-07-28 11:53:18.000000000 +0200
40 +++ vim64/src/eval.c 2005-10-17 12:49:17.448844120 +0200
51 diff -urBbN vim64.org/src/ex_cmds.h vim64/src/ex_cmds.h
52 --- vim64.org/src/ex_cmds.h 2004-08-30 14:58:51.000000000 +0200
53 +++ vim64/src/ex_cmds.h 2005-10-17 12:49:17.449843968 +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 -urBbN vim64.org/src/ex_docmd.c vim64/src/ex_docmd.c
64 --- vim64.org/src/ex_docmd.c 2005-10-08 16:24:04.000000000 +0200
65 +++ vim64/src/ex_docmd.c 2005-10-17 12:49:17.455843056 +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 @@ -3413,6 +3416,12 @@
77 set_context_in_syntax_cmd(xp, arg);
89 diff -urBbN vim64.org/src/feature.h vim64/src/feature.h
90 --- vim64.org/src/feature.h 2005-01-13 19:22:50.000000000 +0100
91 +++ vim64/src/feature.h 2005-10-17 12:49:17.457842752 +0200
93 # define FEAT_RIGHTLEFT
97 +#undef FEAT_RIGHTLEFT
100 +/* # define FEAT_PRINTER */
103 * +arabic Arabic keymap and shaping support.
104 diff -urBbN vim64.org/src/globals.h vim64/src/globals.h
105 --- vim64.org/src/globals.h 2004-06-27 15:44:13.000000000 +0200
106 +++ vim64/src/globals.h 2005-10-17 12:49:17.458842600 +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 -urBbN vim64.org/src/main.c vim64/src/main.c
118 --- vim64.org/src/main.c 2005-02-15 14:09:15.000000000 +0100
119 +++ vim64/src/main.c 2005-10-17 12:49:17.461842144 +0200
120 @@ -2263,6 +2263,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 -urBbN vim64.org/src/Makefile vim64/src/Makefile
132 --- vim64.org/src/Makefile 2005-10-15 13:52:15.000000000 +0200
133 +++ vim64/src/Makefile 2005-10-17 12:51:51.656401008 +0200
134 @@ -1211,6 +1211,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 @@ -1221,7 +1237,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 @@ -1305,6 +1321,7 @@
174 @@ -1371,6 +1388,7 @@
182 @@ -2327,6 +2345,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 @@ -2561,6 +2582,9 @@
193 ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \
194 proto/gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.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 auto/osdef.h \
200 ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \
201 proto/gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \
202 @@ -2691,3 +2715,27 @@
203 auto/osdef.h ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h \
204 gui_beval.h proto/gui_beval.pro option.h ex_cmds.h proto.h globals.h \
205 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
230 diff -urBbN vim64.org/src/normal.c vim64/src/normal.c
231 --- vim64.org/src/normal.c 2005-10-06 20:42:06.000000000 +0200
232 +++ vim64/src/normal.c 2005-10-17 12:49:17.471840624 +0200
235 static int get_visual_text __ARGS((cmdarg_T *cap, char_u **pp, int *lenp));
237 +#ifdef FEAT_SPELL_HL
238 +static void nv_settodict_q __ARGS((cmdarg_T *cap));
239 +static void nv_settodict_s __ARGS((cmdarg_T *cap));
241 static void nv_tagpop __ARGS((cmdarg_T *cap));
242 static void nv_scroll __ARGS((cmdarg_T *cap));
243 static void nv_right __ARGS((cmdarg_T *cap));
245 {Ctrl_N, nv_down, NV_STS, FALSE},
246 {Ctrl_O, nv_ctrlo, 0, 0},
247 {Ctrl_P, nv_up, NV_STS, FALSE},
248 +#ifdef FEAT_SPELL_HL
249 + {Ctrl_Q, nv_settodict_q, 0, 0},
251 {Ctrl_Q, nv_ignore, 0, 0},
253 {Ctrl_R, nv_redo, 0, 0},
254 +#ifdef FEAT_SPELL_HL
255 + {Ctrl_S, nv_settodict_s, 0, 0},
257 {Ctrl_S, nv_ignore, 0, 0},
259 {Ctrl_T, nv_tagpop, NV_NCW, 0},
260 {Ctrl_U, nv_halfpage, 0, 0},
262 @@ -7845,6 +7857,28 @@
266 +#ifdef FEAT_SPELL_HL
271 + if(set_to_private_dict(
272 + ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE),
273 + curwin->w_cursor.col, FALSE))
274 + clearopbeep(cap->oap);
281 + if(set_to_private_dict(
282 + ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE),
283 + curwin->w_cursor.col, TRUE))
284 + clearopbeep(cap->oap);
290 * In exclusive Visual mode, may include the last character.
291 diff -urBbN vim64.org/src/option.c vim64/src/option.c
292 --- vim64.org/src/option.c 2005-10-08 16:27:46.000000000 +0200
293 +++ vim64/src/option.c 2005-10-17 12:49:17.478839560 +0200
305 static char_u *p_syn;
307 +#ifdef FEAT_SPELL_HL
308 +static char_u *p_spelldirectory;
309 +static char_u *p_language;
314 @@ -1073,7 +1079,7 @@
315 {(char_u *)FALSE, (char_u *)0L}},
316 {"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
317 (char_u *)&p_hl, PV_NONE,
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",
319 + {(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",
321 {"history", "hi", P_NUM|P_VIM,
322 (char_u *)&p_hi, PV_NONE,
323 @@ -1338,6 +1344,13 @@
324 (char_u *)NULL, PV_NONE,
326 {(char_u *)"", (char_u *)0L}},
327 + {"language", "lang", P_STRING|P_ALLOCED|P_VI_DEF,
328 +#ifdef FEAT_SPELL_HL
329 + (char_u *)&p_language, PV_SPELL_LANG,
331 + (char_u *)NULL, PV_NONE,
333 + {(char_u *)"", (char_u *)0L}},
334 {"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL,
336 (char_u *)&p_ls, PV_NONE,
337 @@ -1936,6 +1949,14 @@
338 {"sourceany", NULL, P_BOOL|P_VI_DEF,
339 (char_u *)NULL, PV_NONE,
340 {(char_u *)FALSE, (char_u *)0L}},
341 + {"spelldirectory", "spelldir", P_STRING|P_ALLOCED|P_VI_DEF|P_EXPAND,
342 +#ifdef FEAT_SPELL_HL
343 + (char_u *)&p_spelldirectory, PV_SPELL_DIR,
344 + {(char_u *)"/usr/lib/ispell", (char_u *)0L}},
346 + (char_u *)NULL, PV_NONE,
347 + {(char_u *)"", (char_u *)0L}},
349 {"splitbelow", "sb", P_BOOL|P_VI_DEF,
351 (char_u *)&p_sb, PV_NONE,
352 @@ -4835,6 +4856,26 @@
356 +#ifdef FEAT_SPELL_HL
357 + else if (varp == &p_spell_dir)
359 + STRCPY(hashname, p_spell_dir);
360 + STRCAT(hashname, "/");
361 + STRCAT(hashname, p_spell_lang);
362 + STRCAT(hashname, ".hash");
364 + redraw_all_later(NOT_VALID);
366 + else if (varp == &p_spell_lang)
368 + STRCPY(hashname, p_spell_dir);
369 + STRCAT(hashname, "/");
370 + STRCAT(hashname, p_spell_lang);
371 + STRCAT(hashname, ".hash");
373 + redraw_all_later(NOT_VALID);
378 /* 'encoding' and 'fileencoding' */
379 @@ -7951,6 +7992,10 @@
381 case PV_SYN: return (char_u *)&(curbuf->b_p_syn);
383 +#ifdef FEAT_SPELL_HL
384 + case PV_SPELL_DIR: return (char_u *)&(p_spell_dir);
385 + case PV_SPELL_LANG: return (char_u *)&(p_spell_lang);
387 case PV_SW: return (char_u *)&(curbuf->b_p_sw);
388 case PV_TS: return (char_u *)&(curbuf->b_p_ts);
389 case PV_TW: return (char_u *)&(curbuf->b_p_tw);
390 diff -urBbN vim64.org/src/option.h vim64/src/option.h
391 --- vim64.org/src/option.h 2004-05-05 11:43:49.000000000 +0200
392 +++ vim64/src/option.h 2005-10-17 12:49:17.494837128 +0200
394 EXTERN char_u *p_dex; /* 'diffexpr' */
397 +EXTERN char_u *p_spell_dir; /* directory with spell hash*/
398 +EXTERN char_u *p_spell_lang; /* name of language (spell hash file)*/
399 #ifdef FEAT_INS_EXPAND
400 EXTERN char_u *p_dict; /* 'dictionary' */
402 diff -urBbN vim64.org/src/proto/spell.pro vim64/src/proto/spell.pro
403 --- vim64.org/src/proto/spell.pro 1970-01-01 01:00:00.000000000 +0100
404 +++ vim64/src/proto/spell.pro 2005-10-17 12:49:17.495836976 +0200
406 +int reload_dict(void);
\r
407 +void ex_spell(exarg_T *eap);
\r
408 +int get_spell_attr(colnr_T spell_col, colnr_T col, char_u *line);
\r
409 +int set_to_private_dict(char *line, int cursor_col, int convert_to_lower);
\r
410 +void spell_save_private_dict(void);
\r
411 diff -urBbN vim64.org/src/proto.h vim64/src/proto.h
412 --- vim64.org/src/proto.h 2005-10-08 16:22:32.000000000 +0200
413 +++ vim64/src/proto.h 2005-10-17 12:49:17.496836824 +0200
415 # include "os_qnx.pro"
418 +#ifdef FEAT_SPELL_HL
419 +# include "spell.pro"
421 # include "buffer.pro"
422 # include "charset.pro"
424 diff -urBbN vim64.org/src/screen.c vim64/src/screen.c
425 --- vim64.org/src/screen.c 2005-01-19 11:03:00.000000000 +0100
426 +++ vim64/src/screen.c 2005-10-17 12:49:17.501836064 +0200
428 static match_T match_hl; /* used for ":match" highlight matching */
431 +#ifdef FEAT_SPELL_HL
432 +extern int spell_flag;
435 static foldinfo_T win_foldinfo; /* info for 'foldcolumn' */
437 @@ -2536,6 +2539,9 @@
438 int has_syntax = FALSE; /* this buffer has syntax highl. */
441 +#ifdef FEAT_SPELL_HL
442 + int spell_attr = 0;
444 int extra_check; /* has syntax or linebreak */
446 int multi_attr = 0; /* attributes desired by multibyte */
447 @@ -2614,8 +2620,18 @@
451 +#if defined(FEAT_SYN_HL) || defined(FEAT_SPELL_HL)
454 - if (syntax_present(wp->w_buffer))
455 + syntax_present(wp->w_buffer)
459 +#ifdef FEAT_SPELL_HL
465 /* Prepare for syntax highlighting in this line. When there is an
466 * error, stop syntax highlighting. */
467 @@ -3262,6 +3278,10 @@
468 else if (search_attr == 0 && has_syntax)
469 char_attr = syntax_attr;
471 +#ifdef FEAT_SPELL_HL
472 + else if (spell_flag)
473 + char_attr = spell_attr;
476 char_attr = search_attr;
478 @@ -3576,6 +3596,17 @@
479 char_attr = syntax_attr;
482 +#ifdef FEAT_SPELL_HL
486 + spell_attr = get_spell_attr((colnr_T)v - 1, col,
487 + ml_get_buf(wp->w_buffer,
489 + if (area_attr == 0 && search_attr == 0 && spell_attr)
490 + char_attr = spell_attr;
493 #ifdef FEAT_LINEBREAK
495 * Found last space before word: check for line break
496 diff -urBbN vim64.org/src/spell/config.h vim64/src/spell/config.h
497 --- vim64.org/src/spell/config.h 1970-01-01 01:00:00.000000000 +0100
498 +++ vim64/src/spell/config.h 2005-10-17 12:49:17.504835608 +0200
500 +#include "local.h" /* local definitions for options */
503 +** Major-differences selection. The default system is BSD; for USG
504 +** or non-UNIX systems you should add the appropriate #define to local.h.
507 +#undef USG /* Define this in local.h for System V machines */
511 +#include <sys/param.h>
512 +#include <sys/types.h>
515 +# ifndef FEAT_SPELL_HL
517 +# include <dirent.h>
519 +# define NAMLEN(dirent) strlen((dirent)->d_name)
522 +# define dirent direct
523 +# define NAMLEN(dirent) (dirent)->d_namlen
524 +# if HAVE_SYS_NDIR_H
525 +# include <sys/ndir.h>
528 +# include <sys/dir.h>
538 +** Things that normally go in a Makefile. Define these just like you
539 +** might in the Makefile, except you should use #define instead of
540 +** make's assignment syntax. Everything must be double-quoted, and
541 +** (unlike make) you can't use any sort of $-syntax to pick up the
542 +** values of other definitions.
548 +#define EMACS "emacs"
557 +#define LINTFLAGS ""
558 +#endif /* LINTFLAGS */
564 +** Libraries that may need to be added to the cc line to get ispell to
565 +** link. Normally, this should be null.
572 +** TERMLIB - where to get the termcap library. Should be -ltermcap or
573 +** -lcurses on most systems.
576 +#define TERMLIB "-lncurses"
580 +** REGLIB - where to get the regular-expression routines, if
581 +** REGEX_LOOKUP is defined. Should be -lPW on USG systems, null on
589 +** Where to install various components of ispell. BINDIR contains
590 +** binaries. LIBDIR contains hash tables and affix files. ELISPDIR
591 +** contains emacs lisp files (if any) and TEXINFODIR contains emacs
592 +** TeXinfo files. MAN1DIR and MAN4DIR will hold the chapter-1 and
593 +** chapter-4 manual pages, respectively.
595 +** If you intend to use multiple dictionary files, I would suggest
596 +** LIBDIR be a directory which will contain nothing else, so sensible
597 +** names can be constructed for the -d option without conflict.
600 +#define BINDIR "/usr/bin"
603 +#define LIBDIR "/usr/lib/ispell"
606 +#define ELISPDIR "/usr/lib/emacs/site-lisp"
609 +#define TEXINFODIR "/usr/share/info"
612 +#define MAN1DIR "/usr/share/man/man1"
615 +#define MAN4DIR "/usr/share/man/man4"
619 +** Extensions to put on manual pages. Usually these are ".1" or ".1l".
622 +#define MAN1EXT ".1"
625 +#define MAN4EXT ".4"
629 +** List of all hash files (languages) which will be supported by ispell.
631 +** This variable has a complex format so that many options can be
632 +** specified. The format is as follows:
634 +** <language>[,<make-options>...] [<language> [,<make-options> ...] ...]
638 +** language is the name of a subdirectory of the
639 +** "languages" directory
640 +** make-options are options that are to be passed to "make" in
641 +** the specified directory. The make-options
642 +** should not, in general, specify a target, as
643 +** this will be provided by the make process.
645 +** For example, if LANGUAGES is:
647 +** "{american,MASTERDICTS=american.med+,HASHFILES=americanmed+.hash,EXTRADICT=/usr/dict/words /usr/dict/web2} {deutsch,DICTALWAYS=deutsch.sml,DICTOPTIONS=}"
649 +** then the American-English and Deutsch (German) languages will be supported,
650 +** and the following variable settings will be passed to the two Makefiles:
654 +** MASTERDICTS='american.med+'
655 +** HASHFILES='americanmed+.hash'
656 +** EXTRADICT='/usr/dict/words /usr/dict/web2'
660 +** DICTALWAYS='deutsch.sml'
663 +** Notes on the syntax: The makefile is not very robust. If you have
664 +** make problems, or if make seems to fail in the language-subdirs
665 +** dependency, check your syntax. The makefile adds single quotes to
666 +** the individual variables in the LANGUAGES specification, so don't
667 +** use quotes of any kind.
669 +** In the future, the first language listed in this variable will
670 +** become the default, and the DEFHASH, DEFLANG, and DEFPAFF,
671 +** variables will all become obsolete. So be sure to put your default
672 +** language first, to make later conversion easier!
674 +** Notes on options for the various languages will be found in the
675 +** Makefiles for those languages. Some of those languages may require
676 +** you to also change various limits limits like MASKBITS or the
677 +** length parameters.
679 +** A special note on the English language: because the British and
680 +** American dialects use different spelling, you should usually select
681 +** one or the other of these. If you select both, the setting of
682 +** MASTERHASH will determine which becomes the language linked to
683 +** DEFHASH (which will usually be named english.hash).
685 +** On MSDOS systems you must use names which are consistent with the
686 +** 8+3 filename restrictions, or you will risk filename collision. See
687 +** the file pc/local.djgpp for details.
690 +#define LANGUAGES "{american,MASTERDICTS=american.med+,HASHFILES=americanmed+.hash,EXTRADICT=/usr/dict/words}"
691 +#endif /* LANGUAGES */
694 +** Master hash file for DEFHASH. This is the name of a hash file
695 +** built by a language Makefile. It should be the most-popular hash
696 +** file on your system, because it is the one that will be used by
697 +** default. It must be listed in LANGUAGES, above.
700 +#define MASTERHASH "polish+.hash"
704 +** Default native-language hash file. This is the name given to the
705 +** hash table that will be used if no language is specified to
706 +** ispell. It is a link to MASTERHASH, above.
709 +#define DEFHASH "polish.hash"
713 +** Language tables for the default language. This must be the name of
714 +** the affix file that was used to generate the MASTERHASH/DEFHASH,
718 +#define DEFLANG "polish.aff"
722 +** Language to use for error messages. If there are no messages in this
723 +** language, English will be used instead.
726 +#define MSGLANG "polish"
727 +#endif /* MSGLANG */
730 +** If your sort command accepts the -T switch to set temp file
731 +** locations (try it out; it exists but is undocumented on some
732 +** systems), make the following variable the null string. Otherwise
733 +** leave it as the sed script.
736 +#define SORTTMP "-e '/!!SORTTMP!!/s/=.*$/=/'"
740 +** If your sort command accepts the -T switch (see above), make the
741 +** following variable refer to a temporary directory with lots of
742 +** space. Otherwise make it the null string.
744 +#ifndef MAKE_SORTTMP
745 +#define MAKE_SORTTMP "-T ${TMPDIR-/usr/tmp}"
749 +** If your shell needs ": Use /bin/sh" at the first line of a shell
750 +** script, make the following variable the null string. Otherwise
751 +** leave it as this sed script which will put a "#!/bin/sh" there.
753 +#ifndef MAKE_POUND_BANG
754 +#define MAKE_POUND_BANG "-e 1s,^:.*Use.*/bin/sh,#!/bin/sh,"
759 +** INSTALL program. Could be a copy program like cp or something fancier
760 +** like /usr/ucb/install -c
763 +#define INSTALL "cp"
767 +** If your system has the rename(2) system call, define HAS_RENAME and
768 +** ispell will use that call to rename backup files. Otherwise, it
769 +** will use link/unlink. There is no harm in this except on MS-DOS,
770 +** which doesn't support link/unlink.
774 +#endif /* HAS_RENAME */
776 +/* type given to signal() by signal.h */
778 +#define SIGNAL_TYPE void
781 +/* environment variable for user's word list */
783 +#define PDICTVAR "WORDLIST"
786 +/* prefix part of default word list */
788 +#define DEFPDICT ".ispell_"
792 +** suffix part of default word list
795 +#define DEFPAFF "words"
798 +/* old place to look for default word list */
800 +#define OLDPDICT ".ispell_"
801 +#endif /* OLDPDICT */
803 +#define OLDPAFF "words"
804 +#endif /* OLDPAFF */
806 +/* environment variable for include file string */
808 +#define INCSTRVAR "INCLUDE_STRING"
811 +/* default include string */
813 +#define DEFINCSTR "&Include_File&"
816 +/* mktemp template for temporary file - MUST contain 6 consecutive X's */
818 +#define TEMPNAME "/tmp/ispellXXXXXX"
822 +** If REGEX_LOOKUP is undefined, the lookup command (L) will use the look(1)
823 +** command (if available) or the egrep command. If REGEX_LOOKUP is defined,
824 +** the lookup command will use the internal dictionary and the
825 +** regular-expression library (which you must supply separately. There is
826 +** a public-domain library available; libraries are also distributed with
827 +** both BSD and System V.
829 +** The advantage of no REGEX_LOOKUP is that it is often much faster, especially
830 +** if the look(1) command is available, that the words found are presented
831 +** in alphabetical order, and that the list of words searched is larger.
832 +** The advantage of REGEX_LOOKUP is that ispell doesn't need to spawn another
833 +** program, and the list of words searched is exactly the list of (root) words
834 +** that ispell will accept. (However, note that words formed with affixes will
835 +** not be found; this can produce some artifacts. For example, since
836 +** "brother" can be formed as "broth+er", a lookup command might fail to
839 +#ifndef REGEX_LOOKUP
841 +#endif /* REGEX_LOOKUP */
844 +** Choose the proper type of regular-expression routines here. BSD
845 +** and public-domain systems have routines called re_comp and re_exec;
846 +** System V uses regcmp and regex.
848 +** REGCTYPE is the type of a variable to hold the compiled regexp
849 +** REGCMP(re,str) is the function which compiles a regexp in `str' into
850 +** a compiled regexp `re' declared as REGCTYPE and
852 +** REGEX(re,str,dummy) is a function which matches `str' against a compiled
853 +** regexp in `re' and returns a non-NULL pointer if it
854 +** matches, NULL otherwise.
855 +** REGFREE(re) is anything that should be done when the compiled
856 +** regexp `re' is no longer needed. It can be also used
857 +** to allocate any structures required to compile a
858 +** regexp, since it is called *before* compiling a new
859 +** regexp (that's where we know that the old one will no
862 +** Here is one way of defining these if you have POSIX regexp functions:
864 +** #include <sys/types.h>
865 +** #include <regex.h>
866 +** #define REGCTYPE regex_t *
867 +** #define REGCMP(re,str) (regcomp (re, str, 0), re)
868 +** #define REGEX(re, str, dummy) \
869 +** (re != 0 && regexec (re, str, 0, 0, 0) == 0 ? (char *)1 : NULL)
870 +** #define REGFREE(re) \
873 +** re = (regex_t *)calloc (1, sizeof (regex_t)); \
882 +#define REGCTYPE char *
883 +#define REGCMP(re,str) regcmp (str, (char *) 0)
884 +#define REGEX(re, str, dummy) regex (re, str, dummy, dummy, dummy, dummy, \
885 + dummy, dummy, dummy, dummy, dummy, dummy)
886 +#define REGFREE(re) do {if (re != NULL) free (re); re = NULL;} \
889 +#define REGCTYPE char *
890 +#define REGFREE(re) (void)0
891 +#define REGCMP(re,str) re_comp (str)
892 +#define REGEX(re, str, dummy) re_exec (str)
895 +#endif /* REGEX_LOOKUP */
897 +/* look command (if look(1) MAY BE available - ignored if not) */
898 +#ifndef REGEX_LOOKUP
900 +#define LOOK "look -df"
902 +#endif /* REGEX_LOOKUP */
904 +/* path to egrep (use speeded up version if available) */
907 +#define EGREPCMD "/bin/egrep"
909 +#define EGREPCMD "/usr/bin/egrep -i"
913 +/* path to wordlist for Lookup command (typically /usr/dict/{words|web2}) */
914 +/* note that /usr/dict/web2 is usually a bad idea due to obscure words */
916 +#define WORDS "/usr/dict/words"
919 +/* buffer size to use for file names if not in sys/param.h */
921 +#define MAXPATHLEN 240
924 +/* max file name length (will truncate to fit BAKEXT) if not in sys/param.h */
926 +#define MAXNAMLEN 14
929 +/* define if you want .bak file names truncated to MAXNAMLEN characters */
932 +#endif /* TRUNCATEBAK */
934 +/* largest word accepted from a file by any input routine, plus one */
935 +#ifndef INPUTWORDLEN
936 +#define INPUTWORDLEN 100
939 +/* largest amount that a word might be extended by adding affixes */
941 +#define MAXAFFIXLEN 20
945 +** Define the following to suppress the 8-bit character feature.
946 +** Unfortunately, this doesn't work as well as it might, because ispell
947 +** only strips the 8th bit in some places. For example, it calls strcmp()
948 +** quite often without first stripping parity. However, I really wonder
949 +** about the utility of this option, so I haven't bothered to fix it. If
950 +** you think the stripping feature of NO8BIT is useful, you might let me
951 +** (Geoff Kuenning) know.
953 +** Nevertheless, NO8BIT is a useful option for other reasons. If NO8BIT
954 +** is defined, ispell will probably use 8-bit characters internally;
955 +** this improves time efficiency and saves a small amount of space
956 +** in the hash file. Thus, I recommend you specify NO8BIT unless you
957 +** actually expect to be spelling files which use a 256-character set.
964 +** Number of mask bits (affix flags) supported. Must be 32, 64, 128, or
965 +** 256. If MASKBITS is 32 or 64, there are really only 26 or 58 flags
966 +** available, respectively. If it is 32, the flags are named with the
967 +** 26 English uppercase letters; lowercase will be converted to uppercase.
968 +** If MASKBITS is 64, the 58 flags are named 'A' through 'z' in ASCII
969 +** order, including the 6 special characters from 'Z' to 'a': "[\]^_`".
970 +** If MASKBITS is 128 or 256, all the 7-bit or 8-bit characters,
971 +** respectively, are theoretically available, though a few (newline, slash,
972 +** null byte) are pretty hard to actually use successfully.
974 +** Note that a number of non-English affix files depend on having a
975 +** larger value for MASKBITS. See the affix files for more
983 +** C type to use for masks. This should be a type that the processor
984 +** accesses efficiently.
986 +** MASKTYPE_WIDTH must correctly reflect the number of bits in a
987 +** MASKTYPE. Unfortunately, it is also required to be a constant at
988 +** preprocessor time, which means you can't use the sizeof operator to
991 +** Note that MASKTYPE *must* match MASKTYPE_WIDTH or you may get
992 +** division-by-zero errors!
995 +#define MASKTYPE long
997 +#ifndef MASKTYPE_WIDTH
998 +#define MASKTYPE_WIDTH 32
1000 +#if MASKBITS < MASKTYPE_WIDTH
1002 +#define MASKBITS MASKTYPE_WIDTH
1003 +#endif /* MASKBITS < MASKTYPE_WIDTH */
1006 +/* maximum number of include files supported by xgets; set to 0 to disable */
1007 +#ifndef MAXINCLUDEFILES
1008 +#define MAXINCLUDEFILES 5
1012 +** Maximum hash table fullness percentage. Larger numbers trade space
1016 +#define MAXPCT 70 /* Expand table when 70% full */
1020 +** Maximum number of "string" characters that can be defined in a
1021 +** language (affix) file. Don't forget that an upper/lower string
1022 +** character counts as two!
1024 +#ifndef MAXSTRINGCHARS
1025 +#define MAXSTRINGCHARS 512
1026 +#endif /* MAXSTRINGCHARS */
1029 +** Maximum length of a "string" character. The default is appropriate for
1030 +** nroff-style characters starting with a backslash.
1032 +#ifndef MAXSTRINGCHARLEN
1033 +#define MAXSTRINGCHARLEN 10
1034 +#endif /* MAXSTRINGCHARLEN */
1037 +** the S_NOPARITY mask is applied to user input characters from the terminal
1038 +** in order to mask out the parity bit.
1041 +#define S_NOPARITY 0x7f
1043 +#define S_NOPARITY 0xff
1048 +** the terminal mode for ispell, set to CBREAK or RAW
1052 +#define TERM_MODE CBREAK
1056 +** Define this if you want your columns of words to be of equal length.
1057 +** This will spread short word lists across the screen instead of down it.
1059 +#ifndef EQUAL_COLUMNS
1060 +#undef EQUAL_COLUMNS
1061 +#endif /* EQUAL_COLUMNS */
1064 +** This is the extension that will be added to backup files
1067 +#define BAKEXT ".bak"
1071 +** Define this if you want to suppress the capitalization-checking
1072 +** feature. This will reduce the size of the hashed dictionary on
1073 +** most 16-bit and some 32-bit machines. This option is not
1076 +#ifndef NO_CAPITALIZATION_SUPPORT
1077 +#undef NO_CAPITALIZATION_SUPPORT
1078 +#endif /* NO_CAPITALIZATION_SUPPORT */
1081 +** Define this if you want your personal dictionary sorted. This may take
1082 +** a long time for very large dictionaries. Dictionaries larger than
1083 +** SORTPERSONAL words will not be sorted. Define SORTPERSONAL as zero
1084 +** to disable this feature.
1086 +#ifndef SORTPERSONAL
1087 +#define SORTPERSONAL 1000
1091 +** Define this if you want to use the shell for interpretation of commands
1092 +** issued via the "L" command, "^Z" under System V, and "!". If this is
1093 +** not defined then a direct fork()/exec() will be used in place of the
1094 +** normal system(). This may speed up these operations greately on some
1102 +** Maximum language-table search size. Smaller numbers make ispell
1103 +** run faster, at the expense of more memory (the lowest reasonable value
1104 +** is 2). If a given character appears in a significant position in
1105 +** more than MAXSEARCH suffixes, it will be given its own index table.
1106 +** If you change this, define INDEXDUMP in lookup.c to be sure your
1107 +** index table looks reasonable.
1110 +#define MAXSEARCH 4
1114 +** Define this if you want to be able to type any command at a "type space
1115 +** to continue" prompt.
1117 +#ifndef COMMANDFORSPACE
1118 +#undef COMMANDFORSPACE
1119 +#endif /* COMMANDFORSPACE */
1122 +** Memory-allocation increment. Buildhash allocates memory in chunks
1123 +** of this size, and then subdivides it to get its storage. This saves
1124 +** much malloc execution time. A good number for this is the system
1125 +** page size less the malloc storage overhead.
1127 +** Define this to zero to revert to using malloc/realloc. This is normally
1128 +** useful only on systems with limited memory.
1130 +#ifndef MALLOC_INCREMENT
1131 +#define MALLOC_INCREMENT 0
1135 +** Maximum number of "hits" expected on a word. This is basically the
1136 +** number of different ways different affixes can produce the same word.
1137 +** For example, with "english.aff", "brothers" can be produced 3 ways:
1138 +** "brothers," "brother+s", or "broth+ers". If this is too low, no major
1139 +** harm will be done, but ispell may occasionally forget a capitalization.
1142 +#define MAX_HITS 10
1146 +** Maximum number of capitalization variations expected in any word.
1147 +** Besides the obvious all-lower, all-upper, and capitalized versions,
1148 +** this includes followcase variants. If this is too low, no real
1149 +** harm will be done, but ispell may occasionally fail to suggest a
1150 +** correct capitalization.
1153 +#define MAX_CAPS 10
1154 +#endif /* MAX_CAPS */
1156 +/* Define this to ignore spelling check of entire LaTeX bibliography listings */
1162 +** Default nroff and TeX special characters. Normally, you won't want to
1163 +** change this; instead you would override it in the language-definition
1167 +#define TEXSPECIAL "{}$*.%#&?,;:!@~-"
1171 +#define NRSPECIAL "().\\*"
1175 +** Defaults for certain command-line flags.
1177 +#ifndef DEFNOBACKUPFLAG
1178 +#define DEFNOBACKUPFLAG 0 /* Don't suppress backup file */
1181 +#define DEFTEXFLAG 0 /* Default to nroff mode */
1185 +** Define this if you want ispell to place a limitation on the maximum
1186 +** size of the screen. On windowed workstations with very large windows,
1187 +** the size of the window can be too much of a good thing, forcing the
1188 +** user to look back and forth between the bottom and top of the screen.
1189 +** If MAX_SCREEN_SIZE is nonzero, screens larger than this will be treated
1190 +** as if they have only MAX_SCREEN_SIZE lines. A good value for this
1191 +** variable is 24 or 30. Define it as zero to suppress the feature.
1193 +#ifndef MAX_SCREEN_SIZE
1194 +#define MAX_SCREEN_SIZE 0
1198 +** The next three variables are used to provide a variable-size context
1199 +** display at the bottom of the screen. Normally, the user will see
1200 +** a number of lines equal to CONTEXTPCT of his screen, rounded down
1201 +** (thus, with CONTEXTPCT == 10, a 24-line screen will produce two lines
1202 +** of context). The context will never be greater than MAXCONTEXT or
1203 +** less than MINCONTEXT. To disable this feature entirely, set MAXCONTEXT
1204 +** and MINCONTEXT to the same value. To round context percentages up,
1205 +** define CONTEXTROUNDUP.
1207 +** Warning: don't set MAXCONTEXT ridiculously large. There is a
1208 +** static buffer of size MAXCONTEXT*BUFSIZ; since BUFSIZ is frequently
1209 +** 1K or larger, this can create a remarkably large executable.
1212 +#define CONTEXTPCT 10 /* Use 10% of the screen for context */
1215 +#define MINCONTEXT 2 /* Always show at least 2 lines of context */
1218 +#define MAXCONTEXT 10 /* Never show more than 10 lines of context */
1220 +#ifndef CONTEXTROUNDUP
1221 +#undef CONTEXTROUNDUP /* Don't round context up */
1225 +** Define this if you want the context lines to be displayed at the
1226 +** bottom of the screen, the way they used to be, rather than at the top.
1228 +#ifndef BOTTOMCONTEXT
1229 +#undef BOTTOMCONTEXT
1230 +#endif /* BOTTOMCONTEXT */
1233 +** Define this if you want the "mini-menu," which gives the most important
1234 +** options at the bottom of the screen, to be the default (in any case, it
1235 +** can be controlled with the "-M" switch).
1242 +** You might want to change this to zero if your users want to check
1243 +** single-letter words against the dictionary. However, you should try
1244 +** some sample runs using the -W switch before you try it out; you'd
1245 +** be surprised how many single letters appear in documents. If you increase
1246 +** MINWORD beyond 1, don't say I didn't warn you that it was a bad idea.
1249 +#define MINWORD 1 /* Words this short and shorter are always ok */
1253 +** ANSI C compilers are supposed to provide an include file,
1254 +** "stdlib.h", which gives function prototypes for all library
1255 +** routines. Define NO_STDLIB_H if you have a compiler that claims to
1256 +** be ANSI, but doesn't provide this include file.
1258 +#ifndef NO_STDLIB_H
1260 +#define NO_STDLIB_H
1261 +#endif /* __STDC__ */
1262 +#endif /* NO_STDLIB_H */
1265 +** The following define is used by the ispell developer to help
1266 +** double-check the software. Leave it undefined on other systems
1267 +** unless you are especially fond of warning messages, or are pursuing
1268 +** an inexplicable bug that might be related to a type mismatch.
1270 +#ifndef GENERATE_LIBARARY_PROTOS
1271 +#undef GENERATE_LIBARARY_PROTOS
1272 +#endif /* GENERATE_LIBARARY_PROTOS */
1275 +** Symbols below this point are generally intended to cater to
1276 +** idiosyncracies of specific machines and operating systems.
1278 +** MS-DOS users should also define HAS_RENAME, above, if appropriate.
1280 +** Define PIECEMEAL_HASH_WRITES if your system can't handle huge write
1281 +** operations. This is known to be a problem on MS-DOS systems when
1282 +** a 16-bit compiler is used to compile Ispell.
1284 +#ifndef PIECEMEAL_HASH_WRITES
1285 +#undef PIECEMEAL_HASH_WRITES
1286 +#endif /* PIECEMEAL_HASH_WRITES */
1289 +** Redefine GETKEYSTROKE() to getkey() on some MS-DOS systems where
1290 +** getchar() doesn't operate properly in raw mode.
1292 +#ifndef GETKEYSTROKE
1293 +#define GETKEYSTROKE() getchar ()
1294 +#endif /* GETKEYSTROKE */
1297 +** Define MSDOS_BINARY_OPEN to 0x8000 on MS-DOS systems. This can be
1298 +** done by adding "#include fcntl.h" to your local.h file.
1300 +#ifndef MSDOS_BINARY_OPEN
1302 +#define MSDOS_BINARY_OPEN O_BINARY
1303 +#else /* O_BINARY */
1304 +#define MSDOS_BINARY_OPEN 0
1305 +#endif /* O_BINARY */
1306 +#endif /* MSDOS_BINARY_OPEN */
1309 +** Environment variable to use to locate the home directory. On DOS
1310 +** systems you might want to set this to ISPELL_HOME to avoid
1311 +** conflicts with other programs that look for a HOME environment
1312 +** variable; on all other systems it should be just HOME.
1315 +#define HOME "HOME"
1319 +** On MS-DOS systems, define PDICTHOME to be the name of a directory
1320 +** to be used to contain the personal dictionary (.ispell_english,
1321 +** etc.). On other systems, you can leave it undefined.
1325 +#endif /* PDICTHOME */
1328 +** On MS-DOS systems, you can rename the following variables so that
1329 +** ispell's files have 3-character suffixes. Note that, if you do
1330 +** this, you will have to redefine any variable above that incorporates
1331 +** one of the suffixes. (Most MS-DOS environments will silently truncate
1332 +** excess characters beyond the 8+3 limit, so you usually don't need to
1333 +** change the suffixes just because they are longer than 3 characters.)
1336 +#define HASHSUFFIX ".hash"
1337 +#endif /* HASHSUFFIX */
1339 +#define STATSUFFIX ".sta"
1340 +#endif /* STATSUFFIX */
1341 +#ifndef COUNTSUFFIX
1342 +#define COUNTSUFFIX ".cnt"
1343 +#endif /* COUNTSUFFIX */
1344 +#define SIGNAL_TYPE_STRING "void"
1345 +#define MASKTYPE_STRING "long"
1346 diff -urBbN vim64.org/src/spell/good.c vim64/src/spell/good.c
1347 --- vim64.org/src/spell/good.c 1970-01-01 01:00:00.000000000 +0100
1348 +++ vim64/src/spell/good.c 2005-10-17 12:49:17.505835456 +0200
1351 +static char Rcs_Id[] =
1356 + * good.c - see if a word or its root word
1357 + * is in the dictionary.
1359 + * Pace Willisson, 1983
1361 + * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
1362 + * All rights reserved.
1364 + * Redistribution and use in source and binary forms, with or without
1365 + * modification, are permitted provided that the following conditions
1368 + * 1. Redistributions of source code must retain the above copyright
1369 + * notice, this list of conditions and the following disclaimer.
1370 + * 2. Redistributions in binary form must reproduce the above copyright
1371 + * notice, this list of conditions and the following disclaimer in the
1372 + * documentation and/or other materials provided with the distribution.
1373 + * 3. All modifications to the source code must be clearly marked as
1374 + * such. Binary redistributions based on modified source code
1375 + * must be clearly marked as modified versions in the documentation
1376 + * and/or other materials provided with the distribution.
1377 + * 4. All advertising materials mentioning features or use of this software
1378 + * must display the following acknowledgment:
1379 + * This product includes software developed by Geoff Kuenning and
1380 + * other unpaid contributors.
1381 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
1382 + * products derived from this software without specific prior
1383 + * written permission.
1385 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
1386 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1387 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1388 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
1389 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1390 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1391 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1392 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1393 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1394 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1400 + * Revision 1.43 1994/11/02 06:56:05 geoff
1401 + * Remove the anyword feature, which I've decided is a bad idea.
1403 + * Revision 1.42 1994/10/25 05:45:59 geoff
1404 + * Add support for an affix that will work with any word, even if there's
1405 + * no explicit flag.
1407 + * Revision 1.41 1994/05/24 06:23:06 geoff
1408 + * Let tgood decide capitalization questions, rather than doing it ourselves.
1410 + * Revision 1.40 1994/05/17 06:44:10 geoff
1411 + * Add support for controlled compound formation and the COMPOUNDONLY
1412 + * option to affix flags.
1414 + * Revision 1.39 1994/01/25 07:11:31 geoff
1415 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
1420 +#include "ispell.h"
1422 +#ifndef NO_CAPITALIZATION_SUPPORT
1423 +Public Logical cap_ok (ichar_t * word, struct success * hit, int len);
1424 +Local Logical entryhasaffixes (struct dent * dent, struct success * hit);
1425 +#endif /* NO_CAPITALIZATION_SUPPORT */
1426 +Public void flagpr (ichar_t * word, int preflag, int prestrip,
1427 + int preadd, int sufflag, int sufadd);
1428 +Local ichar_t * orig_word;
1431 +#ifndef NO_CAPITALIZATION_SUPPORT
1432 +good (ichar_t *w, int ignoreflagbits, int allhits, int pfxopts, int sfxopts)
1435 +good (ichar_t *w, int ignoreflagbits, int dummy, int pfxopts, int sfxopts)
1436 +#define allhits 0 /* Never actually need more than one hit */
1440 + ichar_t nword[INPUTWORDLEN + MAXAFFIXLEN];
1441 + register ichar_t *p;
1442 + register ichar_t *q;
1444 + register struct dent *dp;
1447 + ** Make an uppercase copy of the word we are checking.
1449 + for (p = w, q = nword; *p; )
1450 + *q++ = mytoupper (*p++);
1458 + (void) printf ("%s", ichartosstr (w, 0));
1461 + else if ((dp = lookup (nword, 1)) != NULL)
1463 + hits[0].dictent = dp;
1464 + hits[0].prefix = NULL;
1465 + hits[0].suffix = NULL;
1466 +#ifndef NO_CAPITALIZATION_SUPPORT
1467 + if (allhits || cap_ok (w, &hits[0], n))
1473 + * If we're looking for compounds, and this root doesn't
1474 + * participate in compound formation, undo the hit.
1476 + if (compoundflag == COMPOUND_CONTROLLED
1477 + && ((pfxopts | sfxopts) & FF_COMPOUNDONLY) != 0
1478 + && hashheader.compoundbit >= 0
1479 + && TSTMASKBIT (dp->mask, hashheader.compoundbit) == 0)
1482 + if (numhits && !allhits)
1485 + /* try stripping off affixes */
1488 + numchars = icharlen (nword);
1492 + (void) putchar ('\n');
1493 + return numhits || (numchars == 1);
1497 + chk_aff (w, nword, n, ignoreflagbits, allhits, pfxopts, sfxopts);
1500 + (void) putchar ('\n');
1505 +#ifndef NO_CAPITALIZATION_SUPPORT
1507 +cap_ok (register ichar_t *word, register struct success *hit, int len)
1509 + register ichar_t * dword;
1510 + register ichar_t * w;
1511 + register struct dent * dent;
1512 + ichar_t dentword[INPUTWORDLEN + MAXAFFIXLEN];
1520 + thiscap = whatcap (word);
1522 + ** All caps is always legal, regardless of affixes.
1524 + preadd = prestrip = sufadd = 0;
1525 + if (thiscap == ALLCAPS)
1527 + else if (thiscap == FOLLOWCASE)
1529 + /* Set up some constants for the while(1) loop below */
1532 + preadd = hit->prefix->affl;
1533 + prestrip = hit->prefix->stripl;
1536 + preadd = prestrip = 0;
1537 + sufadd = hit->suffix ? hit->suffix->affl : 0;
1540 + ** Search the variants for one that matches what we have. Note
1541 + ** that thiscap can't be ALLCAPS, since we already returned
1544 + dent = hit->dictent;
1547 + dentcap = captype (dent->flagfield);
1548 + if (dentcap != thiscap)
1550 + if (dentcap == ANYCASE && thiscap == CAPITALIZED
1551 + && entryhasaffixes (dent, hit))
1554 + else /* captypes match */
1556 + if (thiscap != FOLLOWCASE)
1558 + if (entryhasaffixes (dent, hit))
1564 + ** Make sure followcase matches exactly.
1565 + ** Life is made more difficult by the
1566 + ** possibility of affixes. Start with
1569 + (void) strtoichar (dentword, dent->word, INPUTWORDLEN, 1);
1571 + limit = word + preadd;
1572 + if (myupper (dword[prestrip]))
1574 + for (w = word; w < limit; w++)
1577 + goto doublecontinue;
1582 + for (w = word; w < limit; w++)
1585 + goto doublecontinue;
1588 + dword += prestrip;
1589 + /* Do root part of word */
1590 + limit = dword + len - preadd - sufadd;
1591 + while (dword < limit)
1593 + if (*dword++ != *w++)
1594 + goto doublecontinue;
1597 + dword = limit - 1;
1598 + if (myupper (*dword))
1603 + goto doublecontinue;
1611 + goto doublecontinue;
1615 + ** All failure paths go to "doublecontinue,"
1616 + ** so if we get here it must match.
1618 + if (entryhasaffixes (dent, hit))
1623 + if ((dent->flagfield & MOREVARIANTS) == 0)
1625 + dent = dent->next;
1628 + /* No matches found */
1633 +** See if this particular capitalization (dent) is legal with these
1634 +** particular affixes.
1637 +entryhasaffixes (register struct dent *dent, register struct success *hit)
1640 + if (hit->prefix && !TSTMASKBIT (dent->mask, hit->prefix->flagbit))
1642 + if (hit->suffix && !TSTMASKBIT (dent->mask, hit->suffix->flagbit))
1644 + return True; /* Yes, these affixes are legal */
1649 + * Print a word and its flag, making sure the case of the output matches
1650 + * the case of the original found in "orig_word".
1653 +flagpr (register ichar_t *word, /* (Modified) word to print */
1654 + int preflag, /* Prefix flag (if any) */
1655 + int prestrip, /* Lth of pfx stripped off orig_word */
1656 + int preadd, /* Length of prefix added to w */
1657 + int sufflag, /* Suffix flag (if any) */
1658 + int sufadd) /* Length of suffix added to w */
1660 + register ichar_t * origp; /* Pointer into orig_word */
1661 + int orig_len; /* Length of orig_word */
1663 + orig_len = icharlen (orig_word);
1665 + * We refuse to print if the cases outside the modification
1666 + * points don't match those just inside. This prevents things
1667 + * like "OEM's" from being turned into "OEM/S" which expands
1668 + * only to "OEM'S".
1672 + origp = orig_word + preadd;
1673 + if (myupper (*origp))
1675 + for (origp = orig_word; origp < orig_word + preadd; origp++)
1677 + if (mylower (*origp))
1683 + for (origp = orig_word; origp < orig_word + preadd; origp++)
1685 + if (myupper (*origp))
1692 + origp = orig_word + orig_len - sufadd;
1693 + if (myupper (origp[-1]))
1695 + for ( ; *origp != 0; origp++)
1697 + if (mylower (*origp))
1703 + origp = orig_word + orig_len - sufadd;
1704 + for ( ; *origp != 0; origp++)
1706 + if (myupper (*origp))
1712 + * The cases are ok. Put out the word, being careful that the
1713 + * prefix/suffix cases match those in the original, and that the
1714 + * unchanged characters from the original actually match it.
1716 + (void) putchar (' ');
1717 + origp = orig_word + preadd;
1718 + if (myupper (*origp))
1720 + while (--prestrip >= 0)
1721 + (void) fputs (printichar ((int) *word++), stdout);
1725 + while (--prestrip >= 0)
1726 + (void) fputs (printichar ((int) mytolower (*word++)), stdout);
1728 + for (prestrip = orig_len - preadd - sufadd; --prestrip >= 0; word++)
1729 + (void) fputs (printichar ((int) *origp++), stdout);
1730 + if (origp > orig_word)
1732 + if (myupper (*origp))
1733 + (void) fputs (ichartosstr (word, 0), stdout);
1738 + (void) fputs (printichar ((int) mytolower (*word++)), stdout);
1742 + * Now put out the flags
1744 + (void) putchar (hashheader.flagmarker);
1746 + (void) putchar (preflag);
1748 + (void) putchar (sufflag);
1750 diff -urBbN vim64.org/src/spell/hash.c vim64/src/spell/hash.c
1751 --- vim64.org/src/spell/hash.c 1970-01-01 01:00:00.000000000 +0100
1752 +++ vim64/src/spell/hash.c 2005-10-17 12:49:17.506835304 +0200
1755 + * hash.c - a simple hash function for ispell
1757 + * Pace Willisson, 1983
1759 + * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
1760 + * All rights reserved.
1762 + * Redistribution and use in source and binary forms, with or without
1763 + * modification, are permitted provided that the following conditions
1766 + * 1. Redistributions of source code must retain the above copyright
1767 + * notice, this list of conditions and the following disclaimer.
1768 + * 2. Redistributions in binary form must reproduce the above copyright
1769 + * notice, this list of conditions and the following disclaimer in the
1770 + * documentation and/or other materials provided with the distribution.
1771 + * 3. All modifications to the source code must be clearly marked as
1772 + * such. Binary redistributions based on modified source code
1773 + * must be clearly marked as modified versions in the documentation
1774 + * and/or other materials provided with the distribution.
1775 + * 4. All advertising materials mentioning features or use of this software
1776 + * must display the following acknowledgment:
1777 + * This product includes software developed by Geoff Kuenning and
1778 + * other unpaid contributors.
1779 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
1780 + * products derived from this software without specific prior
1781 + * written permission.
1783 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
1784 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1785 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1786 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
1787 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1788 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1789 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1790 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1791 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1792 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1798 + * Revision 1.20 1994/01/25 07:11:34 geoff
1799 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
1803 +#include "ispell.h"
1806 + * The following hash algorithm is due to Ian Dall, with slight modifications
1807 + * by Geoff Kuenning to reflect the results of testing with the English
1808 + * dictionaries actually distributed with ispell.
1810 +#define HASHSHIFT 5
1812 +#ifdef NO_CAPITALIZATION_SUPPORT
1813 +#define HASHUPPER(c) c
1814 +#else /* NO_CAPITALIZATION_SUPPORT */
1815 +#define HASHUPPER(c) mytoupper(c)
1816 +#endif /* NO_CAPITALIZATION_SUPPORT */
1820 + register ichar_t * s,
1821 + register int hashtblsize)
1823 + register long h = 0;
1826 +#ifdef ICHAR_IS_CHAR
1827 + for (i = 4; i-- && *s != 0; )
1828 + h = (h << 8) | HASHUPPER (*s++);
1829 +#else /* ICHAR_IS_CHAR */
1830 + for (i = 2; i-- && *s != 0; )
1831 + h = (h << 16) | HASHUPPER (*s++);
1832 +#endif /* ICHAR_IS_CHAR */
1836 + * We have to do circular shifts the hard way, since C doesn't
1837 + * have them even though the hardware probably does. Oh, well.
1839 + h = (h << HASHSHIFT) |
1840 + ((h >> (32 - HASHSHIFT)) & ((1 << HASHSHIFT) - 1));
1841 + h ^= HASHUPPER (*s++);
1843 + return (unsigned long) h % hashtblsize;
1845 diff -urBbN vim64.org/src/spell/i_proto.h vim64/src/spell/i_proto.h
1846 --- vim64.org/src/spell/i_proto.h 1970-01-01 01:00:00.000000000 +0100
1847 +++ vim64/src/spell/i_proto.h 2005-10-17 12:49:17.507835152 +0200
1849 +Global int addvheader (struct dent * ent);
1850 +Global void askmode (void);
1851 +Global void backup (void);
1852 +#ifndef NO_CAPITALIZATION_SUPPORT
1853 +Global Logical cap_ok (ichar_t * word, struct success * hit, int len);
1854 +#endif /* NO_CAPITALIZATION_SUPPORT */
1855 +Global void chupcase (char * s);
1856 +Global void checkfile (void);
1857 +Global void checkline (FILE * ofile);
1858 +Global void chk_aff (ichar_t * word, ichar_t * ucword, int len,
1859 + int ignoreflagbits, int allhits, int pfxopts, int sfxopts);
1860 +Global int combinecaps (struct dent * hdr, struct dent * newent);
1861 +Global int compoundgood (ichar_t * word, int pfxopts);
1862 +Global void copyout (char ** cc, int cnt);
1863 +Global void correct (char * ctok, int ctokl, ichar_t * itok, int itokl,
1865 +Global char * do_regex_lookup (char * expr, int whence);
1866 +Global SIGNAL_TYPE done (int);
1867 +Global void dumpmode (void);
1868 +Global void erase (void);
1869 +Global int expand_pre (char * croot, ichar_t * rootword,
1870 + MASKTYPE mask[], int option, char *extra);
1871 +Global int expand_suf (char * croot, ichar_t * rootword,
1872 + MASKTYPE mask[], int crossonly, int option, char * extra);
1873 +Global int findfiletype (char * name, int searchnames,
1874 + int * deformatter);
1875 +Global void flagpr (ichar_t * word, int preflag, int prestrip,
1876 + int preadd, int sufflag, int sufadd);
1877 +Global void givehelp (int interactive);
1878 +Global int good (ichar_t * word, int ignoreflagbits, int allhits,
1879 + int pfxopts, int sfxopts);
1880 +Global int hash (ichar_t * word, int hashtablesize);
1881 +#ifndef ICHAR_IS_CHAR
1882 +Global int icharcmp (ichar_t * s1, ichar_t * s2);
1883 +Global ichar_t * icharcpy (ichar_t * out, ichar_t * in);
1884 +Global int icharlen (ichar_t * str);
1885 +Global int icharncmp (ichar_t * s1, ichar_t * s2, int n);
1886 +#endif /* ICHAR_IS_CHAR */
1887 +Global int ichartostr (char * out, ichar_t * in, int outlen,
1889 +Global char * ichartosstr (ichar_t * in, int canonical);
1890 +Global void inverse (void);
1891 +Global struct dent * lookup (ichar_t * word, int dotree);
1892 +Global void lowcase (ichar_t * string);
1893 +Global int makedent (char * lbuf, int lbuflen, struct dent * d);
1894 +Global void makepossibilities (ichar_t * word);
1895 +Global void move (int row, int col);
1896 +Global void normal (void);
1897 +Global char * printichar (int in);
1899 +Global int shellescape (char * buf);
1900 +Global void shescape (char * buf);
1902 +#ifndef REGEX_LOOKUP
1903 +Global int shellescape (char * buf);
1904 +#endif /* REGEX_LOOKUP */
1906 +Global char * skipoverword (char * bufp);
1907 +Global void stop (void);
1908 +Global int stringcharlen (char * bufp, int canonical);
1909 +Global int strtoichar (ichar_t * out, char * in, int outlen,
1911 +Global ichar_t * strtosichar (char * in, int canonical);
1912 +Global void terminit (void);
1913 +Global void toutent (FILE * outfile, struct dent * hent, int onlykeep);
1914 +Global void treeinit (char * persdict, char * LibDict);
1915 +Global void treeinsert (char * word, int wordlen, int keep);
1916 +Global struct dent * treelookup (ichar_t * word);
1917 +Global void treeoutput (void);
1918 +Global void upcase (ichar_t * string);
1919 +#ifndef NO_CAPITALIZATION_SUPPORT
1920 +Global long whatcap (ichar_t * word);
1922 +Global char * xgets (char * string, int size, FILE * stream);
1923 +Global void yyinit (void);
1924 +Global Logical yyopen (char * file);
1925 +Global int yyparse (void);
1927 +#include <string.h>
1929 +#ifdef REGEX_LOOKUP
1931 +Global char * regcmp (const char * expr, const char * terminator, ...);
1932 +Global char * regex (const char * pat, const char * subject, ...);
1934 +Global char * re_comp (const char * expr);
1935 +Global int * re_exec (const char * pat);
1939 +Global int tgetent (char * buf, const char * termname);
1940 +Global int tgetnum (const char * id);
1941 +Global char * tgetstr (const char * id, char ** area);
1942 +Global char * tgoto (const char * cm, int col, int row);
1943 +Global char * tputs (const char * str, int pad, int (*func) (int ch);
1946 +Global char * mypath_rindex(char const *str, char c);
1947 +Global void save_root_cap (ichar_t * word, ichar_t * pattern,
1948 + int prestrip, int preadd, int sufstrip, int sufadd,
1949 + struct dent * firstdent, struct flagent * pfxent,
1950 + struct flagent * sufent,
1951 + ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN],
1953 +Global int casecmp (char * a, char * b, int canonical);
1954 +Global int ins_root_cap (ichar_t * word, ichar_t * pattern,
1955 + int prestrip, int preadd, int sufstrip, int sufadd,
1956 + struct dent * firstdent, struct flagent * pfxent,
1957 + struct flagent * sufent);
1958 +Global int insert(register ichar_t * word);
1959 +Global char * linit (char *);
1960 +Global char * last_slash (char *file);
1961 diff -urBbN vim64.org/src/spell/ispell.h vim64/src/spell/ispell.h
1962 --- vim64.org/src/spell/ispell.h 1970-01-01 01:00:00.000000000 +0100
1963 +++ vim64/src/spell/ispell.h 2005-10-17 12:49:17.509834848 +0200
1970 + * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
1971 + * All rights reserved.
1973 + * Redistribution and use in source and binary forms, with or without
1974 + * modification, are permitted provided that the following conditions
1977 + * 1. Redistributions of source code must retain the above copyright
1978 + * notice, this list of conditions and the following disclaimer.
1979 + * 2. Redistributions in binary form must reproduce the above copyright
1980 + * notice, this list of conditions and the following disclaimer in the
1981 + * documentation and/or other materials provided with the distribution.
1982 + * 3. All modifications to the source code must be clearly marked as
1983 + * such. Binary redistributions based on modified source code
1984 + * must be clearly marked as modified versions in the documentation
1985 + * and/or other materials provided with the distribution.
1986 + * 4. All advertising materials mentioning features or use of this software
1987 + * must display the following acknowledgment:
1988 + * This product includes software developed by Geoff Kuenning and
1989 + * other unpaid contributors.
1990 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
1991 + * products derived from this software without specific prior
1992 + * written permission.
1994 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
1995 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1996 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1997 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
1998 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1999 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2000 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2001 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2002 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2003 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2009 + * Revision 1.68 1995/03/06 02:42:41 geoff
2010 + * Be vastly more paranoid about parenthesizing macro arguments. This
2011 + * fixes a bug in defmt.c where a complex argument was passed to
2014 + * Revision 1.67 1995/01/03 19:24:12 geoff
2015 + * Get rid of a non-global declaration.
2017 + * Revision 1.66 1994/12/27 23:08:49 geoff
2018 + * Fix a lot of subtly bad assumptions about the widths of ints and longs
2019 + * which only show up on 64-bit machines like the Cray and the DEC Alpha.
2021 + * Revision 1.65 1994/11/02 06:56:10 geoff
2022 + * Remove the anyword feature, which I've decided is a bad idea.
2024 + * Revision 1.64 1994/10/25 05:46:18 geoff
2025 + * Add the FF_ANYWORD flag for defining an affix that will apply to any
2026 + * word, even if not explicitly specified. (Good for French.)
2028 + * Revision 1.63 1994/09/16 04:48:28 geoff
2029 + * Make stringdups and laststringch unsigned ints, and dupnos a plain
2030 + * int, so that we can handle more than 128 stringchars and stringchar
2033 + * Revision 1.62 1994/09/01 06:06:39 geoff
2034 + * Change erasechar/killchar to uerasechar/ukillchar to avoid
2035 + * shared-library problems on HP systems.
2037 + * Revision 1.61 1994/08/31 05:58:35 geoff
2038 + * Add contextoffset, used in -a mode to handle extremely long lines.
2040 + * Revision 1.60 1994/05/17 06:44:15 geoff
2041 + * Add support for controlled compound formation and the COMPOUNDONLY
2042 + * option to affix flags.
2044 + * Revision 1.59 1994/03/15 06:25:16 geoff
2045 + * Change deftflag's initialization so we can tell if -t/-n appeared.
2047 + * Revision 1.58 1994/02/07 05:53:28 geoff
2048 + * Add typecasts to the the 7-bit versions of ichar* routines
2050 + * Revision 1.57 1994/01/25 07:11:48 geoff
2051 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
2056 +#include "config.h"
2059 +#define SET_SIZE 128
2061 +#define SET_SIZE 256
2064 +#define MASKSIZE (MASKBITS / MASKTYPE_WIDTH)
2066 +/* The following is really testing for MASKSIZE <= 1, but cpp can't do that */
2067 +#if MASKBITS <= MASKTYPE_WIDTH
2068 +#define SETMASKBIT(mask, bit) ((mask)[0] |= (MASKTYPE) 1 << (bit))
2069 +#define CLRMASKBIT(mask, bit) ((mask)[0] &= (MASKTYPE) ~(1 << (bit)))
2070 +#define TSTMASKBIT(mask, bit) ((mask)[0] & ((MASKTYPE) 1 << (bit)))
2072 +#define SETMASKBIT(mask, bit) \
2073 + ((mask)[(bit) / MASKTYPE_WIDTH] |= \
2074 + (MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1)))
2075 +#define CLRMASKBIT(mask, bit) \
2076 + ((mask)[(bit) / MASKTYPE_WIDTH] &= \
2077 + ~((MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1))))
2078 +#define TSTMASKBIT(mask, bit) \
2079 + ((mask)[(bit) / MASKTYPE_WIDTH] & \
2080 + ((MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1))))
2084 +#define FULLMASKSET
2089 +#define BITTOCHAR(bit) ((bit) + 'A')
2090 +#define CHARTOBIT(ch) ((ch) - 'A')
2092 +#define LARGESTFLAG 26 /* 5 are needed for flagfield below */
2093 +#define FLAGBASE ((MASKTYPE_WIDTH) - 6)
2095 +# if MASKBITS <= 64
2097 +#define BITTOCHAR(bit) ((bit) + 'A')
2098 +#define CHARTOBIT(ch) ((ch) - 'A')
2100 +#define LARGESTFLAG (64 - 6) /* 5 are needed for flagfield below */
2101 +#define FLAGBASE ((MASKTYPE_WIDTH) - 6)
2104 +#define BITTOCHAR(bit) (bit)
2105 +#define CHARTOBIT(ch) (ch)
2107 +#define LARGESTFLAG MASKBITS /* flagfield is a separate field */
2113 +** Data type for internal word storage. If necessary, we use shorts rather
2114 +** than chars so that string characters can be encoded as a single unit.
2116 +#if (SET_SIZE + MAXSTRINGCHARS) <= 256
2118 +#define ICHAR_IS_CHAR
2122 +#ifdef ICHAR_IS_CHAR
2123 +typedef unsigned char ichar_t; /* Internal character */
2124 +#define icharlen(s) strlen ((char *) (s))
2125 +#define icharcpy(a, b) strcpy ((char *) (a), (char *) (b))
2126 +#define icharcmp(a, b) strcmp ((char *) (a), (char *) (b))
2127 +#define icharncmp(a, b, n) strncmp ((char *) (a), (char *) (b), (n))
2128 +#define chartoichar(x) ((ichar_t) (x))
2130 +typedef unsigned short ichar_t; /* Internal character */
2131 +#define chartoichar(x) ((ichar_t) (unsigned char) (x))
2136 + struct dent * next;
2138 + MASKTYPE mask[MASKSIZE];
2145 +** Flags in the directory entry. If FULLMASKSET is undefined, these are
2146 +** stored in the highest bits of the last longword of the mask field. If
2147 +** FULLMASKSET is defined, they are stored in the extra "flags" field.
2148 +#ifndef NO_CAPITALIZATION_SUPPORT
2150 +** If a word has only one capitalization form, and that form is not
2151 +** FOLLOWCASE, it will have exactly one entry in the dictionary. The
2152 +** legal capitalizations will be indicated by the 2-bit capitalization
2153 +** field, as follows:
2155 +** ALLCAPS The word must appear in all capitals.
2156 +** CAPITALIZED The word must be capitalized (e.g., London).
2157 +** It will also be accepted in all capitals.
2158 +** ANYCASE The word may appear in lowercase, capitalized,
2159 +** or all-capitals.
2161 +** Regardless of the capitalization flags, the "word" field of the entry
2162 +** will point to an all-uppercase copy of the word. This is to simplify
2163 +** the large portion of the code that doesn't care about capitalization.
2164 +** Ispell will generate the correct version when needed.
2166 +** If a word has more than one capitalization, there will be multiple
2167 +** entries for it, linked together by the "next" field. The initial
2168 +** entry for such words will be a dummy entry, primarily for use by code
2169 +** that ignores capitalization. The "word" field of this entry will
2170 +** again point to an all-uppercase copy of the word. The "mask" field
2171 +** will contain the logical OR of the mask fields of all variants.
2172 +** A header entry is indicated by a capitalization type of ALLCAPS,
2173 +** with the MOREVARIANTS bit set.
2175 +** The following entries will define the individual variants. Each
2176 +** entry except the last has the MOREVARIANTS flag set, and each
2177 +** contains one of the following capitalization options:
2179 +** ALLCAPS The word must appear in all capitals.
2180 +** CAPITALIZED The word must be capitalized (e.g., London).
2181 +** It will also be accepted in all capitals.
2182 +** FOLLOWCASE The word must be capitalized exactly like the
2183 +** sample in the entry. Prefix (suffix) characters
2184 +** must be rendered in the case of the first (last)
2185 +** "alphabetic" character. It will also be accepted
2186 +** in all capitals. ("Alphabetic" means "mentioned
2187 +** in a 'casechars' statement".)
2188 +** ANYCASE The word may appear in lowercase, capitalized,
2189 +** or all-capitals.
2191 +** The "mask" field for the entry contains only the affix flag bits that
2192 +** are legal for that capitalization. The "word" field will be null
2193 +** except for FOLLOWCASE entries, where it will point to the
2194 +** correctly-capitalized spelling of the root word.
2196 +** It is worth discussing why the ALLCAPS option is used in
2197 +** the header entry. The header entry accepts an all-capitals
2198 +** version of the root plus every affix (this is always legal, since
2199 +** words get capitalized in headers and so forth). Further, all of
2200 +** the following variant entries will reject any all-capitals form
2201 +** that is illegal due to an affix.
2203 +** Finally, note that variations in the KEEP flag can cause a multiple-variant
2204 +** entry as well. For example, if the personal dictionary contains "ALPHA",
2205 +** (KEEP flag set) and the user adds "alpha" with the KEEP flag clear, a
2206 +** multiple-variant entry will be created so that "alpha" will be accepted
2207 +** but only "ALPHA" will actually be kept.
2211 +#define flagfield flags
2213 +#define flagfield mask[MASKSIZE - 1]
2215 +#define USED ((MASKTYPE) 1 << (FLAGBASE + 0))
2216 +#define KEEP ((MASKTYPE) 1 << (FLAGBASE + 1))
2217 +#ifdef NO_CAPITALIZATION_SUPPORT
2218 +#define ALLFLAGS (USED | KEEP)
2219 +#else /* NO_CAPITALIZATION_SUPPORT */
2220 +#define ANYCASE ((MASKTYPE) 0 << (FLAGBASE + 2))
2221 +#define ALLCAPS ((MASKTYPE) 1 << (FLAGBASE + 2))
2222 +#define CAPITALIZED ((MASKTYPE) 2 << (FLAGBASE + 2))
2223 +#define FOLLOWCASE ((MASKTYPE) 3 << (FLAGBASE + 2))
2224 +#define CAPTYPEMASK ((MASKTYPE) 3 << (FLAGBASE + 2))
2225 +#define MOREVARIANTS ((MASKTYPE) 1 << (FLAGBASE + 4))
2226 +#define ALLFLAGS (USED | KEEP | CAPTYPEMASK | MOREVARIANTS)
2227 +#define captype(x) ((x) & CAPTYPEMASK)
2228 +#endif /* NO_CAPITALIZATION_SUPPORT */
2231 + * Language tables used to encode prefix and suffix information.
2235 + ichar_t * strip; /* String to strip off */
2236 + ichar_t * affix; /* Affix to append */
2237 + short flagbit; /* Flag bit this ent matches */
2238 + short stripl; /* Length of strip */
2239 + short affl; /* Length of affix */
2240 + short numconds; /* Number of char conditions */
2241 + short flagflags; /* Modifiers on this flag */
2242 + char conds[SET_SIZE + MAXSTRINGCHARS]; /* Adj. char conds */
2246 + * Bits in flagflags
2248 +#define FF_CROSSPRODUCT (1 << 0) /* Affix does cross-products */
2249 +#define FF_COMPOUNDONLY (1 << 1) /* Afx works in compounds */
2251 +union ptr_union /* Aid for building flg ptrs */
2253 + struct flagptr * fp; /* Pointer to more indexing */
2254 + struct flagent * ent; /* First of a list of ents */
2259 + union ptr_union pu; /* Ent list or more indexes */
2260 + int numents; /* If zero, pu.fp is valid */
2264 + * Description of a single string character type.
2268 + char * name; /* Name of the type */
2269 + char * deformatter; /* Deformatter to use */
2270 + char * suffixes; /* File suffixes, null seps */
2274 + * Header placed at the beginning of the hash file.
2278 + unsigned short magic; /* Magic number for ID */
2279 + unsigned short compileoptions; /* How we were compiled */
2280 + short maxstringchars; /* Max # strchrs we support */
2281 + short maxstringcharlen; /* Max strchr len supported */
2282 + short compoundmin; /* Min lth of compound parts */
2283 + short compoundbit; /* Flag 4 compounding roots */
2284 + unsigned int stringsize; /* Size of string table */
2285 + int lstringsize; /* Size of lang. str tbl */
2286 + unsigned int tblsize; /* No. entries in hash tbl */
2287 + int stblsize; /* No. entries in sfx tbl */
2288 + int ptblsize; /* No. entries in pfx tbl */
2289 + int sortval; /* Largest sort ID assigned */
2290 + int nstrchars; /* No. strchars defined */
2291 + int nstrchartype; /* No. strchar types */
2292 + int strtypestart; /* Start of strtype table */
2293 + char nrchars[5]; /* Nroff special characters */
2294 + char texchars[13]; /* TeX special characters */
2295 +#define TeXleftparen texchars[0]
2296 +#define TeXrightparen texchars[1]
2297 +#define TeXleftsquare texchars[2]
2298 +#define TeXrightsquare texchars[3]
2299 +#define TeXleftcurly texchars[4]
2300 +#define TeXrightcurly texchars[5]
2301 +#define TeXlefttangle texchars[6]
2302 +#define TeXrighttangle texchars[7]
2303 +#define TeXbackslash texchars[8]
2304 +#define TeXdollar texchars[9]
2305 +#define TeXstar texchars[10]
2306 +#define TeXdot texchars[11]
2307 +#define TeXpercent texchars[12]
2308 + char compoundflag; /* Compund-word handling */
2309 + char defhardflag; /* Default tryveryhard flag */
2310 + char flagmarker; /* "Start-of-flags" char */
2311 + unsigned short sortorder[SET_SIZE + MAXSTRINGCHARS]; /* Sort ordering */
2312 + ichar_t lowerconv[SET_SIZE + MAXSTRINGCHARS]; /* Lower-conversion table */
2313 + ichar_t upperconv[SET_SIZE + MAXSTRINGCHARS]; /* Upper-conversion table */
2314 + char wordchars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for chars found in wrds */
2315 + char upperchars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for uppercase chars */
2316 + char lowerchars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for lowercase chars */
2317 + char boundarychars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for boundary chars */
2318 + char stringstarts[SET_SIZE]; /* NZ if char can start str */
2319 + char stringchars[MAXSTRINGCHARS][MAXSTRINGCHARLEN + 1]; /* String chars */
2320 + unsigned int stringdups[MAXSTRINGCHARS]; /* No. of "base" char */
2321 + int dupnos[MAXSTRINGCHARS]; /* Dup char ID # */
2322 + unsigned short magic2; /* Second magic for dbl chk */
2325 +/* hash table magic number */
2326 +#define SPELL_MAGIC 0x9602
2328 +/* compile options, put in the hash header for consistency checking */
2329 +# define MAGICNOTUSED1 0x01
2330 +# define MAGICNOTUSED2 0x02
2332 +# define MAGICMASKSET 0x00
2334 +# if MASKBITS <= 64
2335 +# define MAGICMASKSET 0x04
2337 +# if MASKBITS <= 128
2338 +# define MAGICMASKSET 0x08
2340 +# define MAGICMASKSET 0x0C
2345 +#define COMPILEOPTIONS (MAGICNOTUSED1 | MAGICNOTUSED2 | MAGICMASKSET)
2348 + * Structure used to record data about successful lookups; these values
2349 + * are used in the ins_root_cap routine to produce correct capitalizations.
2353 + struct dent * dictent; /* Header of dict entry chain for wd */
2354 + struct flagent * prefix; /* Prefix flag used, or NULL */
2355 + struct flagent * suffix; /* Suffix flag used, or NULL */
2359 +** Offsets into the nroff special-character array
2361 +#define NRLEFTPAREN hashheader.nrchars[0]
2362 +#define NRRIGHTPAREN hashheader.nrchars[1]
2363 +#define NRDOT hashheader.nrchars[2]
2364 +#define NRBACKSLASH hashheader.nrchars[3]
2365 +#define NRSTAR hashheader.nrchars[4]
2368 +** Values for compoundflag
2370 +#define COMPOUND_NEVER 0 /* Compound words are never good */
2371 +#define COMPOUND_ANYTIME 1 /* Accept run-together words */
2372 +#define COMPOUND_CONTROLLED 2 /* Compounds controlled by afx flags */
2375 +** The isXXXX macros normally only check ASCII range, and don't support
2376 +** the character sets of other languages. These private versions handle
2377 +** whatever character sets have been defined in the affix files.
2379 +#define myupper(X) (hashheader.upperchars[(X)])
2380 +#define mylower(X) (hashheader.lowerchars[(X)])
2381 +#define myspace(X) (((X) > 0) && ((X) < 0x80) \
2382 + && isspace((unsigned char) (X)))
2383 +#define iswordch(X) (hashheader.wordchars[(X)])
2384 +#define isboundarych(X) (hashheader.boundarychars[(X)])
2385 +#define isstringstart(X) (hashheader.stringstarts[(unsigned char) (X)])
2386 +#define mytolower(X) (hashheader.lowerconv[(X)])
2387 +#define mytoupper(X) (hashheader.upperconv[(X)])
2390 +** These macros are similar to the ones above, but they take into account
2391 +** the possibility of string characters. Note well that they take a POINTER,
2392 +** not a character.
2394 +** The "l_" versions set "len" to the length of the string character as a
2395 +** handy side effect. (Note that the global "laststringch" is also set,
2396 +** and sometimes used, by these macros.)
2398 +** The "l1_" versions go one step further and guarantee that the "len"
2399 +** field is valid for *all* characters, being set to 1 even if the macro
2400 +** returns false. This macro is a great example of how NOT to write
2403 +#define isstringch(ptr, canon) (isstringstart (*(ptr)) \
2404 + && stringcharlen ((ptr), (canon)) > 0)
2405 +#define l_isstringch(ptr, len, canon) \
2406 + (isstringstart (*(ptr)) \
2407 + && (len = stringcharlen ((ptr), (canon))) \
2409 +#define l1_isstringch(ptr, len, canon) \
2411 + isstringstart (*(ptr)) \
2413 + stringcharlen ((ptr), (canon))) \
2415 + ? 1 : (len = 1, 0)))
2418 + * Sizes of buffers returned by ichartosstr/strtosichar.
2420 +#define ICHARTOSSTR_SIZE (INPUTWORDLEN + 4 * MAXAFFIXLEN + 4)
2421 +#define STRTOSICHAR_SIZE ((INPUTWORDLEN + 4 * MAXAFFIXLEN + 4) \
2422 + * sizeof (ichar_t))
2425 + * termcap variables
2428 +# define S_EXTERN /* nothing */
2431 +#define Global extern
2432 +# define S_EXTERN extern
2438 +S_EXTERN char * BC; /* backspace if not ^H */
2439 +S_EXTERN char * cd; /* clear to end of display */
2440 +S_EXTERN char * cl; /* clear display */
2441 +S_EXTERN char * cm; /* cursor movement */
2442 +S_EXTERN char * ho; /* home */
2443 +S_EXTERN char * nd; /* non-destructive space */
2444 +S_EXTERN char * so; /* standout */
2445 +S_EXTERN char * se; /* standout end */
2446 +S_EXTERN int sg; /* space taken by so/se */
2447 +S_EXTERN char * ti; /* terminal initialization sequence */
2448 +S_EXTERN char * te; /* terminal termination sequence */
2449 +S_EXTERN int li; /* lines */
2450 +S_EXTERN int co; /* columns */
2452 +S_EXTERN int contextsize; /* number of lines of context to show */
2453 +S_EXTERN char contextbufs[MAXCONTEXT][BUFSIZ]; /* Context of current line */
2454 +S_EXTERN int contextoffset; /* Offset of line start in contextbufs[0] */
2455 +S_EXTERN char * currentchar; /* Location in contextbufs */
2456 +S_EXTERN char ctoken[INPUTWORDLEN + MAXAFFIXLEN]; /* Current token as char */
2457 +S_EXTERN ichar_t itoken[INPUTWORDLEN + MAXAFFIXLEN]; /* Ctoken as ichar_t str */
2459 +S_EXTERN char termcap[2048]; /* termcap entry */
2460 +S_EXTERN char termstr[2048]; /* for string values */
2461 +S_EXTERN char * termptr; /* pointer into termcap, used by tgetstr */
2463 +S_EXTERN int numhits; /* number of hits in dictionary lookups */
2464 +S_EXTERN struct success
2465 + hits[MAX_HITS]; /* table of hits gotten in lookup */
2467 +S_EXTERN char * hashstrings; /* Strings in hash table */
2468 +S_EXTERN struct hashheader
2469 + hashheader; /* Header of hash table */
2470 +S_EXTERN struct dent *
2471 + hashtbl; /* Main hash table, for dictionary */
2472 +S_EXTERN int hashsize; /* Size of main hash table */
2475 +S_EXTERN int aflag; /* NZ if -a or -A option specified */
2476 +S_EXTERN int cflag; /* NZ if -c (crunch) option */
2477 +S_EXTERN int lflag; /* NZ if -l (list) option */
2478 +S_EXTERN int incfileflag; /* whether xgets() acts exactly like gets() */
2479 +Global Logical nodictflag; /* NZ if dictionary not needed */
2481 +S_EXTERN int uerasechar; /* User's erase character, from stty */
2482 +S_EXTERN int ukillchar; /* User's kill character */
2484 +S_EXTERN unsigned int laststringch; /* Number of last string character */
2485 +S_EXTERN int defdupchar; /* Default duplicate string type */
2487 +S_EXTERN unsigned int numpflags; /* Number of prefix flags in table */
2488 +S_EXTERN unsigned int numsflags; /* Number of suffix flags in table */
2489 +S_EXTERN struct flagptr *pflagindex;
2490 + /* Fast index to pflaglist */
2491 +S_EXTERN struct flagent *pflaglist; /* Prefix flag control list */
2492 +S_EXTERN struct flagptr *sflagindex;
2493 + /* Fast index to sflaglist */
2494 +S_EXTERN struct flagent *sflaglist; /* Suffix flag control list */
2496 +S_EXTERN struct strchartype * /* String character type collection */
2499 +S_EXTERN FILE * infile; /* File being corrected */
2500 +S_EXTERN FILE * outfile; /* Corrected copy of infile */
2502 +S_EXTERN char * askfilename; /* File specified in -f option */
2504 +S_EXTERN int changes; /* NZ if changes made to cur. file */
2505 +S_EXTERN int readonly; /* NZ if current file is readonly */
2506 +S_EXTERN int quit; /* NZ if we're done with this file */
2508 +#define MAXPOSSIBLE 100 /* Max no. of possibilities to generate */
2510 +S_EXTERN char possibilities[MAXPOSSIBLE][INPUTWORDLEN + MAXAFFIXLEN];
2511 + /* Table of possible corrections */
2512 +S_EXTERN int pcount; /* Count of possibilities generated */
2513 +S_EXTERN int maxposslen; /* Length of longest possibility */
2514 +S_EXTERN int easypossibilities; /* Number of "easy" corrections found */
2515 + /* ..(defined as those using legal affixes) */
2517 +Global Logical inited;
2519 + * The following array contains a list of characters that should be tried
2520 + * in "missingletter." Note that lowercase characters are omitted.
2522 +S_EXTERN int Trynum; /* Size of "Try" array */
2523 +S_EXTERN ichar_t Try[SET_SIZE + MAXSTRINGCHARS];
2526 + * Initialized variables. These are generated using macros so that they
2527 + * may be consistently declared in all programs. Numerous examples of
2528 + * usage are given below.
2531 +#define S_INIT(decl, init) decl = init
2533 +#define S_INIT(decl, init) extern decl
2537 +S_INIT (int minimenusize, 2); /* MUST be either 2 or zero */
2538 +#else /* MINIMENU */
2539 +S_INIT (int minimenusize, 0); /* MUST be either 2 or zero */
2540 +#endif /* MINIMENU */
2542 +S_INIT (int eflag, 0); /* NZ for expand mode */
2543 +S_INIT (int dumpflag, 0); /* NZ to do dump mode */
2544 +S_INIT (int fflag, 0); /* NZ if -f specified */
2546 +S_INIT (int sflag, 0); /* NZ to stop self after EOF */
2548 +S_INIT (int vflag, 0); /* NZ to display characters as M-xxx */
2549 +S_INIT (int xflag, DEFNOBACKUPFLAG); /* NZ to suppress backups */
2550 +S_INIT (int deftflag, -1); /* NZ for TeX mode by default */
2551 +S_INIT (int tflag, DEFTEXFLAG); /* NZ for TeX mode in current file */
2552 +S_INIT (int prefstringchar, -1); /* Preferred string character type */
2554 +S_INIT (int terse, 0); /* NZ for "terse" mode */
2556 +S_INIT (char tempfile[MAXPATHLEN], ""); /* Name of file we're spelling into */
2558 +S_INIT (int minword, MINWORD); /* Longest always-legal word */
2559 +S_INIT (int sortit, 1); /* Sort suggestions alphabetically */
2560 +S_INIT (int compoundflag, -1); /* How to treat compounds: see above */
2561 +S_INIT (int tryhardflag, -1); /* Always call tryveryhard */
2563 +S_INIT (char * currentfile, NULL); /* Name of current input file */
2565 +/* Odd numbers for math mode in LaTeX; even for LR or paragraph mode */
2566 +S_INIT (int math_mode, 0);
2567 +/* P -- paragraph or LR mode
2568 + * b -- parsing a \begin statement
2569 + * e -- parsing an \end statement
2570 + * r -- parsing a \ref type of argument.
2571 + * m -- looking for a \begin{minipage} argument.
2573 +S_INIT (char LaTeX_Mode, 'P');
2575 +#include "i_proto.h"
2576 diff -urBbN vim64.org/src/spell/local.h vim64/src/spell/local.h
2577 --- vim64.org/src/spell/local.h 1970-01-01 01:00:00.000000000 +0100
2578 +++ vim64/src/spell/local.h 2005-10-17 12:49:17.510834696 +0200
2581 + * Written by Eli Zaretskii <eliz@is.elta.co.il>
2583 + * This is local.h file suitable for compiling Ispell on MS-DOS systems
2584 + * with version 2.x of DJGPP port of GNU C/C++ compiler.
2592 + * WARNING WARNING WARNING
2594 + * This file is *NOT* a normal C header file! Although it uses C
2595 + * syntax and is included in C programs, it is also processed by shell
2596 + * scripts that are very stupid about format.
2598 + * Do not try to use #if constructs to configure this file for more
2599 + * than one configuration. Do not place whitespace after the "#" in
2600 + * "#define". Do not attempt to disable lines by commenting them out.
2601 + * Do not use backslashes to reduce the length of long lines.
2602 + * None of these things will work the way you expect them to.
2604 + * WARNING WARNING WARNING
2608 +** Things that normally go in a Makefile. Define these just like you
2609 +** might in the Makefile, except you should use #define instead of
2610 +** make's assignment syntax. Everything must be double-quoted, and
2611 +** (unlike make) you can't use any sort of $-syntax to pick up the
2612 +** values of other definitions.
2616 +#define CFLAGS "-O2 -g"
2617 +#define YACC "bison -y"
2620 +** TERMLIB - DJGPP doesn't have one, it uses direct screen writes.
2625 +** Where to install various components of ispell. BINDIR contains
2626 +** binaries. LIBDIR contains hash tables and affix files. ELISPDIR
2627 +** contains emacs lisp files (if any) and TEXINFODIR contains emacs
2628 +** TeXinfo files. MAN1DIR and MAN1EXT will hold the chapter-1 and
2629 +** chapter-4 manual pages, respectively.
2631 +** If you intend to use multiple dictionary files, I would suggest
2632 +** LIBDIR be a directory which will contain nothing else, so sensible
2633 +** names can be constructed for the -d option without conflict.
2635 +#define BINDIR "/usr/bin"
2636 +#define LIBDIR "/usr/lib/ispell"
2637 +#define ELISPDIR "/usr/lib/emacs/site-lisp"
2638 +#define TEXINFODIR "/usr/share/info"
2639 +#define MAN1DIR "/usr/share/man/man1"
2640 +#define MAN4DIR "/usr/share/man/man4"
2643 +** List of all hash files (languages) which will be supported by ispell.
2645 +** This variable has a complex format so that many options can be
2646 +** specified. The format is as follows:
2648 +** <language>[,<make-options>...] [<language> [,<make-options> ...] ...]
2652 +** language is the name of a subdirectory of the
2653 +** "languages" directory
2654 +** make-options are options that are to be passed to "make" in
2655 +** the specified directory. The make-options
2656 +** should not, in general, specify a target, as
2657 +** this will be provided by the make process.
2659 +** For example, if LANGUAGES is:
2661 +** "{american,EXTRADICT=/usr/dict/words /usr/dict/web2} {deutsch}",
2663 +** then the American-English and Deutsch (German) languages will be supported,
2664 +** and when the English dictionary is built, the variable
2665 +** 'EXTRADICT=/usr/dict/words /usr/dict/web2' will be passed to the makefile.
2667 +** Notes on the syntax: The makefile is not very robust. If you have
2668 +** make problems, or if make seems to in the language-subdirs
2669 +** dependency, check your syntax. The makefile adds single quotes to
2670 +** the individual variables in the LANGUAGES specification, so don't
2671 +** use quotes of any kind.
2673 +** In the future, the first language listed in this variable will
2674 +** become the default, and the DEFHASH, DEFLANG, and DEFPAFF,
2675 +** variables will all become obsolete. So be sure to put your default
2676 +** language first, to make later conversion easier!
2678 +** Notes on options for the various languages will be found in the
2679 +** Makefiles for those languages. Some of those languages may require
2680 +** you to also change various limits limits like MASKBITS or the
2681 +** length parameters.
2683 +** A special note on the English language: because the British and
2684 +** American dialects use different spelling, you should usually select
2685 +** one or the other of these. If you select both, the setting of
2686 +** MASTERHASH will determine which becomes the language linked to
2687 +** DEFHASH (which will usually be named english.hash).
2689 +** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2690 +** !!! Note the pathname for the `words' file: it might be different !!!
2691 +** !!! If you don't have this file, make EXTRADICT empty !!!
2692 +** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2694 +#define LANGUAGES "{american,MASTERDICTS=americax.med,HASHFILES=amermedx.hash,EXTRADICT=/usr/lib/ispell/words}"
2697 +** Master hash file for DEFHASH. This is the name of a hash file
2698 +** built by a language Makefile. It should be the most-popular hash
2699 +** file on your system, because it is the one that will be used by
2700 +** default. It must be listed in LANGUAGES, above.
2702 +#define MASTERHASH "polish.hash"
2705 +** Default native-language hash file. This is the name given to the
2706 +** hash table that will be used if no language is specified to
2707 +** ispell. It is a link to MASTERHASH, above.
2709 +#define DEFHASH "polish.hash"
2712 +** If your sort command accepts the -T switch to set temp file
2713 +** locations (try it out; on some systems it exists but is
2714 +** undocumented), make the following variable the null string.
2715 +** Otherwise leave it as the sed script.
2717 +** With DJGPP, you will probably use GNU Sort which accepts -T, so:
2722 +** If your system has the rename(2) system call, define HAS_RENAME and
2723 +** ispell will use that call to rename backup files. Otherwise, it
2724 +** will use link/unlink. There is no harm in this except on MS-DOS,
2725 +** which might not support link/unlink (DJGPP does, but also has rename).
2727 +#define HAS_RENAME 1
2729 +/* environment variable for user's word list */
2731 +#define PDICTVAR "WORDLIST"
2735 +** Prefix part of default private dictionary. Under MS-DOS 8.3
2736 +** filename limitation, we are in trouble...
2738 +#define DEFPDICT ".ispell_"
2740 +/* old place to look for default word list */
2741 +#define OLDPDICT ".isp."
2744 +** mktemp template for temporary file - MUST contain 6 consecutive X's.
2745 +** On MSDOS the directory part of TEMPNAME is only used if neither $TMP
2746 +** nor $TEMP nor $TMPDIR (in that order) are defined. If any of these
2747 +** variables is defined, the filename part of TEMPNAME is appended to
2750 +#define TEMPNAME "/tmp/isXXXXXX"
2753 +** If REGEX_LOOKUP is NOT defined, the lookup command (L) will use the look(1)
2754 +** command (if available) or the egrep command. If REGEX_LOOKUP is defined,
2755 +** the lookup command will use the internal dictionary and the
2756 +** regular-expression library (which you must supply separately.
2757 +** DJGPP v2 has POSIX regexp functions.
2759 +#ifndef FEAT_SPELL_HL
2760 +#define REGEX_LOOKUP 1
2764 +** Choose the proper type of regular-expression routines here. BSD
2765 +** and public-domain systems have routines called re_comp and re_exec;
2766 +** System V uses regcmp and regex.
2768 +#include <sys/types.h>
2770 +#define REGCTYPE regex_t *
2771 +#define REGCMP(re,str) (regcomp (re, str, 0), re)
2772 +#define REGEX(re, str, dummy) \
2773 + (re != 0 && regexec (re, str, 0, 0, 0) == 0 ? (char *)1 : NULL)
2774 +#define REGFREE(re) \
2777 + re = (regex_t *)calloc (1, sizeof (regex_t)); \
2784 +** The 2 following definitions are only meaningfull if you don't use
2785 +** any regex library.
2787 +/* path to egrep (use speeded up version if available);
2788 + defined without explicit path, since there are no
2789 + standard places for programs on MS-DOS. */
2790 +#define EGREPCMD "egrep -i"
2792 +/* path to wordlist for Lookup command (typically /usr/dict/{words|web2}) */
2793 +/* note that /usr/dict/web2 is usually a bad idea due to obscure words */
2797 +** FIXME: The filename truncation below is not flexible enough for DJGPP
2798 +** which can support long filenames on some platforms, since we
2799 +** will only know if the support is available at runtime.
2802 +/* max file name length (will truncate to fit BAKEXT) if not in sys/param.h */
2804 +#define MAXNAMLEN NAME_MAX
2806 +#define MAXNAMLEN 12
2809 +#define MAXEXTLEN 4 /* max. extension length including '.' */
2810 +#define MAXBASENAMELEN 8 /* max. base filename length without ext */
2812 +/* define if you want .bak file names truncated to MAXNAMLEN characters */
2813 +/* On MS-DOS, we really have no choice... */
2814 +#define TRUNCATEBAK 1
2817 +** This is the extension that will be added to backup files.
2818 +** On MS-DOS, it makes sense to use the shortest possible extension.
2823 +** Define the following to suppress the 8-bit character feature.
2824 +** FIXME: does this defeat support of foreign languages?
2826 +/*#define NO8BIT 1 */
2832 +** Define this if you want to use the shell for interpretation of commands
2833 +** issued via the "L" command, "^Z" under System V, and "!". If this is
2834 +** not defined then a direct spawnvp() will be used in place of the
2835 +** normal system(). This may speed up these operations if the SHELL
2836 +** environment variable points to a Unix-like shell (such as `sh' or `bash').
2838 +** However, if you undefine USESH, commands which use pipes, redirection
2839 +** and shell wildcards won't work, and you will need support for the SIGTSTP
2840 +** signal, for the above commands to work at all.
2846 +** Define this if you want to be able to type any command at a "type space
2847 +** to continue" prompt.
2849 +#define COMMANDFORSPACE 1
2852 +** The next three variables are used to provide a variable-size context
2853 +** display at the bottom of the screen. Normally, the user will see
2854 +** a number of lines equal to CONTEXTPCT of his screen, rounded down
2855 +** (thus, with CONTEXTPCT == 10, a 24-line screen will produce two lines
2856 +** of context). The context will never be greater than MAXCONTEXT or
2857 +** less than MINCONTEXT. To disable this feature entirely, set MAXCONTEXT
2858 +** and MINCONTEXT to the same value. To round context percentages up,
2859 +** define CONTEXTROUNDUP.
2861 +** Warning: don't set MAXCONTEXT ridiculously large. There is a
2862 +** static buffer of size MAXCONTEXT*BUFSIZ; since BUFSIZ is frequently
2863 +** 1K or larger, this can create a remarkably large executable.
2865 +#define CONTEXTPCT 20 /* Use 20% of the screen for context */
2866 +#define MINCONTEXT 2 /* Always show at least 2 lines of context */
2867 +#define MAXCONTEXT 10 /* Never show more than 10 lines of context */
2868 +#define CONTEXTROUNDUP 1 /* Round context up */
2871 +** Define this if you want the "mini-menu," which gives the most important
2872 +** options at the bottom of the screen, to be the default (in any case, it
2873 +** can be controlled with the "-M" switch).
2878 +** Redefine GETKEYSTROKE() to whatever appropriate on some MS-DOS systems
2879 +** where getchar() doesn't operate properly in raw mode.
2884 +#define GETKEYSTROKE() getxkey()
2886 +#define GETKEYSTROKE() getchar()
2890 +** We include <fcntl.h> to have the definition of O_BINARY. The
2891 +** configuration script will notice this and define MSDOS_BINARY_OPEN.
2896 +** Environment variable to use to locate the home directory. On DOS
2897 +** systems we set this to ISPELL_HOME to avoid conflicts with
2898 +** other programs that look for a HOME environment variable. We're not on DOS.
2900 +#define HOME "HOME"
2901 +#define PDICTHOME "."
2902 +#define OPTIONVAR "ISPELL_OPTIONS"
2903 +#define LIBRARYVAR "ISPELL_DICTDIR"
2906 +** On MS-DOS systems, we define the following variables so that
2907 +** ispell's files have legal suffixes. Note that these suffixes
2908 +** must agree with the way you've defined dictionary files which
2909 +** incorporate these suffixes.
2911 +** Actually, it is not recommended at all to change the suffixes,
2912 +** since they are hardwired in the Makefile's under languages/
2913 +** subdirectory, and MS-DOS will silently truncate excess letters anyway.
2915 +#define HASHSUFFIX ".hash"
2916 +#define STATSUFFIX ".sta"
2917 +#define COUNTSUFFIX ".cnt"
2918 diff -urBbN vim64.org/src/spell/lookup.c vim64/src/spell/lookup.c
2919 --- vim64.org/src/spell/lookup.c 1970-01-01 01:00:00.000000000 +0100
2920 +++ vim64/src/spell/lookup.c 2005-10-17 12:49:17.511834544 +0200
2923 +static char Rcs_Id[] =
2928 + * lookup.c - see if a word appears in the dictionary
2930 + * Pace Willisson, 1983
2932 + * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
2933 + * All rights reserved.
2935 + * Redistribution and use in source and binary forms, with or without
2936 + * modification, are permitted provided that the following conditions
2939 + * 1. Redistributions of source code must retain the above copyright
2940 + * notice, this list of conditions and the following disclaimer.
2941 + * 2. Redistributions in binary form must reproduce the above copyright
2942 + * notice, this list of conditions and the following disclaimer in the
2943 + * documentation and/or other materials provided with the distribution.
2944 + * 3. All modifications to the source code must be clearly marked as
2945 + * such. Binary redistributions based on modified source code
2946 + * must be clearly marked as modified versions in the documentation
2947 + * and/or other materials provided with the distribution.
2948 + * 4. All advertising materials mentioning features or use of this software
2949 + * must display the following acknowledgment:
2950 + * This product includes software developed by Geoff Kuenning and
2951 + * other unpaid contributors.
2952 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
2953 + * products derived from this software without specific prior
2954 + * written permission.
2956 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
2957 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2958 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2959 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
2960 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2961 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2962 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2963 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2964 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2965 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2971 + * Revision 1.42 1995/01/08 23:23:42 geoff
2972 + * Support MSDOS_BINARY_OPEN when opening the hash file to read it in.
2974 + * Revision 1.41 1994/01/25 07:11:51 geoff
2975 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
2979 +#include "ispell.h"
2981 +#include <stdlib.h>
2988 +Local void dumpindex (struct flagptr * indexp, int depth);
2989 +#endif /* INDEXDUMP */
2991 +Public Logical inited = False;
2996 +linit (char * hashname)
3000 + register struct dent * dp;
3001 + struct flagent * entry;
3002 + struct flagptr * ind;
3005 + register ichar_t * cp;
3010 + if(hashtbl != NULL)
3014 + if(pflagindex != NULL)
3016 + pflagindex = NULL;
3017 + if(sflagindex != NULL)
3019 + sflagindex = NULL;
3020 + if((pflagindex = (struct flagptr *)calloc(SET_SIZE + MAXSTRINGCHARS,
3021 + sizeof(struct flagptr))) == NULL)
3023 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3026 + if((sflagindex = (struct flagptr *)calloc(SET_SIZE + MAXSTRINGCHARS,
3027 + sizeof(struct flagptr))) == NULL)
3029 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3033 + if ((hashfd = open (hashname, 0 | MSDOS_BINARY_OPEN)) < 0)
3035 + (void) sprintf(err_buf, CANT_OPEN, hashname);
3039 + hashsize = read (hashfd, (char *) &hashheader, sizeof hashheader);
3040 + if (hashsize < sizeof hashheader)
3043 + (void) sprintf(err_buf, LOOKUP_C_CANT_READ, hashname);
3044 + else if (hashsize == 0)
3045 + (void) sprintf(err_buf, LOOKUP_C_NULL_HASH, hashname);
3047 + (void) sprintf(err_buf, LOOKUP_C_SHORT_HASH (hashname, hashsize,
3048 + (int) sizeof hashheader));
3049 + (void) close (hashfd);
3052 + else if (hashheader.magic != SPELL_MAGIC)
3054 + (void) sprintf(err_buf,
3055 + LOOKUP_C_BAD_MAGIC (hashname, (unsigned int) SPELL_MAGIC,
3056 + (unsigned int) hashheader.magic));
3057 + (void) close (hashfd);
3060 + else if (hashheader.magic2 != SPELL_MAGIC)
3062 + (void) sprintf(err_buf,
3063 + LOOKUP_C_BAD_MAGIC2 (hashname, (unsigned int) SPELL_MAGIC,
3064 + (unsigned int) hashheader.magic2));
3065 + (void) close (hashfd);
3068 + else if (hashheader.compileoptions != COMPILEOPTIONS
3069 + || hashheader.maxstringchars != MAXSTRINGCHARS
3070 + || hashheader.maxstringcharlen != MAXSTRINGCHARLEN)
3072 + (void) sprintf(err_buf,
3073 + LOOKUP_C_BAD_OPTIONS ((unsigned int) hashheader.compileoptions,
3074 + hashheader.maxstringchars, hashheader.maxstringcharlen,
3075 + (unsigned int) COMPILEOPTIONS, MAXSTRINGCHARS, MAXSTRINGCHARLEN));
3076 + (void) close (hashfd);
3082 + * Dictionary is not needed - create an empty dummy table. We
3083 + * actually have to have one entry since the hash
3084 + * algorithm involves a divide by the table size
3085 + * (actually modulo, but zero is still unacceptable).
3086 + * So we create an empty entry.
3088 + hashsize = 1; /* This prevents divides by zero */
3089 + hashtbl = (struct dent *) calloc (1, sizeof (struct dent));
3090 + if (hashtbl == NULL)
3092 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3093 + (void) close (hashfd);
3096 + hashtbl[0].word = NULL;
3097 + hashtbl[0].next = NULL;
3098 + hashtbl[0].flagfield &= ~(USED | KEEP);
3099 + /* The flag bits don't matter, but calloc cleared them. */
3100 + if(hashstrings != NULL)
3101 + free(hashstrings);
3102 + if((hashstrings = (char *) calloc (1, (unsigned) hashheader.lstringsize))
3105 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3106 + (void) close (hashfd);
3112 + if(hashtbl != NULL)
3114 + if((hashtbl = (struct dent *)
3115 + malloc ((unsigned) hashheader.tblsize * sizeof (struct dent))) == NULL)
3117 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3118 + (void) close (hashfd);
3121 + hashsize = hashheader.tblsize;
3122 + if(hashstrings != NULL)
3123 + free(hashstrings);
3124 + if((hashstrings = (char *) malloc ((unsigned) hashheader.stringsize)) == NULL)
3126 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3127 + (void) close (hashfd);
3131 + numsflags = hashheader.stblsize;
3132 + numpflags = hashheader.ptblsize;
3133 + if(sflaglist != NULL)
3135 + if((sflaglist = (struct flagent *)
3136 + malloc ((numsflags + numpflags) * sizeof (struct flagent))) == NULL)
3138 + (void) sprintf(err_buf, LOOKUP_C_NO_HASH_SPACE);
3139 + (void) close (hashfd);
3142 + pflaglist = sflaglist + numsflags;
3147 + * Read just the strings for the language table, and
3148 + * skip over the rest of the strings and all of the
3151 + if (read (hashfd, hashstrings, (unsigned) hashheader.lstringsize)
3152 + != hashheader.lstringsize)
3154 + (void) sprintf(err_buf, LOOKUP_C_BAD_FORMAT);
3155 + (void) close (hashfd);
3158 + (void) lseek (hashfd,
3159 + (long) hashheader.stringsize - (long) hashheader.lstringsize
3160 + + (long) hashheader.tblsize * (long) sizeof (struct dent), 1);
3164 + if ((unsigned int)read (hashfd, hashstrings,
3165 + (unsigned int) hashheader.stringsize) != hashheader.stringsize
3166 + || (unsigned int)read (hashfd, (char *) hashtbl, (unsigned)
3167 + hashheader.tblsize * sizeof (struct dent))
3168 + != (unsigned int) hashheader.tblsize * sizeof (struct dent))
3170 + (void) sprintf(err_buf, LOOKUP_C_BAD_FORMAT);
3171 + (void) close (hashfd);
3175 + if ((unsigned int)read (hashfd, (char *) sflaglist,
3176 + (unsigned int) (numsflags + numpflags) * sizeof (struct flagent))
3177 + != (unsigned int)(numsflags + numpflags) * sizeof (struct flagent))
3179 + (void) sprintf(err_buf, LOOKUP_C_BAD_FORMAT);
3180 + (void) close (hashfd);
3183 + (void) close (hashfd);
3187 + for (i = hashsize, dp = hashtbl; --i >= 0; dp++)
3189 + if (dp->word == (char *) -1)
3192 + dp->word = &hashstrings [ (int)(dp->word) ];
3193 + if (dp->next == (struct dent *) -1)
3196 + dp->next = &hashtbl [ (int)(dp->next) ];
3200 + for (i = numsflags + numpflags, entry = sflaglist; --i >= 0; entry++)
3202 + if (entry->stripl)
3203 + entry->strip = (ichar_t *) &hashstrings[(int) entry->strip];
3205 + entry->strip = NULL;
3207 + entry->affix = (ichar_t *) &hashstrings[(int) entry->affix];
3209 + entry->affix = NULL;
3212 + ** Warning - 'entry' and 'i' are reset in the body of the loop
3213 + ** below. Don't try to optimize it by (e.g.) moving the decrement
3214 + ** of i into the loop condition.
3216 + for (i = numsflags, entry = sflaglist; i > 0; i--, entry++)
3218 + if (entry->affl == 0)
3221 + ind = &sflagindex[0];
3226 + cp = entry->affix + entry->affl - 1;
3227 + ind = &sflagindex[*cp];
3229 + while (ind->numents == 0 && ind->pu.fp != NULL)
3231 + if (cp == entry->affix)
3233 + ind = &ind->pu.fp[0];
3238 + ind = &ind->pu.fp[*--cp];
3243 + if (ind->numents == 0)
3244 + ind->pu.ent = entry;
3247 + ** If this index entry has more than MAXSEARCH flags in
3248 + ** it, we will split it into subentries to reduce the
3249 + ** searching. However, the split doesn't make sense in
3250 + ** two cases: (a) if we are already at the end of the
3251 + ** current affix, or (b) if all the entries in the list
3252 + ** have identical affixes. Since the list is sorted, (b)
3253 + ** is true if the first and last affixes in the list
3256 + if (!viazero && ind->numents >= MAXSEARCH &&
3257 + icharcmp (entry->affix, ind->pu.ent->affix) != 0)
3259 + /* Sneaky trick: back up and reprocess */
3260 + entry = ind->pu.ent - 1; /* -1 is for entry++ in loop */
3261 + i = numsflags - (entry - sflaglist);
3262 + if((ind->pu.fp = (struct flagptr *)
3263 + calloc ((unsigned) (SET_SIZE + hashheader.nstrchars),
3264 + sizeof (struct flagptr))) == NULL)
3266 + (void) sprintf(err_buf, LOOKUP_C_NO_LANG_SPACE);
3273 + ** Warning - 'entry' and 'i' are reset in the body of the loop
3274 + ** below. Don't try to optimize it by (e.g.) moving the decrement
3275 + ** of i into the loop condition.
3277 + for (i = numpflags, entry = pflaglist; i > 0; i--, entry++)
3279 + if (entry->affl == 0)
3282 + ind = &pflagindex[0];
3287 + cp = entry->affix;
3288 + ind = &pflagindex[*cp++];
3290 + while (ind->numents == 0 && ind->pu.fp != NULL)
3294 + ind = &ind->pu.fp[0];
3299 + ind = &ind->pu.fp[*cp++];
3304 + if (ind->numents == 0)
3305 + ind->pu.ent = entry;
3308 + ** If this index entry has more than MAXSEARCH flags in
3309 + ** it, we will split it into subentries to reduce the
3310 + ** searching. However, the split doesn't make sense in
3311 + ** two cases: (a) if we are already at the end of the
3312 + ** current affix, or (b) if all the entries in the list
3313 + ** have identical affixes. Since the list is sorted, (b)
3314 + ** is true if the first and last affixes in the list
3317 + if (!viazero && ind->numents >= MAXSEARCH
3318 + && icharcmp (entry->affix, ind->pu.ent->affix) != 0)
3320 + /* Sneaky trick: back up and reprocess */
3321 + entry = ind->pu.ent - 1; /* -1 is for entry++ in loop */
3322 + i = numpflags - (entry - pflaglist);
3324 + (struct flagptr *) calloc (SET_SIZE + hashheader.nstrchars,
3325 + sizeof (struct flagptr));
3326 + if (ind->pu.fp == NULL)
3328 + (void) sprintf(err_buf, LOOKUP_C_NO_LANG_SPACE);
3335 + (void) sprintf(err_buf, "Prefix index table:");
3336 + dumpindex (pflagindex, 0);
3337 + (void) sprintf(err_buf, "Suffix index table:");
3338 + dumpindex (sflagindex, 0);
3340 + if (hashheader.nstrchartype == 0)
3344 + chartypes = (struct strchartype *)
3345 + calloc (1, hashheader.nstrchartype * sizeof (struct strchartype));
3346 + if (chartypes == NULL)
3348 + (void) sprintf(err_buf, LOOKUP_C_NO_LANG_SPACE);
3351 + for (i = 0, nextchar = hashheader.strtypestart;
3352 + i < hashheader.nstrchartype; i++)
3354 + chartypes[i].name = &hashstrings[nextchar];
3355 + nextchar += strlen (chartypes[i].name) + 1;
3356 + chartypes[i].deformatter = &hashstrings[nextchar];
3357 + nextchar += strlen (chartypes[i].deformatter) + 1;
3358 + chartypes[i].suffixes = &hashstrings[nextchar];
3359 + while (hashstrings[nextchar] != '\0')
3360 + nextchar += strlen (&hashstrings[nextchar]) + 1;
3371 + register struct flagptr * indexp,
3372 + register int depth)
3377 + char stripbuf[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
3379 + for (i = 0; i < SET_SIZE + hashheader.nstrchars; i++, indexp++)
3381 + if (indexp->numents == 0 && indexp->pu.fp != NULL)
3383 + for (j = depth; --j >= 0; )
3384 + (void) putc (' ', stderr);
3385 + if (i >= ' ' && i <= '~')
3386 + (void) putc (i, stderr);
3388 + (void) fprintf (stderr, "0x%x", i);
3389 + (void) putc ('\n', stderr);
3390 + dumpindex (indexp->pu.fp, depth + 1);
3392 + else if (indexp->numents)
3394 + for (j = depth; --j >= 0; )
3395 + (void) putc (' ', stderr);
3396 + if (i >= ' ' && i <= '~')
3397 + (void) putc (i, stderr);
3399 + (void) fprintf (stderr, "0x%x", i);
3400 + (void) fprintf (stderr, " -> %d entries\n", indexp->numents);
3401 + for (k = 0; k < indexp->numents; k++)
3403 + for (j = depth; --j >= 0; )
3404 + (void) putc (' ', stderr);
3405 + if (indexp->pu.ent[k].stripl)
3407 + (void) ichartostr (stripbuf, indexp->pu.ent[k].strip,
3408 + sizeof stripbuf, 1);
3409 + (void) fprintf (stderr, " entry %d (-%s,%s)\n",
3410 + &indexp->pu.ent[k] - sflaglist,
3412 + indexp->pu.ent[k].affl
3413 + ? ichartosstr (indexp->pu.ent[k].affix, 1) : "-");
3416 + (void) fprintf (stderr, " entry %d (%s)\n",
3417 + &indexp->pu.ent[k] - sflaglist,
3418 + ichartosstr (indexp->pu.ent[k].affix, 1));
3425 +/* n is length of s */
3426 +Public struct dent *
3427 +lookup (register ichar_t *s, int dotree)
3430 + register struct dent * dp;
3431 + register char * s1;
3432 + char schar[INPUTWORDLEN + MAXAFFIXLEN];
3434 + dp = &hashtbl[hash (s, hashsize)];
3435 + if (ichartostr (schar, s, sizeof schar, 1))
3436 + (void) fprintf (stderr, WORD_TOO_LONG (schar));
3437 + for ( ; dp != NULL; dp = dp->next)
3439 + /* quick strcmp, but only for equality */
3441 + if (s1 && s1[0] == schar[0] && strcmp (s1 + 1, schar + 1) == 0)
3443 +#ifndef NO_CAPITALIZATION_SUPPORT
3444 + while (dp->flagfield & MOREVARIANTS) /* Skip variations */
3450 + dp = treelookup (s);
3456 diff -urBbN vim64.org/src/spell/makedent.c vim64/src/spell/makedent.c
3457 --- vim64.org/src/spell/makedent.c 1970-01-01 01:00:00.000000000 +0100
3458 +++ vim64/src/spell/makedent.c 2005-10-17 12:49:17.514834088 +0200
3461 + * Copyright 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
3462 + * All rights reserved.
3464 + * Redistribution and use in source and binary forms, with or without
3465 + * modification, are permitted provided that the following conditions
3468 + * 1. Redistributions of source code must retain the above copyright
3469 + * notice, this list of conditions and the following disclaimer.
3470 + * 2. Redistributions in binary form must reproduce the above copyright
3471 + * notice, this list of conditions and the following disclaimer in the
3472 + * documentation and/or other materials provided with the distribution.
3473 + * 3. All modifications to the source code must be clearly marked as
3474 + * such. Binary redistributions based on modified source code
3475 + * must be clearly marked as modified versions in the documentation
3476 + * and/or other materials provided with the distribution.
3477 + * 4. All advertising materials mentioning features or use of this software
3478 + * must display the following acknowledgment:
3479 + * This product includes software developed by Geoff Kuenning and
3480 + * other unpaid contributors.
3481 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
3482 + * products derived from this software without specific prior
3483 + * written permission.
3485 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
3486 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3487 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3488 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
3489 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3490 + * DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3491 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3492 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3493 + * LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3494 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3500 + * Revision 1.45 1994/12/27 23:08:52 geoff
3501 + * Add code to makedent to reject words that contain non-word characters.
3502 + * This helps protect people who use ISO 8-bit characters when ispell
3503 + * isn't configured for that option.
3505 + * Revision 1.44 1994/10/25 05:46:20 geoff
3506 + * Fix some incorrect declarations in the lint versions of some routines.
3508 + * Revision 1.43 1994/09/16 03:32:34 geoff
3509 + * Issue an error message for bad affix flags
3511 + * Revision 1.42 1994/02/07 04:23:43 geoff
3512 + * Correctly identify the deformatter when changing file types
3514 + * Revision 1.41 1994/01/25 07:11:55 geoff
3515 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
3519 +#include "ispell.h"
3520 +#include <stdlib.h>
3523 +Global int makedent(char * lbuf, int lbuflen, struct dent * ent);
3524 +#ifndef NO_CAPITALIZATION_SUPPORT
3525 +Global long whatcap(ichar_t * word);
3527 +Global int addvheader(struct dent * ent);
3528 +Global int combinecaps(struct dent * hdr, struct dent * newent);
3529 +#ifndef NO_CAPITALIZATION_SUPPORT
3530 +Local void forcevheader(struct dent * hdrp, struct dent * oldp,
3531 + struct dent * newp);
3532 +#endif /* NO_CAPITALIZATION_SUPPORT */
3533 +Local int combine_two_entries(struct dent * hdrp,
3534 + struct dent * oldp, struct dent * newp);
3535 +Local int acoversb(struct dent * enta, struct dent * entb);
3536 +Global void upcase(ichar_t * string);
3537 +Global void lowcase(ichar_t * string);
3538 +Global void chupcase(char * s);
3539 +Local int issubset(struct dent * ent1, struct dent * ent2);
3540 +Local void combineaffixes(struct dent * ent1, struct dent * ent2);
3541 +Global void toutent(FILE * outfile, struct dent * hent, int onlykeep);
3542 +Local void toutword(FILE * outfile, char * word, struct dent * cent);
3543 +Local void flagout(FILE * outfile, int flag);
3544 +Global int stringcharlen(char * bufp, int canonical);
3545 +Global int strtoichar(ichar_t * out, char * in, int outlen,
3547 +Global int ichartostr(char * out, ichar_t * in, int outlen,
3549 +Global ichar_t * strtosichar(char * in, int canonical);
3550 +Global char * ichartosstr(ichar_t * in, int canonical);
3551 +Global char * printichar(int in);
3552 +#ifndef ICHAR_IS_CHAR
3553 +Global ichar_t * icharcpy(ichar_t * out, ichar_t * in);
3554 +Global int icharlen(ichar_t * str);
3555 +Global int icharcmp(ichar_t * s1, ichar_t * s2);
3556 +Global int icharncmp(ichar_t * s1, ichar_t * s2, int n);
3557 +#endif /* ICHAR_IS_CHAR */
3558 +Global int findfiletype(char * name, int searchnames,
3559 + int * deformatter);
3561 +Local Logical has_marker;
3564 + * Fill in a directory entry, including setting the capitalization flags, and
3565 + * allocate and initialize memory for the d->word field. Returns -1
3566 + * if there was trouble. The input word must be in canonical form.
3575 + ichar_t ibuf[INPUTWORDLEN + MAXAFFIXLEN];
3581 + /* Strip off any trailing newline */
3582 + len = strlen(lbuf) - 1;
3583 + if(lbuf[len] == '\n')
3587 + /* WARNING: flagfield might be the same as mask! See ispell.h. */
3589 + (void) bzero ((char *) d->mask, sizeof (d->mask));
3590 + d->flagfield |= USED;
3591 + d->flagfield &= ~KEEP;
3593 + p = index(lbuf, hashheader.flagmarker);
3598 + ** Convert the word to an ichar_t and back; this makes sure that
3599 + ** it is in canonical form and thus that the length is correct.
3601 + if(strtoichar(ibuf, lbuf, INPUTWORDLEN * sizeof (ichar_t), 1)
3602 + || ichartostr(lbuf, ibuf, lbuflen, 1))
3604 + (void) fprintf(stderr, WORD_TOO_LONG (lbuf));
3608 + ** Make sure the word is well-formed(contains only legal characters).
3610 + for(ip = ibuf; *ip != 0; ip++)
3612 + if(!iswordch(*ip))
3614 + /* Boundary characters are legal as long as they're not at edges */
3615 + if(!isboundarych(*ip) || ip == ibuf || ip[1] == 0)
3617 + (void) fprintf(stderr, MAKEDENT_C_BAD_WORD_CHAR, lbuf);
3622 + len = strlen(lbuf);
3623 +#ifndef NO_CAPITALIZATION_SUPPORT
3625 + ** Figure out the capitalization rules from the capitalization of
3626 + ** the sample entry.
3628 + d->flagfield |= whatcap(ibuf);
3631 + if(len > INPUTWORDLEN - 1)
3633 + (void) fprintf(stderr, WORD_TOO_LONG (lbuf));
3637 + d->word = malloc((unsigned) len + 1);
3638 + if(d->word == NULL)
3640 + (void) fprintf(stderr, MAKEDENT_C_NO_WORD_SPACE, lbuf);
3644 + (void) strcpy (d->word, lbuf);
3645 +#ifdef NO_CAPITALIZATION_SUPPORT
3646 + chupcase(d->word);
3647 +#else /* NO_CAPITALIZATION_SUPPORT */
3648 + if(captype(d->flagfield) != FOLLOWCASE)
3649 + chupcase(d->word);
3650 +#endif /* NO_CAPITALIZATION_SUPPORT */
3655 + while(*p != '\0' && *p != '\n')
3657 + bit = CHARTOBIT((unsigned char) *p);
3658 + if(bit >= 0 && bit <= LARGESTFLAG)
3659 + SETMASKBIT(d->mask, bit);
3661 + (void) fprintf (stderr, BAD_FLAG, (unsigned char) *p);
3663 + if(*p == hashheader.flagmarker)
3664 + p++; /* Handle old-format dictionaries too */
3669 +#ifndef NO_CAPITALIZATION_SUPPORT
3671 +** Classify the capitalization of a sample entry. Returns one of the
3672 +** four capitalization codes ANYCASE, ALLCAPS, CAPITALIZED, or FOLLOWCASE.
3676 +whatcap(register ichar_t * word)
3678 + register ichar_t * p;
3680 + for(p = word; *p; p++)
3695 + ** No uppercase letters follow the lowercase ones.
3696 + ** If there is more than one uppercase letter, it's
3697 + ** "followcase". If only the first one is capitalized,
3698 + ** it's "capitalize". If there are no capitals
3699 + ** at all, it's ANYCASE.
3701 + if(myupper(word[0]))
3703 + for(p = word + 1; *p != '\0'; p++)
3705 + return FOLLOWCASE;
3706 + return CAPITALIZED;
3712 + return FOLLOWCASE; /* .../lower/upper */
3717 +** Add a variant-capitalization header to a word. This routine may be
3718 +** called even for a followcase word that doesn't yet have a header.
3720 +** Returns 0 if all was ok, -1 if allocation error.
3723 +addvheader(register struct dent *dp) /* Entry to update */
3725 + register struct dent * tdent; /* Copy of entry */
3728 + ** Add a second entry with the correct capitalization, and then make
3729 + ** dp into a special dummy entry.
3731 + tdent = (struct dent *) malloc (sizeof (struct dent));
3734 + (void) fprintf(stderr, MAKEDENT_C_NO_WORD_SPACE, dp->word);
3738 + if(captype(tdent->flagfield) != FOLLOWCASE)
3739 + tdent->word = NULL;
3742 + /* Followcase words need a copy of the capitalization */
3743 + tdent->word = malloc((unsigned int) strlen (tdent->word) + 1);
3744 + if(tdent->word == NULL)
3746 + (void) fprintf (stderr, MAKEDENT_C_NO_WORD_SPACE, dp->word);
3747 + free((char *) tdent);
3750 + (void) strcpy(tdent->word, dp->word);
3752 + chupcase(dp->word);
3754 + dp->flagfield &= ~CAPTYPEMASK;
3755 + dp->flagfield |= (ALLCAPS | MOREVARIANTS);
3758 +#endif /* NO_CAPITALIZATION_SUPPORT */
3761 +** Combine and resolve the entries describing two capitalizations of the same
3762 +** word. This may require allocating yet more entries.
3764 +** Hdrp is a pointer into a hash table. If the word covered by hdrp has
3765 +** variations, hdrp must point to the header. Newp is a pointer to temporary
3766 +** storage, and space is malloc'ed if newp is to be kept. The newp->word
3767 +** field must have been allocated with mymalloc, so that this routine may free
3768 +** the space if it keeps newp but not the word.
3770 +** Return value: 0 if the word was added, 1 if the word was combined
3771 +** with an existing entry, and -1 if trouble occurred(e.g., malloc).
3772 +** If 1 is returned, newp->word may have been be freed using myfree.
3774 +** Life is made much more difficult by the KEEP flag's possibilities. We
3775 +** must ensure that a !KEEP word doesn't find its way into the personal
3776 +** dictionary as a result of this routine's actions. However, a !KEEP
3777 +** word that has affixes must have come from the main dictionary, so it
3778 +** is acceptable to combine entries in that case(got that?).
3780 +** The net result of all this is a set of rules that is a bloody pain
3781 +** to figure out. Basically, we want to choose one of the following actions:
3783 +** (1) Add newp's affixes and KEEP flag to oldp, and discard newp.
3784 +** (2) Add oldp's affixes and KEEP flag to newp, replace oldp with
3785 +** newp, and discard newp.
3786 +#ifndef NO_CAPITALIZATION_SUPPORT
3787 +** (3) Insert newp as a new entry in the variants list. If there is
3788 +** currently no variant header, this requires adding one. Adding a
3789 +** header splits into two sub-cases:
3791 +** (3a) If oldp is ALLCAPS and the KEEP flags match, just turn it
3792 +** into the header.
3793 +** (3b) Otherwise, add a new entry to serve as the header.
3794 +** To ease list linking, this is done by copying oldp into
3795 +** the new entry, and then performing(3a).
3797 +** After newp has been added as a variant, its affixes and KEEP
3798 +** flag are OR-ed into the variant header.
3801 +** So how to choose which? The default is always case(3), which adds newp
3802 +** as a new entry in the variants list. Cases(1) and (2) are symmetrical
3803 +** except for which entry is discarded. We can use case(1) or (2) whenever
3804 +** one entry "covers" the other. "Covering" is defined as follows:
3806 +** (4) For entries with matching capitalization types, A covers B
3809 +** (4a) B's affix flags are a subset of A's, or the KEEP flags
3811 +** (4b) either the KEEP flags match, or A's KEEP flag is set.
3812 +** (Since A has more suffixes, combining B with it won't
3813 +** cause any extra suffixes to be added to the dictionary.)
3814 +** (4c) If the words are FOLLOWCASE, the capitalizations match
3817 +#ifndef NO_CAPITALIZATION_SUPPORT
3818 +** (5) For entries with mismatched capitalization types, A covers B
3819 +** if(4a) and(4b) are true, and:
3821 +** (5a) B is ALLCAPS, or
3822 +** (5b) A is ANYCASE, and B is CAPITALIZED.
3825 +** For any "hdrp" without variants, oldp is the same as hdrp. Otherwise,
3826 +** the above tests are applied using each variant in turn for oldp.
3830 + struct dent * hdrp, /* Header of entry currently in dictionary */
3831 + register struct dent * newp) /* Entry to add */
3833 + register struct dent *
3834 + oldp; /* Current "oldp" entry */
3835 +#ifndef NO_CAPITALIZATION_SUPPORT
3836 + register struct dent *
3837 + tdent; /* Entry we'll add to the dictionary */
3838 +#endif /* NO_CAPITALIZATION_SUPPORT */
3839 + register int retval = 0; /* Return value from combine_two_entries */
3842 + ** First, see if we can combine the two entries(cases 1 and 2). If
3843 + ** combine_two_entries does so, it will return 1. If it has trouble,
3844 + ** it will return zero.
3847 +#ifdef NO_CAPITALIZATION_SUPPORT
3848 + retval = combine_two_entries(hdrp, oldp, newp);
3849 +#else /* NO_CAPITALIZATION_SUPPORT */
3850 + if((oldp->flagfield &(CAPTYPEMASK | MOREVARIANTS))
3851 + == (ALLCAPS | MOREVARIANTS))
3853 + while(oldp->flagfield & MOREVARIANTS)
3855 + oldp = oldp->next;
3856 + retval = combine_two_entries(hdrp, oldp, newp);
3857 + if(retval != 0) /* Did we combine them? */
3862 + retval = combine_two_entries(hdrp, oldp, newp);
3866 + ** Couldn't combine the two entries. Add a new variant. For
3867 + ** ease, we'll stick it right behind the header, rather than
3868 + ** at the end of the list.
3870 + forcevheader(hdrp, oldp, newp);
3871 + tdent = (struct dent *) malloc (sizeof (struct dent));
3874 + (void) fprintf (stderr, MAKEDENT_C_NO_WORD_SPACE, newp->word);
3878 + tdent->next = hdrp->next;
3879 + hdrp->next = tdent;
3880 + tdent->flagfield |= (hdrp->flagfield & MOREVARIANTS);
3881 + hdrp->flagfield |= MOREVARIANTS;
3882 + combineaffixes(hdrp, newp);
3883 + hdrp->flagfield |= (newp->flagfield & KEEP);
3884 + if(captype(newp->flagfield) == FOLLOWCASE)
3885 + tdent->word = newp->word;
3888 + tdent->word = NULL;
3889 + free(newp->word); /* newp->word isn't needed */
3892 +#endif /* NO_CAPITALIZATION_SUPPORT */
3896 +#ifndef NO_CAPITALIZATION_SUPPORT
3898 +** The following routine implements steps 3a and 3b in the commentary
3899 +** for "combinecaps".
3903 + register struct dent * hdrp,
3904 + struct dent * oldp,
3905 + struct dent * newp)
3908 + if((hdrp->flagfield &(CAPTYPEMASK | MOREVARIANTS)) == ALLCAPS
3909 + && ((oldp->flagfield ^ newp->flagfield) & KEEP) == 0)
3910 + return; /* Caller will set MOREVARIANTS */
3911 + else if((hdrp->flagfield &(CAPTYPEMASK | MOREVARIANTS))
3912 + != (ALLCAPS | MOREVARIANTS))
3913 + (void) addvheader(hdrp);
3915 +#endif /* NO_CAPITALIZATION_SUPPORT */
3918 +** This routine implements steps 4 and 5 of the commentary for "combinecaps".
3920 +** Returns 1 if newp can be discarded, 0 if nothing done.
3923 +combine_two_entries(
3924 + struct dent *hdrp, /*(Possible) header of variant chain */
3925 + register struct dent *oldp, /* Pre-existing dictionary entry */
3926 + register struct dent *newp) /* Entry to possibly combine */
3929 + if(acoversb(oldp, newp))
3931 + /* newp is superfluous. Drop it, preserving affixes and keep flag */
3932 + combineaffixes(oldp, newp);
3933 + oldp->flagfield |= (newp->flagfield & KEEP);
3934 + hdrp->flagfield |= (newp->flagfield & KEEP);
3938 + else if(acoversb(newp, oldp))
3941 + ** oldp is superfluous. Replace it with newp, preserving affixes and
3944 + combineaffixes(newp, oldp);
3945 +#ifdef NO_CAPITALIZATION_SUPPORT
3946 + newp->flagfield |= (oldp->flagfield & KEEP);
3947 +#else /* NO_CAPITALIZATION_SUPPORT */
3948 + newp->flagfield |= (oldp->flagfield & (KEEP | MOREVARIANTS));
3949 +#endif /* NO_CAPITALIZATION_SUPPORT */
3950 + hdrp->flagfield |= (newp->flagfield & KEEP);
3951 + newp->next = oldp->next;
3953 + ** We really want to free oldp->word, but that might be part of
3954 + ** "hashstrings". So we'll futz around to arrange things so we can
3955 + ** free newp->word instead. This depends very much on the fact
3956 + ** that both words are the same length.
3958 + if(oldp->word != NULL)
3959 + (void) strcpy (oldp->word, newp->word);
3960 + free(newp->word); /* No longer needed */
3961 + newp->word = oldp->word;
3963 +#ifndef NO_CAPITALIZATION_SUPPORT
3964 + /* We may need to add a header if newp is followcase */
3965 + if(captype(newp->flagfield) == FOLLOWCASE
3966 + && (hdrp->flagfield & (CAPTYPEMASK | MOREVARIANTS))
3967 + != (ALLCAPS | MOREVARIANTS))
3968 + (void) addvheader (hdrp);
3969 +#endif /* NO_CAPITALIZATION_SUPPORT */
3977 +** Determine if enta covers entb, according to the rules in steps 4 and 5
3978 +** of the commentary for "combinecaps".
3982 + register struct dent * enta, /* "A" in the rules */
3983 + register struct dent * entb) /* "B" in the rules */
3985 + int subset; /* NZ if entb is a subset of enta */
3987 + if((subset = issubset(entb, enta)) != 0)
3989 + /* entb is a subset of enta; thus enta might cover entb */
3990 + if(((enta->flagfield ^ entb->flagfield) & KEEP) != 0
3991 + && (enta->flagfield & KEEP) == 0) /* Inverse of condition (4b) */
3996 + /* not a subset; KEEP flags must match exactly(both (4a) and (4b)) */
3997 + if(((enta->flagfield ^ entb->flagfield) & KEEP) != 0)
4001 + /* Rules(4a) and (4b) are satisfied; check for capitalization match */
4002 +#ifdef NO_CAPITALIZATION_SUPPORT
4004 + return subset; /* Just so it gets used */
4006 + return 1; /* All words match */
4008 +#else /* NO_CAPITALIZATION_SUPPORT */
4009 + if(((enta->flagfield ^ entb->flagfield) & CAPTYPEMASK) == 0)
4011 + if(captype(enta->flagfield) != FOLLOWCASE /* Condition (4c) */
4012 + || strcmp(enta->word, entb->word) == 0)
4013 + return 1; /* Perfect match */
4017 + else if(subset == 0) /* No flag subset, refuse */
4018 + return 0; /* ..near matches */
4019 + else if(captype(entb->flagfield) == ALLCAPS)
4021 + else if(captype(enta->flagfield) == ANYCASE
4022 + && captype(entb->flagfield) == CAPITALIZED)
4026 +#endif /* NO_CAPITALIZATION_SUPPORT */
4030 +upcase(register ichar_t * s)
4035 + *s = mytoupper(*s);
4041 +lowcase(register ichar_t * s)
4046 + *s = mytolower(*s);
4052 + * Upcase variant that works on normal strings. Note that it is a lot
4053 + * slower than the normal upcase. The input must be in canonical form.
4060 + is = strtosichar(s, 1);
4062 + (void) ichartostr (s, is, strlen (s) + 1, 1);
4066 +** See if one affix field is a subset of another. Returns NZ if ent1
4067 +** is a subset of ent2. The KEEP flag is not taken into consideration.
4071 + register struct dent * ent1,
4072 + register struct dent * ent2)
4074 +/* The following is really testing for MASKSIZE > 1, but cpp can't do that */
4076 + register int flagword;
4079 +#define MASKMAX MASKSIZE
4081 +#define MASKMAX MASKSIZE - 1
4082 +#endif /* FULLMASKSET */
4083 + for(flagword = MASKMAX; --flagword >= 0; )
4085 + if((ent1->mask[flagword] & ent2->mask[flagword])
4086 + != ent1->mask[flagword])
4089 +#endif /* MASKBITS > 32 */
4091 + return((ent1->mask[MASKSIZE - 1] & ent2->mask[MASKSIZE - 1])
4092 + == ent1->mask[MASKSIZE - 1]);
4094 + if(((ent1->mask[MASKSIZE - 1] & ent2->mask[MASKSIZE - 1])
4095 + ^ ent1->mask[MASKSIZE - 1]) & ~ALLFLAGS)
4099 +#endif /* FULLMASKSET */
4103 +** Add ent2's affix flags to ent1.
4107 + register struct dent * ent1,
4108 + register struct dent * ent2)
4110 +/* The following is really testing for MASKSIZE > 1, but cpp can't do that */
4112 + register int flagword;
4116 + /* MASKMAX is defined in issubset, just above */
4117 + for(flagword = MASKMAX; --flagword >= 0; )
4118 + ent1->mask[flagword] |= ent2->mask[flagword];
4119 +#endif /* MASKBITS > 32 */
4120 +#ifndef FULLMASKSET
4121 + ent1->mask[MASKSIZE - 1] |= ent2->mask[MASKSIZE - 1] & ~ALLFLAGS;
4126 +** Write out a dictionary entry, including capitalization variants.
4127 +** If onlykeep is true, only those variants with KEEP set will be
4132 + register FILE * toutfile,
4133 + struct dent * hent,
4134 + register int onlykeep)
4136 +#ifdef NO_CAPITALIZATION_SUPPORT
4137 + if(!onlykeep || (hent->flagfield & KEEP))
4138 + toutword(toutfile, hent->word, hent);
4140 + register struct dent * cent;
4141 + ichar_t wbuf[INPUTWORDLEN + MAXAFFIXLEN];
4144 + if(strtoichar(wbuf, cent->word, INPUTWORDLEN, 1))
4145 + (void) fprintf(stderr, WORD_TOO_LONG (cent->word));
4148 + if(!onlykeep || (cent->flagfield & KEEP))
4150 + switch(captype (cent->flagfield))
4154 + toutword(toutfile, ichartosstr (wbuf, 1), cent);
4157 + if((cent->flagfield & MOREVARIANTS) == 0 || cent != hent)
4160 + toutword(toutfile, ichartosstr (wbuf, 1), cent);
4165 + wbuf[0] = mytoupper(wbuf[0]);
4166 + toutword(toutfile, ichartosstr (wbuf, 1), cent);
4169 + toutword(toutfile, cent->word, cent);
4173 + if(cent->flagfield & MOREVARIANTS)
4174 + cent = cent->next;
4183 + register FILE * toutfile,
4185 + register struct dent * cent)
4189 + has_marker = False;
4190 + (void) fprintf (toutfile, "%s", word);
4191 + for(bit = 0; bit < LARGESTFLAG; bit++)
4193 + if(TSTMASKBIT(cent->mask, bit))
4194 + flagout(toutfile, BITTOCHAR (bit));
4196 + (void) fprintf (toutfile, "\n");
4201 + register FILE * toutfile,
4205 + (void) putc(hashheader.flagmarker, toutfile);
4206 + has_marker = True;
4207 + (void) putc (flag, toutfile);
4211 + * If the string under the given pointer begins with a string character,
4212 + * return the length of that "character". If not, return 0.
4213 + * May be called any time, but it's best if "isstrstart" is first
4214 + * used to filter out unnecessary calls.
4216 + * As a side effect, "laststringch" is set to the number of the string
4217 + * found, or to -1 if none was found. This can be useful for such things
4218 + * as case conversion.
4223 + int canonical) /* NZ if input is in canonical form */
4225 +#ifdef SLOWMULTIPLY
4226 + static char * sp[MAXSTRINGCHARS];
4227 + static int m_inited = 0;
4228 +#endif /* SLOWMULTIPLY */
4229 + register char * bufcur;
4230 + register char * stringcur;
4231 + register int stringno;
4232 + register int lowstringno;
4233 + register int highstringno;
4236 +#ifdef SLOWMULTIPLY
4240 + for(stringno = 0; stringno < MAXSTRINGCHARS; stringno++)
4241 + sp[stringno] = &hashheader.stringchars[stringno][0];
4243 +#endif /* SLOWMULTIPLY */
4245 + highstringno = hashheader.nstrchars - 1;
4246 + dupwanted = canonical ? 0 : defdupchar;
4247 + while(lowstringno <= highstringno)
4249 + stringno = (lowstringno + highstringno) >> 1;
4250 +#ifdef SLOWMULTIPLY
4251 + stringcur = sp[stringno];
4252 +#else /* SLOWMULTIPLY */
4253 + stringcur = &hashheader.stringchars[stringno][0];
4254 +#endif /* SLOWMULTIPLY */
4259 + if(((*bufcur++ ^ *stringcur) & 0x7F) != 0)
4261 + if(*bufcur++ != *stringcur)
4262 +#endif /* NO8BIT */
4265 + ** We can't use autoincrement above because of the
4270 + if(*stringcur == '\0')
4272 + if(hashheader.dupnos[stringno] == dupwanted)
4274 + /* We have a match */
4275 + laststringch = hashheader.stringdups[stringno];
4276 +#ifdef SLOWMULTIPLY
4277 + return stringcur - sp[stringno];
4278 +#else /* SLOWMULTIPLY */
4279 + return stringcur - &hashheader.stringchars[stringno][0];
4280 +#endif /* SLOWMULTIPLY */
4285 + /* No match - choose which side to search on */
4287 + if((*--bufcur & 0x7F) <(*stringcur & 0x7F))
4288 + highstringno = stringno - 1;
4289 + else if((*bufcur & 0x7F) >(*stringcur & 0x7F))
4290 + lowstringno = stringno + 1;
4292 + if(*--bufcur < *stringcur)
4293 + highstringno = stringno - 1;
4294 + else if(*bufcur > *stringcur)
4295 + lowstringno = stringno + 1;
4296 +#endif /* NO8BIT */
4297 + else if(dupwanted < hashheader.dupnos[stringno])
4298 + highstringno = stringno - 1;
4300 + lowstringno = stringno + 1;
4302 + laststringch = -1;
4303 + return 0; /* Not a string character */
4307 + * Convert an external string to an ichar_t string. If necessary, the parity
4308 + * bit is stripped off as part of the process.
4310 + * Returns NZ if the output string overflowed.
4314 + register ichar_t * out, /* Where to put result */
4315 + register char * in, /* String to convert */
4316 + int outlen, /* Size of output buffer, *BYTES* */
4317 + int canonical) /* NZ if input is in canonical form */
4319 + register int len; /* Length of next character */
4321 + outlen /= sizeof(ichar_t); /* Convert to an ichar_t count */
4322 + for( ; --outlen > 0 && *in != '\0'; in += len)
4324 + if(l1_isstringch(in, len, canonical))
4325 + *out++ = SET_SIZE + laststringch;
4327 + *out++ = *in & S_NOPARITY;
4330 + return outlen <= 0;
4334 + * Convert an ichar_t string to an external string.
4336 + * WARNING: the resulting string may wind up being longer than the
4337 + * original. In fact, even the sequence strtoichar->ichartostr may
4338 + * produce a result longer than the original, because the output form
4339 + * may use a different string type set than the original input form.
4341 + * Returns NZ if the output string overflowed.
4345 + register char * out, /* Where to put result */
4346 + register ichar_t * in, /* String to convert */
4347 + int outlen, /* Size of output buffer, bytes */
4348 + int canonical) /* NZ for canonical form */
4350 + register unsigned int ch; /* Next character to store */
4351 + register unsigned int i; /* Index into duplicates list */
4352 + register char * scharp; /* Pointer into a string char */
4354 + while(--outlen > 0 && (ch = *in++) != 0)
4357 + *out++ = (char) ch;
4363 + for(i = hashheader.nstrchars; --i >= 0; )
4365 + if(hashheader.dupnos[i] == defdupchar
4366 + && hashheader.stringdups[i] == ch)
4373 + scharp = hashheader.stringchars[(unsigned) ch];
4374 + while((*out++ = *scharp++) != '\0')
4380 + return outlen <= 0;
4384 + * Convert a string to an ichar_t, storing the result in a static area.
4388 + char * in, /* String to convert */
4389 + int canonical) /* NZ if input is in canonical form */
4391 + static ichar_t out[STRTOSICHAR_SIZE / sizeof(ichar_t)];
4393 + if(strtoichar(out, in, sizeof out, canonical))
4394 + (void) fprintf(stderr, WORD_TOO_LONG (in));
4399 + * Convert an ichar_t to a string, storing the result in a static area.
4403 + ichar_t * in, /* Internal string to convert */
4404 + int canonical) /* NZ for canonical conversion */
4406 + static char out[ICHARTOSSTR_SIZE];
4408 + if(ichartostr(out, in, sizeof out, canonical))
4409 + (void) fprintf(stderr, WORD_TOO_LONG (out));
4414 + * Convert a single ichar to a printable string, storing the result in
4420 + static char out[MAXSTRINGCHARLEN + 1];
4424 + out[0] = (char) in;
4428 + (void) strcpy(out, hashheader.stringchars[(unsigned) in - SET_SIZE]);
4432 +#ifndef ICHAR_IS_CHAR
4434 + * Copy an ichar_t.
4438 + register ichar_t * out, /* Destination */
4439 + register ichar_t * in) /* Source */
4441 + ichar_t * origout; /* Copy of destination for return */
4444 + while((*out++ = *in++) != 0)
4450 + * Return the length of an ichar_t.
4453 +icharlen(register ichar_t * in) /* String to count */
4455 + register int len; /* Length so far */
4457 + for(len = 0; *in++ != 0; len++)
4463 + * Compare two ichar_t's.
4467 + register ichar_t * s1,
4468 + register ichar_t * s2)
4473 + if(*s1++ != *s2++)
4474 + return *--s1 - *--s2;
4480 + * Strncmp for two ichar_t's.
4484 + register ichar_t * s1,
4485 + register ichar_t * s2,
4489 + while(--n >= 0 && *s1 != 0)
4491 + if(*s1++ != *s2++)
4492 + return *--s1 - *--s2;
4500 +#endif /* ICHAR_IS_CHAR */
4504 + char * name, /* Name to look up in suffix table */
4505 + int searchnames, /* NZ to search name field of table */
4506 + int * deformatter) /* Where to set deformatter type */
4508 + char * cp; /* Pointer into suffix list */
4509 + int cplen; /* Length of current suffix */
4510 + register int i; /* Index into type table */
4511 + int len; /* Length of the name */
4514 + * Note: for now, the deformatter is set to 1 for tex, 0 for nroff.
4515 + * Further, we assume that it's one or the other, so that a test
4516 + * for tex is sufficient. This needs to be generalized.
4518 + len = strlen(name);
4521 + for(i = 0; i < hashheader.nstrchartype; i++)
4523 + if(strcmp(name, chartypes[i].name) == 0)
4525 + if(deformatter != NULL)
4527 + (strcmp (chartypes[i].deformatter, "tex") == 0);
4532 + for(i = 0; i < hashheader.nstrchartype; i++)
4534 + for(cp = chartypes[i].suffixes; *cp != '\0'; cp += cplen + 1)
4536 + cplen = strlen(cp);
4537 + if(len >= cplen && strcmp(&name[len - cplen], cp) == 0)
4539 + if(deformatter != NULL)
4541 + (strcmp (chartypes[i].deformatter, "tex") == 0);
4550 +mypath_rindex(char const *str, char c)
4554 + x = (char *)str + strlen(str);
4558 + if(*x == '\\' || *x == '/' || *x == ':')
4567 diff -urBbN vim64.org/src/spell/msgs.h vim64/src/spell/msgs.h
4568 --- vim64.org/src/spell/msgs.h 1970-01-01 01:00:00.000000000 +0100
4569 +++ vim64/src/spell/msgs.h 2005-10-17 12:49:17.515833936 +0200
4574 + * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
4575 + * All rights reserved.
4577 + * Redistribution and use in source and binary forms, with or without
4578 + * modification, are permitted provided that the following conditions
4581 + * 1. Redistributions of source code must retain the above copyright
4582 + * notice, this list of conditions and the following disclaimer.
4583 + * 2. Redistributions in binary form must reproduce the above copyright
4584 + * notice, this list of conditions and the following disclaimer in the
4585 + * documentation and/or other materials provided with the distribution.
4586 + * 3. All modifications to the source code must be clearly marked as
4587 + * such. Binary redistributions based on modified source code
4588 + * must be clearly marked as modified versions in the documentation
4589 + * and/or other materials provided with the distribution.
4590 + * 4. All advertising materials mentioning features or use of this software
4591 + * must display the following acknowledgment:
4592 + * This product includes software developed by Geoff Kuenning and
4593 + * other unpaid contributors.
4594 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
4595 + * products derived from this software without specific prior
4596 + * written permission.
4598 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
4599 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4600 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4601 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
4602 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4603 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4604 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4605 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
4606 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
4607 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4613 + * Messages header file.
4615 + * This file contains all text strings that are written by any of the
4616 + * C programs in the ispell package. The strings are collected here so that
4617 + * you can have the option of translating them into your local language for
4618 + * the benefit of your users.
4620 + * Anyone who goes to the effort of making a translation may wish to return
4621 + * the translated strings to me, geoff@ITcorp.com, so that I can include
4622 + * them in a later distribution under #ifdef control.
4624 + * Besides the strings in this header file, you may also want to translate
4625 + * the strings in version.h, which give the version and copyright information.
4626 + * However, any translation of these strings MUST accurately preserve the
4627 + * legal rights under international law; you may wish to consult a lawyer
4628 + * about this since you will be responsible for the results of any
4629 + * incorrect translation.
4631 + * Most of the strings below are simple printf format strings. If the printf
4632 + * takes more than one parameter, the string is given as a parameterized
4633 + * macro in case your local language needs a different word order.
4638 + * Revision 1.31 1994/12/27 23:08:57 geoff
4639 + * Add a message to be issued if a word contains illegal characters.
4641 + * Revision 1.30 1994/10/25 05:46:40 geoff
4642 + * Improve a couple of error messages relating to affix flags.
4644 + * Revision 1.29 1994/10/04 03:46:23 geoff
4645 + * Add a missing carriage return in the help message
4647 + * Revision 1.28 1994/09/16 05:07:00 geoff
4648 + * Add the BAD_FLAG message, and start a sentence in another message with
4649 + * an uppercase letter.
4651 + * Revision 1.27 1994/07/28 05:11:38 geoff
4652 + * Log message for previous revision: add BHASH_C_ZERO_COUNT.
4654 + * Revision 1.26 1994/07/28 04:53:49 geoff
4656 + * Revision 1.25 1994/05/24 04:54:36 geoff
4657 + * Add error messages for affix-flag checking.
4659 + * Revision 1.24 1994/01/25 07:12:42 geoff
4660 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
4665 + * The following strings are used in numerous places:
4667 +#define BAD_FLAG "\nIllegal affix flag character '%c'\n"
4668 +#define CANT_OPEN "Can't open %s"
4669 +#define CANT_CREATE "Can't create %s\n"
4670 +#define WORD_TOO_LONG(w) "\nWord '%s' too long at line %d of %s, truncated\n", \
4671 + w, __LINE__, __FILE__
4674 + * The following strings are used in buildhash.c:
4676 +#define BHASH_C_NO_DICT "No dictionary (%s)\n"
4677 +#define BHASH_C_NO_COUNT "No count file\n"
4678 +#define BHASH_C_BAD_COUNT "Bad count file\n"
4679 +#define BHASH_C_ZERO_COUNT "No words in dictionary\n"
4680 + /* I think this message looks better when it's nearly 80 characters wide,
4681 + * thus the ugly formatting in the next two defines. GK 9-87 */
4682 +#define BHASH_C_BAFF_1(max, excess) \
4683 + " 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", \
4685 +#define BHASH_C_BAFF_2 \
4686 + "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"
4687 +#define BHASH_C_OVERFLOW "Hash table overflowed by %d words\n"
4688 +#define BHASH_C_CANT_OPEN_DICT "Can't open dictionary\n"
4689 +#define BHASH_C_NO_SPACE "Couldn't allocate hash table\n"
4690 +#define BHASH_C_COLLISION_SPACE "\ncouldn't allocate space for collision\n"
4691 +#define BHASH_C_COUNTING "Counting words in dictionary ...\n"
4692 +#define BHASH_C_WORD_COUNT "\n%d words\n"
4693 +#define BHASH_C_USAGE "Usage: buildhash [-s] dict-file aff-file hash-file\n\tbuildhash -c count aff-file\n"
4696 + * The following strings are used in correct.c:
4698 +#define CORR_C_HELP_1 "Whenever a word is found that is not in the dictionary,\n"
4699 +#define CORR_C_HELP_2 "it is printed on the first line of the screen. If the dictionary\n"
4700 +#define CORR_C_HELP_3 "contains any similar words, they are listed with a number\n"
4701 +#define CORR_C_HELP_4 "next to each one. You have the option of replacing the word\n"
4702 +#define CORR_C_HELP_5 "completely, or choosing one of the suggested words.\n"
4703 + /* You may add HELP_6 through HELP_9 if your language needs more lines */
4704 +#define CORR_C_HELP_6 ""
4705 +#define CORR_C_HELP_7 ""
4706 +#define CORR_C_HELP_8 ""
4707 +#define CORR_C_HELP_9 ""
4708 +#define CORR_C_HELP_COMMANDS "\nCommands are:\n\n"
4709 +#define CORR_C_HELP_R_CMD "R Replace the misspelled word completely.\n"
4710 +#define CORR_C_HELP_BLANK "Space Accept the word this time only.\n"
4711 +#define CORR_C_HELP_A_CMD "A Accept the word for the rest of this session.\n"
4712 +#define CORR_C_HELP_I_CMD "I Accept the word, and put it in your private dictionary.\n"
4713 +#define CORR_C_HELP_U_CMD "U Accept and add lowercase version to private dictionary.\n"
4714 +#define CORR_C_HELP_0_CMD "0-n Replace with one of the suggested words.\n"
4715 +#define CORR_C_HELP_L_CMD "L Look up words in system dictionary.\n"
4716 +#define CORR_C_HELP_X_CMD "X Write the rest of this file, ignoring misspellings,\n and start next file.\n"
4717 +#define CORR_C_HELP_Q_CMD "Q Quit immediately. Asks for confirmation.\n Leaves file unchanged.\n"
4718 +#define CORR_C_HELP_BANG "! Shell escape.\n"
4719 +#define CORR_C_HELP_REDRAW "^L Redraw screen.\n"
4720 +#define CORR_C_HELP_SUSPEND "^Z Suspend program.\n"
4721 +#define CORR_C_HELP_HELP "? Show this help screen.\n"
4722 +#define CORR_C_HELP_TYPE_SPACE "-- Type space to continue --"
4724 +#define CORR_C_FILE_LABEL " File: %s"
4725 +#define CORR_C_READONLY "[READONLY]"
4726 +#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"
4727 +#define CORR_C_CONFIRM_QUIT "Are you sure you want to throw away your changes? "
4728 +#define CORR_C_REPLACE_WITH "Replace with: "
4729 +#define CORR_C_LOOKUP_PROMPT "Lookup string ('*' is wildcard): "
4730 +#define CORR_C_MORE_PROMPT "-- more --"
4731 +#define CORR_C_BLANK_MORE " "
4732 +#define CORR_C_END_LOOK "--end--"
4735 + * The following strings are used in defmt.c:
4737 +#define DEFMT_C_TEX_MATH_ERROR "****ERROR in parsing TeX math mode!\n"
4738 +#define DEFMT_C_LR_MATH_ERROR "***ERROR in LR to math-mode switch.\n"
4741 + * The following strings are used in icombine.c:
4743 +#define ICOMBINE_C_BAD_TYPE "icombine: unrecognized formatter type '%s'\n"
4744 +#define ICOMBINE_C_USAGE "Usage: icombine [-T suffix] [aff-file] < wordlist\n"
4747 + * The following strings are used in ispell.c:
4749 +#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"
4750 +#define ISPELL_C_USAGE2 " %s [-dfile | -pfile | -wchars | -Wn | -t | -n | -Ttype] -l\n"
4752 +#define ISPELL_C_USAGE3 " %s [-dfile | -pfile | -ffile | -Wn | -t | -n | -s | -B | -C | -P | -m | -Ttype] {-a | -A}\n"
4754 +#define ISPELL_C_USAGE3 " %s [-dfile | -pfile | -ffile | -Wn | -t | -n | -B | -C | -P | -m | -Ttype] {-a | -A}\n"
4756 +#define ISPELL_C_USAGE4 " %s [-dfile] [-wchars | -Wn] -c\n"
4757 +#define ISPELL_C_USAGE5 " %s [-dfile] [-wchars] -e[1-4]\n"
4758 +#define ISPELL_C_USAGE6 " %s [-dfile] [-wchars] -D\n"
4759 +#define ISPELL_C_USAGE7 " %s -v\n"
4760 +#define ISPELL_C_TEMP_DISAPPEARED "temporary file disappeared (%s)\n"
4761 +#define ISPELL_C_BAD_TYPE "ispell: unrecognized formatter type '%s'\n"
4762 +#define ISPELL_C_NO_FILE "ispell: specified file does not exist\n"
4763 +#define ISPELL_C_NO_FILES "ispell: specified files do not exist\n"
4764 +#define ISPELL_C_CANT_WRITE "Warning: Can't write to %s\n"
4765 +#define ISPELL_C_OPTIONS_ARE "Compiled-in options:\n"
4767 +#define ISPELL_C_NO_OPTIONS_SPACE "ispell: no memory to read default options\n"
4771 + * The following strings are used in lookup.c:
4773 +#define LOOKUP_C_CANT_READ "Trouble reading hash table %s"
4774 +#define LOOKUP_C_NULL_HASH "Null hash table %s"
4775 +#define LOOKUP_C_SHORT_HASH(name, gotten, wanted) \
4776 + "Truncated hash table %s: got %d bytes, expected %d", \
4777 + name, gotten, wanted
4778 +#define LOOKUP_C_BAD_MAGIC(name, wanted, gotten) \
4779 + "Illegal format hash table %s - expected magic 0x%x, got 0x%x", \
4780 + name, wanted, gotten
4781 +#define LOOKUP_C_BAD_MAGIC2(name, wanted, gotten) \
4782 + "Illegal format hash table %s - \nexpected magic2 0x%x, got 0x%x", \
4783 + name, wanted, gotten
4784 +#define LOOKUP_C_BAD_OPTIONS(gotopts, gotchars, gotlen, wantedopts, wantedchars, wantedlen) \
4785 + "Hash table options don't agree with buildhash - 0x%x/%d/%d vs. 0x%x/%d/%d", \
4786 + gotopts, gotchars, gotlen, \
4787 + wantedopts, wantedchars, wantedlen
4788 +#define LOOKUP_C_NO_HASH_SPACE "Couldn't allocate space for hash table"
4789 +#define LOOKUP_C_BAD_FORMAT "Illegal format hash table"
4790 +#define LOOKUP_C_NO_LANG_SPACE "Couldn't allocate space for language tables"
4793 + * The following strings are used in makedent.c:
4795 +#define MAKEDENT_C_NO_WORD_SPACE "\nCouldn't allocate space for word '%s'\n"
4796 +#define MAKEDENT_C_BAD_WORD_CHAR "\nWord '%s' contains illegal characters\n"
4799 + * The following strings are used in parse.y:
4801 +#define PARSE_Y_8_BIT "Eighth bit ignored (recompile ispell without NO8BIT)"
4802 +#define PARSE_Y_NO_WORD_STRINGS "wordchars statement may not specify string characters"
4803 +#define PARSE_Y_UNMATCHED "Unmatched charset lengths"
4804 +#define PARSE_Y_NO_BOUNDARY_STRINGS "boundarychars statement may not specify string characters"
4805 +#define PARSE_Y_LONG_STRING "String character is too long"
4806 +#define PARSE_Y_NULL_STRING "String character must have nonzero length"
4807 +#define PARSE_Y_MANY_STRINGS "Too many string characters"
4808 +#define PARSE_Y_NO_SUCH_STRING "No such string character"
4809 +#define PARSE_Y_MULTIPLE_STRINGS "Alternate string character was already defined"
4810 +#define PARSE_Y_LENGTH_MISMATCH "Upper and lower versions of string character must be same length"
4811 +#define PARSE_Y_WRONG_NROFF "Incorrect character count in nroffchars statement"
4812 +#define PARSE_Y_WRONG_TEX "Incorrect character count in TeXchars statement"
4813 +#define PARSE_Y_DOUBLE_COMPOUND "Compoundwords option may only appear once"
4814 +#define PARSE_Y_LONG_FLAG "Flag must be single character"
4815 +#define PARSE_Y_BAD_FLAG "Flag must be alphabetic"
4816 +#define PARSE_Y_DUP_FLAG "Duplicate flag"
4817 +#define PARSE_Y_NO_SPACE "Out of memory"
4818 +#define PARSE_Y_NEED_BLANK "Single characters must be separated by a blank"
4819 +#define PARSE_Y_MANY_CONDS "Too many conditions; 8 maximum"
4820 +#define PARSE_Y_EOF "Unexpected EOF in quoted string"
4821 +#define PARSE_Y_LONG_QUOTE "Quoted string too long, max 256 characters"
4822 +#define PARSE_Y_ERROR_FORMAT(file, lineno, error) \
4823 + "%s line %d: %s\n", file, lineno, error
4824 +#define PARSE_Y_MALLOC_TROUBLE "yyopen: trouble allocating memory\n"
4825 +#define PARSE_Y_UNGRAB_PROBLEM "Internal error: ungrab buffer overflow"
4826 +#define PARSE_Y_BAD_DEFORMATTER "Deformatter must be either 'nroff' or 'tex'"
4827 +#define PARSE_Y_BAD_NUMBER "Illegal digit in number"
4830 + * The following strings are used in term.c:
4832 +#define TERM_C_SMALL_SCREEN "Screen too small: need at least %d lines\n"
4833 +#define TERM_C_NO_BATCH "Can't deal with non-interactive use yet.\n"
4834 +#define TERM_C_CANT_FORK "Couldn't fork, try later.\n"
4835 +#define TERM_C_TYPE_SPACE "\n-- Type space to continue --"
4838 + * The following strings are used in tree.c:
4840 +#define TREE_C_CANT_UPDATE "Warning: Cannot update personal dictionary (%s)\n"
4841 +#define TREE_C_NO_SPACE "Ran out of space for personal dictionary\n"
4842 +#define TREE_C_TRY_ANYWAY "Continuing anyway (with reduced performance).\n"
4845 + * The following strings are used in unsq.c:
4847 +#define UNSQ_C_BAD_COUNT "Illegal count character 0x%x\n"
4848 +#define UNSQ_C_SURPRISE_EOF "Unexpected EOF\n"
4849 diff -urBbN vim64.org/src/spell/tgood.c vim64/src/spell/tgood.c
4850 --- vim64.org/src/spell/tgood.c 1970-01-01 01:00:00.000000000 +0100
4851 +++ vim64/src/spell/tgood.c 2005-10-17 12:49:17.517833632 +0200
4854 + * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
4855 + * All rights reserved.
4857 + * Redistribution and use in source and binary forms, with or without
4858 + * modification, are permitted provided that the following conditions
4861 + * 1. Redistributions of source code must retain the above copyright
4862 + * notice, this list of conditions and the following disclaimer.
4863 + * 2. Redistributions in binary form must reproduce the above copyright
4864 + * notice, this list of conditions and the following disclaimer in the
4865 + * documentation and/or other materials provided with the distribution.
4866 + * 3. All modifications to the source code must be clearly marked as
4867 + * such. Binary redistributions based on modified source code
4868 + * must be clearly marked as modified versions in the documentation
4869 + * and/or other materials provided with the distribution.
4870 + * 4. All advertising materials mentioning features or use of this software
4871 + * must display the following acknowledgment:
4872 + * This product includes software developed by Geoff Kuenning and
4873 + * other unpaid contributors.
4874 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
4875 + * products derived from this software without specific prior
4876 + * written permission.
4878 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
4879 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4880 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4881 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
4882 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4883 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4884 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4885 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
4886 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
4887 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4892 + * Table-driven version of good.c.
4894 + * Geoff Kuenning, July 1987
4899 + * Revision 1.32 1994/11/02 06:56:16 geoff
4900 + * Remove the anyword feature, which I've decided is a bad idea.
4902 + * Revision 1.31 1994/10/25 05:46:25 geoff
4903 + * Add support for the FF_ANYWORD (affix applies to all words, even if
4904 + * flag bit isn't set) flag option.
4906 + * Revision 1.30 1994/05/24 06:23:08 geoff
4907 + * Don't create a hit if "allhits" is clear and capitalization
4908 + * mismatches. This cures a bug where a word could be in the dictionary
4909 + * and yet not found.
4911 + * Revision 1.29 1994/05/17 06:44:21 geoff
4912 + * Add support for controlled compound formation and the COMPOUNDONLY
4913 + * option to affix flags.
4915 + * Revision 1.28 1994/01/25 07:12:13 geoff
4916 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
4921 +#include "ispell.h"
4923 +Global void chk_aff (ichar_t * word, ichar_t * ucword, int len,
4924 + int ignoreflagbits, int allhits, int pfxopts, int sfxopts);
4925 +Local void pfx_list_chk (ichar_t * word, ichar_t * ucword,
4926 + int len, int optflags, int sfxopts, struct flagptr * ind,
4927 + int ignoreflagbits, int allhits);
4928 +Local void chk_suf (ichar_t * word, ichar_t * ucword, int len,
4929 + int optflags, struct flagent * pfxent, int ignoreflagbits,
4931 +Local void suf_list_chk (ichar_t * word, ichar_t * ucword, int len,
4932 + struct flagptr * ind, int optflags, struct flagent * pfxent,
4933 + int ignoreflagbits, int allhits);
4934 +Global int expand_pre (char * croot, ichar_t * rootword,
4935 + MASKTYPE mask[], int option, char * extra);
4936 +Local int pr_pre_expansion (char * croot, ichar_t * rootword,
4937 + struct flagent * flent, MASKTYPE mask[], int option,
4939 +Global int expand_suf (char * croot, ichar_t * rootword,
4940 + MASKTYPE mask[], int optflags, int option, char * extra);
4941 +Local int pr_suf_expansion (char * croot, ichar_t * rootword,
4942 + struct flagent * flent, int option, char * extra);
4943 +Local void forcelc (ichar_t * dst, int len);
4945 +/* Check possible affixes */
4948 + ichar_t * word, /* Word to be checked */
4949 + ichar_t * ucword, /* Upper-case-only copy of word */
4950 + int len, /* The length of word/ucword */
4951 + int ignoreflagbits, /* Ignore whether affix is legal */
4952 + int allhits, /* Keep going after first hit */
4953 + int pfxopts, /* Options to apply to prefixes */
4954 + int sfxopts) /* Options to apply to suffixes */
4956 + register ichar_t * cp; /* Pointer to char to index on */
4957 + struct flagptr * ind; /* Flag index table to test */
4959 + pfx_list_chk (word, ucword, len, pfxopts, sfxopts, &pflagindex[0],
4960 + ignoreflagbits, allhits);
4962 + ind = &pflagindex[*cp++];
4963 + while (ind->numents == 0 && ind->pu.fp != NULL)
4967 + if (ind->pu.fp[0].numents)
4969 + pfx_list_chk (word, ucword, len, pfxopts, sfxopts, &ind->pu.fp[0],
4970 + ignoreflagbits, allhits);
4971 + if (numhits && !allhits && !cflag && !ignoreflagbits)
4974 + ind = &ind->pu.fp[*cp++];
4976 + pfx_list_chk (word, ucword, len, pfxopts, sfxopts, ind, ignoreflagbits,
4978 + if (numhits && !allhits && !cflag && !ignoreflagbits)
4980 + chk_suf (word, ucword, len, sfxopts, (struct flagent *) NULL,
4981 + ignoreflagbits, allhits);
4984 +/* Check some prefix flags */
4987 + ichar_t * word, /* Word to be checked */
4988 + ichar_t * ucword, /* Upper-case-only word */
4989 + int len, /* The length of ucword */
4990 + int optflags, /* Options to apply */
4991 + int sfxopts, /* Options to apply to suffixes */
4992 + struct flagptr * ind, /* Flag index table */
4993 + int ignoreflagbits, /* Ignore whether affix is legal */
4994 + int allhits) /* Keep going after first hit */
4996 + int cond; /* Condition number */
4997 + register ichar_t * cp; /* Pointer into end of ucword */
4998 + struct dent * dent; /* Dictionary entry we found */
4999 + int entcount; /* Number of entries to process */
5000 + register struct flagent *
5001 + flent; /* Current table entry */
5002 + int preadd; /* Length added to tword2 as prefix */
5003 + register int tlen; /* Length of tword */
5004 + ichar_t tword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; /* Tmp cpy */
5005 + ichar_t tword2[sizeof tword]; /* 2nd copy for ins_root_cap */
5007 + for (flent = ind->pu.ent, entcount = ind->numents;
5008 + entcount > 0; flent++, entcount--)
5011 + * If this is a compound-only affix, ignore it unless we're
5012 + * looking for that specific thing.
5014 + if ((flent->flagflags & FF_COMPOUNDONLY) != 0
5015 + && (optflags & FF_COMPOUNDONLY) == 0)
5018 + * In COMPOUND_CONTROLLED mode, the FF_COMPOUNDONLY bit must
5021 + if (compoundflag == COMPOUND_CONTROLLED
5022 + && ((flent->flagflags ^ optflags) & FF_COMPOUNDONLY) != 0)
5025 + * See if the prefix matches.
5027 + tlen = len - flent->affl;
5028 + if (tlen > 0 && (flent->affl == 0 ||
5029 + icharncmp (flent->affix, ucword, flent->affl) == 0) &&
5030 + tlen + flent->stripl >= flent->numconds)
5033 + * The prefix matches. Remove it, replace it by the "strip"
5034 + * string (if any), and check the original conditions.
5036 + if (flent->stripl)
5037 + (void) icharcpy (tword, flent->strip);
5038 + (void) icharcpy (tword + flent->stripl, ucword + flent->affl);
5040 + for (cond = 0; cond < flent->numconds; cond++)
5042 + if ((flent->conds[*cp++] & (1 << cond)) == 0)
5045 + if (cond >= flent->numconds)
5048 + * The conditions match. See if the word is in the
5051 + tlen += flent->stripl;
5053 + flagpr (tword, BITTOCHAR (flent->flagbit), flent->stripl,
5054 + flent->affl, -1, 0);
5055 + else if (ignoreflagbits)
5057 + if ((dent = lookup (tword, 1)) != NULL)
5062 + (void) icharcpy (cp, flent->affix);
5063 + cp += flent->affl;
5066 + preadd = cp - tword2;
5067 + (void) icharcpy (cp, tword);
5069 + if (flent->stripl)
5072 + (void) icharcpy (cp, flent->strip);
5074 + (void) ins_root_cap (tword2, word,
5075 + flent->stripl, preadd,
5076 + 0, (cp - tword2) - tlen - preadd,
5077 + dent, flent, (struct flagent *) NULL);
5080 + else if ((dent = lookup (tword, 1)) != NULL
5081 + && TSTMASKBIT (dent->mask, flent->flagbit))
5083 + if (numhits < MAX_HITS)
5085 + hits[numhits].dictent = dent;
5086 + hits[numhits].prefix = flent;
5087 + hits[numhits].suffix = NULL;
5092 +#ifndef NO_CAPITALIZATION_SUPPORT
5093 + if (cap_ok (word, &hits[0], len))
5096 +#else /* NO_CAPITALIZATION_SUPPORT */
5098 +#endif /* NO_CAPITALIZATION_SUPPORT */
5102 + * Handle cross-products.
5104 + if (flent->flagflags & FF_CROSSPRODUCT)
5105 + chk_suf (word, tword, tlen, sfxopts | FF_CROSSPRODUCT,
5106 + flent, ignoreflagbits, allhits);
5112 +/* Check possible suffixes */
5115 + ichar_t * word, /* Word to be checked */
5116 + ichar_t * ucword, /* Upper-case-only word */
5117 + int len, /* The length of ucword */
5118 + int optflags, /* Affix option flags */
5119 + struct flagent * pfxent, /* Prefix flag entry if cross-prod */
5120 + int ignoreflagbits, /* Ignore whether affix is legal */
5121 + int allhits) /* Keep going after first hit */
5123 + register ichar_t * cp; /* Pointer to char to index on */
5124 + struct flagptr * ind; /* Flag index table to test */
5126 + suf_list_chk (word, ucword, len, &sflagindex[0], optflags, pfxent,
5127 + ignoreflagbits, allhits);
5128 + cp = ucword + len - 1;
5129 + ind = &sflagindex[*cp];
5130 + while (ind->numents == 0 && ind->pu.fp != NULL)
5134 + if (ind->pu.fp[0].numents)
5136 + suf_list_chk (word, ucword, len, &ind->pu.fp[0],
5137 + optflags, pfxent, ignoreflagbits, allhits);
5138 + if (numhits != 0 && !allhits && !cflag && !ignoreflagbits)
5141 + ind = &ind->pu.fp[*--cp];
5143 + suf_list_chk (word, ucword, len, ind, optflags, pfxent,
5144 + ignoreflagbits, allhits);
5149 + ichar_t * word, /* Word to be checked */
5150 + ichar_t * ucword, /* Upper-case-only word */
5151 + int len, /* The length of ucword */
5152 + struct flagptr * ind, /* Flag index table */
5153 + int optflags, /* Affix option flags */
5154 + struct flagent * pfxent, /* Prefix flag entry if crossonly */
5155 + int ignoreflagbits, /* Ignore whether affix is legal */
5156 + int allhits) /* Keep going after first hit */
5158 + register ichar_t * cp; /* Pointer into end of ucword */
5159 + int cond; /* Condition number */
5160 + struct dent * dent; /* Dictionary entry we found */
5161 + int entcount; /* Number of entries to process */
5162 + register struct flagent *
5163 + flent; /* Current table entry */
5164 + int preadd; /* Length added to tword2 as prefix */
5165 + register int tlen; /* Length of tword */
5166 + ichar_t tword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; /* Tmp cpy */
5167 + ichar_t tword2[sizeof tword]; /* 2nd copy for ins_root_cap */
5169 + (void) icharcpy (tword, ucword);
5170 + for (flent = ind->pu.ent, entcount = ind->numents;
5172 + flent++, entcount--)
5174 + if ((optflags & FF_CROSSPRODUCT) != 0
5175 + && (flent->flagflags & FF_CROSSPRODUCT) == 0)
5178 + * If this is a compound-only affix, ignore it unless we're
5179 + * looking for that specific thing.
5181 + if ((flent->flagflags & FF_COMPOUNDONLY) != 0
5182 + && (optflags & FF_COMPOUNDONLY) == 0)
5185 + * In COMPOUND_CONTROLLED mode, the FF_COMPOUNDONLY bit must
5188 + if (compoundflag == COMPOUND_CONTROLLED
5189 + && ((flent->flagflags ^ optflags) & FF_COMPOUNDONLY) != 0)
5192 + * See if the suffix matches.
5194 + tlen = len - flent->affl;
5196 + && (flent->affl == 0
5197 + || icharcmp (flent->affix, ucword + tlen) == 0)
5198 + && tlen + flent->stripl >= flent->numconds)
5201 + * The suffix matches. Remove it, replace it by the "strip"
5202 + * string (if any), and check the original conditions.
5204 + (void) icharcpy (tword, ucword);
5205 + cp = tword + tlen;
5206 + if (flent->stripl)
5208 + (void) icharcpy (cp, flent->strip);
5209 + tlen += flent->stripl;
5210 + cp = tword + tlen;
5214 + for (cond = flent->numconds; --cond >= 0; )
5216 + if ((flent->conds[*--cp] & (1 << cond)) == 0)
5222 + * The conditions match. See if the word is in the
5227 + if (optflags & FF_CROSSPRODUCT)
5228 + flagpr (tword, BITTOCHAR (pfxent->flagbit),
5229 + pfxent->stripl, pfxent->affl,
5230 + BITTOCHAR (flent->flagbit), flent->affl);
5232 + flagpr (tword, -1, 0, 0,
5233 + BITTOCHAR (flent->flagbit), flent->affl);
5235 + else if (ignoreflagbits)
5237 + if ((dent = lookup (tword, 1)) != NULL)
5240 + if ((optflags & FF_CROSSPRODUCT)
5241 + && pfxent->affl != 0)
5243 + (void) icharcpy (cp, pfxent->affix);
5244 + cp += pfxent->affl;
5247 + preadd = cp - tword2;
5248 + (void) icharcpy (cp, tword);
5250 + if ((optflags & FF_CROSSPRODUCT)
5251 + && pfxent->stripl != 0)
5254 + (void) icharcpy (cp, pfxent->strip);
5255 + cp += pfxent->stripl;
5257 + if (flent->stripl)
5260 + (void) icharcpy (cp, flent->strip);
5261 + cp += flent->stripl;
5266 + (void) icharcpy (cp, flent->affix);
5267 + cp += flent->affl;
5269 + (void) ins_root_cap (tword2, word,
5270 + (optflags & FF_CROSSPRODUCT) ? pfxent->stripl : 0,
5272 + flent->stripl, (cp - tword2) - tlen - preadd,
5273 + dent, pfxent, flent);
5276 + else if ((dent = lookup (tword, 1)) != NULL
5277 + && TSTMASKBIT (dent->mask, flent->flagbit)
5278 + && ((optflags & FF_CROSSPRODUCT) == 0
5279 + || TSTMASKBIT (dent->mask, pfxent->flagbit)))
5281 + if (numhits < MAX_HITS)
5283 + hits[numhits].dictent = dent;
5284 + hits[numhits].prefix = pfxent;
5285 + hits[numhits].suffix = flent;
5290 +#ifndef NO_CAPITALIZATION_SUPPORT
5291 + if (cap_ok (word, &hits[0], len))
5294 +#else /* NO_CAPITALIZATION_SUPPORT */
5296 +#endif /* NO_CAPITALIZATION_SUPPORT */
5305 + * Expand a dictionary prefix entry
5309 + char * croot, /* Char version of rootword */
5310 + ichar_t * rootword, /* Root word to expand */
5311 + register MASKTYPE mask[], /* Mask bits to expand on */
5312 + int option, /* Option, see expandmode */
5313 + char * extra) /* Extra info to add to line */
5315 + int entcount; /* No. of entries to process */
5316 + int explength; /* Length of expansions */
5317 + register struct flagent *
5318 + flent; /* Current table entry */
5320 + for (flent = pflaglist, entcount = numpflags, explength = 0;
5321 + entcount > 0; flent++, entcount--)
5323 + if (TSTMASKBIT (mask, flent->flagbit))
5325 + pr_pre_expansion (croot, rootword, flent, mask, option, extra);
5330 +/* Print a prefix expansion */
5333 + char * croot, /* Char version of rootword */
5334 + register ichar_t * rootword, /* Root word to expand */
5335 + register struct flagent * flent, /* Current table entry */
5336 + MASKTYPE mask[], /* Mask bits to expand on */
5337 + int option, /* Option, see expandmode */
5338 + char * extra) /* Extra info to add to line */
5340 + int cond; /* Current condition number */
5341 + register ichar_t * nextc; /* Next case choice */
5342 + int tlen; /* Length of tword */
5343 + ichar_t tword[INPUTWORDLEN + MAXAFFIXLEN]; /* Temp */
5345 + tlen = icharlen (rootword);
5346 + if (flent->numconds > tlen)
5348 + tlen -= flent->stripl;
5351 + tlen += flent->affl;
5352 + for (cond = 0, nextc = rootword; cond < flent->numconds; cond++)
5354 + if ((flent->conds[mytoupper (*nextc++)] & (1 << cond)) == 0)
5358 + * The conditions are satisfied. Copy the word, add the prefix,
5359 + * and make it the proper case. This code is carefully written
5360 + * to match that ins_cap and cap_ok. Note that the affix, as
5361 + * inserted, is uppercase.
5363 + * There is a tricky bit here: if the root is capitalized, we
5364 + * want a capitalized result. If the root is followcase, however,
5365 + * we want to duplicate the case of the first remaining letter
5366 + * of the root. In other words, "Loved/U" should generate "Unloved",
5367 + * but "LOved/U" should generate "UNLOved" and "lOved/U" should
5368 + * produce "unlOved".
5372 + (void) icharcpy (tword, flent->affix);
5373 + nextc = tword + flent->affl;
5375 + (void) icharcpy (nextc, rootword + flent->stripl);
5376 + if (myupper (rootword[0]))
5378 + /* We must distinguish followcase from capitalized and all-upper */
5379 + for (nextc = rootword + 1; *nextc; nextc++)
5381 + if (!myupper (*nextc))
5386 + /* It's a followcase or capitalized word. Figure out which. */
5387 + for ( ; *nextc; nextc++)
5389 + if (myupper (*nextc))
5394 + /* It's followcase. */
5395 + if (!myupper (tword[flent->affl]))
5396 + forcelc (tword, flent->affl);
5400 + /* It's capitalized */
5401 + forcelc (tword + 1, tlen - 1);
5407 + /* Followcase or all-lower, we don't care which */
5408 + if (!myupper (*nextc))
5409 + forcelc (tword, flent->affl);
5412 + (void) printf ("\n%s", croot);
5414 + (void) printf (" %s%s", ichartosstr (tword, 1), extra);
5415 + if (flent->flagflags & FF_CROSSPRODUCT)
5417 + + expand_suf (croot, tword, mask, FF_CROSSPRODUCT, option, extra);
5423 + * Expand a dictionary suffix entry
5425 +int expand_suf (croot, rootword, mask, optflags, option, extra)
5426 + char * croot; /* Char version of rootword */
5427 + ichar_t * rootword; /* Root word to expand */
5428 + register MASKTYPE mask[]; /* Mask bits to expand on */
5429 + int optflags; /* Affix option flags */
5430 + int option; /* Option, see expandmode */
5431 + char * extra; /* Extra info to add to line */
5433 + int entcount; /* No. of entries to process */
5434 + int explength; /* Length of expansions */
5435 + register struct flagent *
5436 + flent; /* Current table entry */
5438 + for (flent = sflaglist, entcount = numsflags, explength = 0;
5440 + flent++, entcount--)
5442 + if (TSTMASKBIT (mask, flent->flagbit))
5444 + if ((optflags & FF_CROSSPRODUCT) == 0
5445 + || (flent->flagflags & FF_CROSSPRODUCT))
5447 + pr_suf_expansion (croot, rootword, flent, option, extra);
5453 +/* Print a suffix expansion */
5454 +static int pr_suf_expansion (croot, rootword, flent, option, extra)
5455 + char * croot; /* Char version of rootword */
5456 + register ichar_t * rootword; /* Root word to expand */
5457 + register struct flagent * flent; /* Current table entry */
5458 + int option; /* Option, see expandmode */
5459 + char * extra; /* Extra info to add to line */
5461 + int cond; /* Current condition number */
5462 + register ichar_t * nextc; /* Next case choice */
5463 + int tlen; /* Length of tword */
5464 + ichar_t tword[INPUTWORDLEN + MAXAFFIXLEN]; /* Temp */
5466 + tlen = icharlen (rootword);
5467 + cond = flent->numconds;
5470 + if (tlen - flent->stripl <= 0)
5472 + for (nextc = rootword + tlen; --cond >= 0; )
5474 + if ((flent->conds[mytoupper (*--nextc)] & (1 << cond)) == 0)
5478 + * The conditions are satisfied. Copy the word, add the suffix,
5479 + * and make it match the case of the last remaining character of the
5480 + * root. Again, this code carefully matches ins_cap and cap_ok.
5482 + (void) icharcpy (tword, rootword);
5483 + nextc = tword + tlen - flent->stripl;
5486 + (void) icharcpy (nextc, flent->affix);
5487 + if (!myupper (nextc[-1]))
5488 + forcelc (nextc, flent->affl);
5493 + (void) printf ("\n%s", croot);
5495 + (void) printf (" %s%s", ichartosstr (tword, 1), extra);
5496 + return tlen + flent->affl - flent->stripl;
5499 +static void forcelc (dst, len) /* Force to lowercase */
5500 + register ichar_t * dst; /* Destination to modify */
5501 + register int len; /* Length to copy */
5504 + for ( ; --len >= 0; dst++)
5505 + *dst = mytolower (*dst);
5507 diff -urBbN vim64.org/src/spell/tree.c vim64/src/spell/tree.c
5508 --- vim64.org/src/spell/tree.c 1970-01-01 01:00:00.000000000 +0100
5509 +++ vim64/src/spell/tree.c 2005-10-17 12:49:17.518833480 +0200
5512 + * tree.c - a hash style dictionary for user's personal words
5514 + * Pace Willisson, 1983
5515 + * Hash support added by Geoff Kuenning, 1987
5517 + * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
5518 + * All rights reserved.
5520 + * Redistribution and use in source and binary forms, with or without
5521 + * modification, are permitted provided that the following conditions
5524 + * 1. Redistributions of source code must retain the above copyright
5525 + * notice, this list of conditions and the following disclaimer.
5526 + * 2. Redistributions in binary form must reproduce the above copyright
5527 + * notice, this list of conditions and the following disclaimer in the
5528 + * documentation and/or other materials provided with the distribution.
5529 + * 3. All modifications to the source code must be clearly marked as
5530 + * such. Binary redistributions based on modified source code
5531 + * must be clearly marked as modified versions in the documentation
5532 + * and/or other materials provided with the distribution.
5533 + * 4. All advertising materials mentioning features or use of this software
5534 + * must display the following acknowledgment:
5535 + * This product includes software developed by Geoff Kuenning and
5536 + * other unpaid contributors.
5537 + * 5. The name of Geoff Kuenning may not be used to endorse or promote
5538 + * products derived from this software without specific prior
5539 + * written permission.
5541 + * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
5542 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5543 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5544 + * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
5545 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5546 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5547 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5548 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5549 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5550 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5556 + * Revision 1.56 1995/01/08 23:23:49 geoff
5557 + * Support PDICTHOME for DOS purposes.
5559 + * Revision 1.55 1994/10/25 05:46:27 geoff
5560 + * Fix a comment that looked to some compilers like it might be nested.
5562 + * Revision 1.54 1994/01/25 07:12:15 geoff
5563 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
5568 +#include <stdlib.h>
5570 +#include "ispell.h"
5573 +Local FILE * trydict (char * dictname, char * home,
5574 + char * prefix, char * suffix);
5575 +Local void treeload (FILE * dictf);
5576 +Local struct dent * tinsert (struct dent * proto);
5577 +#if SORTPERSONAL != 0
5578 +Local int pdictcmp (struct dent ** enta, struct dent **entb);
5579 +#endif /* SORTPERSONAL != 0 */
5580 +#ifdef REGEX_LOOKUP
5581 +#endif /* REGEX_LOOKUP */
5583 +Local int cantexpand = 0; /* NZ if an expansion fails */
5584 +Local struct dent * pershtab; /* Aux hash table for personal dict */
5585 +Local int pershsize = 0; /* Space available in aux hash table */
5586 +Local int hcount = 0; /* Number of items in hash table */
5589 + * Hash table sizes. Prime is probably a good idea, though in truth I
5590 + * whipped the algorithm up on the spot rather than looking it up, so
5591 + * who knows what's really best? If we overflow the table, we just
5592 + * use a double-and-add-1 algorithm.
5594 +static int goodsizes[] =
5596 + 53, 223, 907, 3631
5599 +Local char personaldict[MAXPATHLEN];
5600 +Local FILE * dictf;
5601 +Local newwords = 0;
5605 + char * p, /* Value specified in -p switch */
5606 + char * LibDict) /* Root of default dict name */
5608 + int abspath; /* NZ if p is abs path name */
5609 + char * h; /* Home directory name */
5610 + char seconddict[MAXPATHLEN]; /* Name of secondary dict */
5611 + FILE * secondf; /* Access to second dict file */
5614 + ** If -p was not specified, try to get a default name from the
5615 + ** environment. After this point, if p is null, the the value in
5616 + ** personaldict is the only possible name for the personal dictionary.
5617 + ** If p is non-null, then there is a possibility that we should
5618 + ** prepend HOME to get the correct dictionary name.
5621 + p = getenv (PDICTVAR);
5623 + ** if p exists and begins with '/' we don't really need HOME,
5624 + ** but it's not very likely that HOME isn't set anyway (on non-DOS
5631 + for(i = 0; i < pershsize; i++)
5634 + if(x->word != NULL)
5636 + for(x = x->next; x != NULL;)
5640 + if(x->word != NULL)
5647 + if(pershtab != NULL)
5653 + if ((h = getenv (HOME)) == NULL)
5657 +#else /* PDICTHOME */
5659 +#endif /* PDICTHOME */
5665 + * No -p and no PDICTVAR. We will use LibDict and DEFPAFF to
5666 + * figure out the name of the personal dictionary and where it
5667 + * is. The rules are as follows:
5669 + * (1) If there is a local dictionary and a HOME dictionary,
5670 + * both are loaded, but changes are saved in the local one.
5671 + * The dictionary to save changes in is named "personaldict".
5672 + * (2) Dictionaries named after the affix file take precedence
5673 + * over dictionaries with the default suffix (DEFPAFF).
5674 + * (3) Dictionaries named with the new default names
5675 + * (DEFPDICT/DEFPAFF) take precedence over the old ones
5676 + * (OLDPDICT/OLDPAFF).
5677 + * (4) Dictionaries aren't combined unless they follow the same
5679 + * (5) If no dictionary can be found, a new one is created in
5680 + * the home directory, named after DEFPDICT and the affix
5683 + dictf = trydict (personaldict, (char *) NULL, DEFPDICT, LibDict);
5684 + secondf = trydict (seconddict, h, DEFPDICT, LibDict);
5685 + if (dictf == NULL && secondf == NULL)
5687 + dictf = trydict (personaldict, (char *) NULL, DEFPDICT, DEFPAFF);
5688 + secondf = trydict (seconddict, h, DEFPDICT, DEFPAFF);
5690 + if (dictf == NULL && secondf == NULL)
5692 + dictf = trydict (personaldict, (char *) NULL, OLDPDICT, LibDict);
5693 + secondf = trydict (seconddict, h, OLDPDICT, LibDict);
5695 + if (dictf == NULL && secondf == NULL)
5697 + dictf = trydict (personaldict, (char *) NULL, OLDPDICT, OLDPAFF);
5698 + secondf = trydict (seconddict, h, OLDPDICT, OLDPAFF);
5700 + if (personaldict[0] == '\0')
5702 + if (seconddict[0] != '\0')
5703 + (void) strcpy (personaldict, seconddict);
5705 + (void) sprintf (personaldict, "%s/%s%s", h, DEFPDICT, LibDict);
5707 + if (dictf != NULL)
5710 + (void) fclose (dictf);
5712 + if (secondf != NULL)
5714 + treeload (secondf);
5715 + (void) fclose (secondf);
5721 + ** Figure out if p is an absolute path name. Note that beginning
5722 + ** with "./" and "../" is considered an absolute path, since this
5723 + ** still means we can't prepend HOME.
5725 + abspath = (*p == '/' || strncmp (p, "./", 2) == 0
5726 + || strncmp (p, "../", 3) == 0);
5729 + abspath = (*p == '\\' || strncmp (p, ".\\", 2) == 0
5730 + || strncmp (p, "..\\", 3) == 0
5731 + || (p[0] && p[1] == ':'));
5735 + (void) strcpy (personaldict, p);
5736 + if ((dictf = fopen (personaldict, "r")) != NULL)
5739 + (void) fclose (dictf);
5745 + ** The user gave us a relative pathname. We will try it
5746 + ** locally, and if that doesn't work, we'll try the home
5747 + ** directory. If neither exists, it will be created in
5748 + ** the home directory if words are added.
5750 + (void) strcpy (personaldict, p);
5751 + if ((dictf = fopen (personaldict, "r")) != NULL)
5754 + (void) fclose (dictf);
5756 + else if (!abspath)
5758 + /* Try the home */
5759 + (void) sprintf (personaldict, "%s/%s", h, p);
5760 + if ((dictf = fopen (personaldict, "r")) != NULL)
5763 + (void) fclose (dictf);
5767 + * If dictf is null, we couldn't open the dictionary
5768 + * specified in the -p switch. Complain.
5770 + if (dictf == NULL)
5772 + (void) fprintf (stderr, CANT_OPEN, p);
5779 +#ifndef FEAT_SPELL_HL
5780 + if (!lflag && !aflag
5781 + && access (personaldict, 2) < 0 && errno != ENOENT)
5783 + (void) fprintf (stderr, TREE_C_CANT_UPDATE, personaldict);
5784 + (void) sleep ((unsigned) 2);
5790 + * Try to open a dictionary. As a side effect, leaves the dictionary
5791 + * name in "filename" if one is found, and leaves a null string there
5796 + char * filename, /* Where to store the file name */
5797 + char * home, /* Home directory */
5798 + char * prefix, /* Prefix for dictionary */
5799 + char * suffix) /* Suffix for dictionary */
5801 + FILE * dictf; /* Access to dictionary file */
5804 + (void) sprintf (filename, "%s%s", prefix, suffix);
5806 + (void) sprintf (filename, "%s/%s%s", home, prefix, suffix);
5807 + dictf = fopen (filename, "r");
5808 + if (dictf == NULL)
5809 + filename[0] = '\0';
5815 + register FILE * loadfile) /* File to load words from */
5817 + char buf[BUFSIZ]; /* Buffer for reading pers dict */
5819 + while (fgets (buf, sizeof buf, loadfile) != NULL)
5820 + treeinsert (buf, sizeof(buf), 1);
5826 + char * word, /* Word to insert - must be canonical */
5827 + int wordlen, /* Length of the word buffer */
5830 + register int i, len;
5831 + struct dent wordent;
5832 + register struct dent * dp;
5833 + struct dent * olddp;
5834 +#ifndef NO_CAPITALIZATION_SUPPORT
5835 + struct dent * newdp;
5837 + struct dent * oldhtab;
5839 + ichar_t nword[INPUTWORDLEN + MAXAFFIXLEN];
5840 +#ifndef NO_CAPITALIZATION_SUPPORT
5844 + len = strlen(word);
5845 + if((word[len - 1] == '\n') || (word[len - 1] == '\r'))
5846 + word[len - 1] = '\0', len--;
5847 + if((word[len - 1] == '\n') || (word[len - 1] == '\r'))
5848 + word[len - 1] = '\0';
5850 + * Expand hash table when it is MAXPCT % full.
5852 + if (!cantexpand && (hcount * 100) / MAXPCT >= pershsize)
5854 + oldhsize = pershsize;
5855 + oldhtab = pershtab;
5856 + for (i = 0; i < sizeof goodsizes / sizeof (goodsizes[0]); i++)
5857 + if (goodsizes[i] > pershsize)
5859 + if (i >= sizeof goodsizes / sizeof goodsizes[0])
5860 + pershsize += pershsize + 1;
5862 + pershsize = goodsizes[i];
5864 + (struct dent *) calloc ((unsigned) pershsize, sizeof (struct dent));
5865 + if (pershtab == NULL)
5867 + (void) fprintf (stderr, TREE_C_NO_SPACE);
5869 + * Try to continue anyway, since our overflow
5870 + * algorithm can handle an overfull (100%+) table,
5871 + * and the malloc very likely failed because we
5872 + * already have such a huge table, so small mallocs
5873 + * for overflow entries will still work.
5875 + if (oldhtab == NULL)
5876 + exit (1); /* No old table, can't go on */
5877 + (void) fprintf (stderr, TREE_C_TRY_ANYWAY);
5878 + cantexpand = 1; /* Suppress further messages */
5879 + pershsize = oldhsize; /* Put things back */
5880 + pershtab = oldhtab; /* ... */
5881 + newwords = 1; /* And pretend it worked */
5886 + * Re-insert old entries into new table
5888 + for (i = 0; i < oldhsize; i++)
5891 + if (dp->flagfield & USED)
5893 +#ifdef NO_CAPITALIZATION_SUPPORT
5894 + (void) tinsert (dp);
5896 + newdp = tinsert (dp);
5897 + isvariant = (dp->flagfield & MOREVARIANTS);
5900 +#ifdef NO_CAPITALIZATION_SUPPORT
5901 + while (dp != NULL)
5903 + (void) tinsert (dp);
5906 + free ((char *) olddp);
5909 + while (dp != NULL)
5913 + isvariant = dp->flagfield & MOREVARIANTS;
5914 + olddp = newdp->next;
5918 + newdp->next = olddp;
5922 + isvariant = dp->flagfield & MOREVARIANTS;
5923 + newdp = tinsert (dp);
5926 + free ((char *) olddp);
5932 + if (oldhtab != NULL)
5933 + free ((char *) oldhtab);
5938 + ** We're ready to do the insertion. Start by creating a sample
5939 + ** entry for the word.
5941 + if (makedent (word, wordlen, &wordent) < 0)
5942 + return; /* Word must be too big or something */
5944 + wordent.flagfield |= KEEP;
5946 + ** Now see if word or a variant is already in the table. We use the
5947 + ** capitalized version so we'll find the header, if any.
5949 + (void) strtoichar (nword, word, sizeof nword, 1);
5951 + if ((dp = lookup (nword, 1)) != NULL)
5953 + /* It exists. Combine caps and set the keep flag. */
5954 + if (combinecaps (dp, &wordent) < 0)
5956 + free (wordent.word);
5962 + /* It's new. Insert the word. */
5963 + dp = tinsert (&wordent);
5964 +#ifndef NO_CAPITALIZATION_SUPPORT
5965 + if (captype (dp->flagfield) == FOLLOWCASE)
5966 + (void) addvheader (dp);
5973 +Local struct dent *
5975 + struct dent * proto) /* Prototype entry to copy */
5977 + ichar_t iword[INPUTWORDLEN + MAXAFFIXLEN];
5978 + register int hcode;
5979 + register struct dent * hp; /* Next trial entry in hash table */
5980 + register struct dent * php; /* Prev. value of hp, for chaining */
5982 + if (strtoichar (iword, proto->word, sizeof iword, 1))
5983 + (void) fprintf (stderr, WORD_TOO_LONG (proto->word));
5984 +#ifdef NO_CAPITALIZATION_SUPPORT
5987 + hcode = hash (iword, pershsize);
5989 + hp = &pershtab[hcode];
5990 + if (hp->flagfield & USED)
5992 + while (hp != NULL)
5997 + hp = (struct dent *) calloc (1, sizeof (struct dent));
6000 + (void) fprintf (stderr, TREE_C_NO_SPACE);
6011 +Public struct dent *
6012 +treelookup (register ichar_t * word)
6015 + register int hcode;
6016 + register struct dent * hp;
6017 + char chword[INPUTWORDLEN + MAXAFFIXLEN];
6019 + if (pershsize <= 0)
6021 + (void) ichartostr (chword, word, sizeof chword, 1);
6022 + hcode = hash (word, pershsize);
6023 + hp = &pershtab[hcode];
6024 + while (hp != NULL && (hp->flagfield & USED))
6026 + if (strcmp (chword, hp->word) == 0)
6028 +#ifndef NO_CAPITALIZATION_SUPPORT
6029 + while (hp->flagfield & MOREVARIANTS)
6034 + if (hp != NULL && (hp->flagfield & USED))
6040 +#if SORTPERSONAL != 0
6041 +/* Comparison routine for sorting the personal dictionary with qsort */
6044 + struct dent ** enta,
6045 + struct dent ** entb)
6048 + /* The parentheses around *enta and *entb below are NECESSARY!
6049 + ** Otherwise the compiler reads it as *(enta->word), or
6050 + ** enta->word[0], which is illegal (but pcc takes it and
6051 + ** produces wrong code).
6053 + return casecmp ((*enta)->word, (*entb)->word, 1);
6061 + register struct dent * cent; /* Current entry */
6062 + register struct dent * lent; /* Linked entry */
6063 +#if SORTPERSONAL != 0
6064 + int pdictsize; /* Number of entries to write */
6065 + struct dent ** sortlist; /* List of entries to be sorted */
6066 + register struct dent ** sortptr; /* Handy pointer into sortlist */
6068 + register struct dent * ehtab; /* End of pershtab, for fast looping */
6070 + if (newwords == 0)
6073 + if ((dictf = fopen (personaldict, "w")) == NULL)
6075 + (void) fprintf (stderr, CANT_CREATE, personaldict);
6079 +#if SORTPERSONAL != 0
6081 + ** If we are going to sort the personal dictionary, we must know
6082 + ** how many items are going to be sorted.
6085 + if (hcount >= SORTPERSONAL)
6089 + for (cent = pershtab, ehtab = pershtab + pershsize; cent < ehtab;
6092 + for (lent = cent; lent != NULL; lent = lent->next)
6094 + if ((lent->flagfield & (USED | KEEP)) == (USED | KEEP))
6096 +#ifndef NO_CAPITALIZATION_SUPPORT
6097 + while (lent->flagfield & MOREVARIANTS)
6098 + lent = lent->next;
6102 + for (cent = hashtbl, ehtab = hashtbl + hashsize; cent < ehtab; cent++)
6104 + if ((cent->flagfield & (USED | KEEP)) == (USED | KEEP))
6107 + ** We only want to count variant headers
6108 + ** and standalone entries. These happen
6109 + ** to share the characteristics in the
6110 + ** test below. This test will appear
6111 + ** several more times in this routine.
6113 +#ifndef NO_CAPITALIZATION_SUPPORT
6114 + if (captype (cent->flagfield) != FOLLOWCASE
6115 + && cent->word != NULL)
6120 + sortlist = (struct dent **) malloc (pdictsize * sizeof (struct dent));
6122 + if (sortlist == NULL)
6125 + for (cent = pershtab, ehtab = pershtab + pershsize; cent < ehtab;
6128 + for (lent = cent; lent != NULL; lent = lent->next)
6130 + if ((lent->flagfield & (USED | KEEP)) == (USED | KEEP))
6132 + toutent (dictf, lent, 1);
6133 +#ifndef NO_CAPITALIZATION_SUPPORT
6134 + while (lent->flagfield & MOREVARIANTS)
6135 + lent = lent->next;
6140 + for (cent = hashtbl, ehtab = hashtbl + hashsize; cent < ehtab; cent++)
6142 + if ((cent->flagfield & (USED | KEEP)) == (USED | KEEP))
6144 +#ifndef NO_CAPITALIZATION_SUPPORT
6145 + if (captype (cent->flagfield) != FOLLOWCASE
6146 + && cent->word != NULL)
6148 + toutent (dictf, cent, 1);
6151 +#if SORTPERSONAL != 0
6155 + ** Produce dictionary in sorted order. We used to do this
6156 + ** destructively, but that turns out to fail because in some modes
6157 + ** the dictionary is written more than once. So we build an
6158 + ** auxiliary pointer table (in sortlist) and sort that. This
6159 + ** is faster anyway, though it uses more memory.
6161 + sortptr = sortlist;
6162 + for (cent = pershtab, ehtab = pershtab + pershsize; cent < ehtab; cent++)
6164 + for (lent = cent; lent != NULL; lent = lent->next)
6166 + if ((lent->flagfield & (USED | KEEP)) == (USED | KEEP))
6168 + *sortptr++ = lent;
6169 +#ifndef NO_CAPITALIZATION_SUPPORT
6170 + while (lent->flagfield & MOREVARIANTS)
6171 + lent = lent->next;
6176 + for (cent = hashtbl, ehtab = hashtbl + hashsize; cent < ehtab; cent++)
6178 + if ((cent->flagfield & (USED | KEEP)) == (USED | KEEP))
6180 +#ifndef NO_CAPITALIZATION_SUPPORT
6181 + if (captype (cent->flagfield) != FOLLOWCASE
6182 + && cent->word != NULL)
6184 + *sortptr++ = cent;
6187 + /* Sort the list */
6188 + qsort ((char *) sortlist, (unsigned) pdictsize,
6189 + sizeof (sortlist[0]),
6190 + (int (*) (const void *, const void *)) pdictcmp);
6191 + /* Write it out */
6192 + for (sortptr = sortlist; --pdictsize >= 0; )
6193 + toutent (dictf, *sortptr++, 1);
6194 + free ((char *) sortlist);
6199 + (void) fclose (dictf);
6202 +#ifdef REGEX_LOOKUP
6204 +/* check the hashed dictionary for words matching the regex. return the */
6205 +/* a matching string if found else return NULL */
6208 + char * expr, /* regular expression to use in the match */
6209 + int whence) /* 0 = start at the beg with new regx, else */
6210 + /* continue from cur point w/ old regex */
6212 + static struct dent * curent;
6213 + static int curindex;
6214 + static struct dent * curpersent;
6215 + static int curpersindex;
6216 + static REGCTYPE cmp_expr = (REGCTYPE)0;
6217 + char dummy[INPUTWORDLEN + MAXAFFIXLEN];
6222 + is = strtosichar (expr, 0);
6224 + expr = ichartosstr (is, 1);
6225 + REGFREE (cmp_expr); /* free previous compiled pattern, if any */
6226 + cmp_expr = REGCMP (cmp_expr, expr);
6229 + curpersent = pershtab;
6233 + /* search the dictionary until the word is found or the words run out */
6234 + for ( ; curindex < hashsize; curent++, curindex++)
6236 + if (curent->word != NULL
6237 + && REGEX (cmp_expr, curent->word, dummy) != NULL)
6240 + /* Everybody's gotta write a wierd expression once in a while! */
6241 + return curent++->word;
6244 + /* Try the personal dictionary too */
6245 + for ( ; curpersindex < pershsize; curpersent++, curpersindex++)
6247 + if ((curpersent->flagfield & USED) != 0
6248 + && curpersent->word != NULL
6249 + && REGEX (cmp_expr, curpersent->word, dummy) != NULL)
6252 + /* Everybody's gotta write a wierd expression once in a while! */
6253 + return curpersent++->word;
6258 +#endif /* REGEX_LOOKUP */
6259 diff -urBbN vim64.org/src/spell/util.c vim64/src/spell/util.c
6260 --- vim64.org/src/spell/util.c 1970-01-01 01:00:00.000000000 +0100
6261 +++ vim64/src/spell/util.c 2005-10-17 12:49:17.520833176 +0200
6264 +#include "ispell.h"
6266 +Local char *myrindex(char *s, char c);
6272 + int canonical) /* NZ for canonical string chars */
6274 + register ichar_t * ap;
6275 + register ichar_t * bp;
6276 + ichar_t inta[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
6277 + ichar_t intb[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
6279 + (void) strtoichar (inta, a, sizeof inta, canonical);
6280 + (void) strtoichar (intb, b, sizeof intb, canonical);
6281 + for (ap = inta, bp = intb; *ap != 0; ap++, bp++)
6286 + return hashheader.sortorder[*ap];
6287 + else if (mylower (*ap))
6289 + if (mylower (*bp) || mytoupper (*ap) != *bp)
6290 + return (int) hashheader.sortorder[*ap] -
6291 + (int) hashheader.sortorder[*bp];
6295 + if (myupper (*bp) || mytolower (*ap) != *bp)
6296 + return (int) hashheader.sortorder[*ap] -
6297 + (int) hashheader.sortorder[*bp];
6302 + return -(int) hashheader.sortorder[*bp];
6303 + for (ap = inta, bp = intb; *ap; ap++, bp++)
6307 + return (int) hashheader.sortorder[*ap] -
6308 + (int) hashheader.sortorder[*bp];
6316 + register ichar_t * word,
6317 + register ichar_t * pattern,
6322 + struct dent * firstdent,
6323 + struct flagent * pfxent,
6324 + struct flagent * sufent)
6326 + int i; /* Index into savearea */
6327 + ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN];
6328 + int nsaved; /* Number of words saved */
6331 + save_root_cap (word, pattern, prestrip, preadd, sufstrip, sufadd,
6332 + firstdent, pfxent, sufent, savearea, &nsaved);
6333 + for (i = 0; i < nsaved; i++)
6335 + if (insert (savearea[i]) < 0)
6343 + register ichar_t * word, /* Word to be saved */
6344 + register ichar_t * pattern, /* Capitalization pattern */
6345 + int prestrip, /* No. chars stripped from front */
6346 + int preadd, /* No. chars added to front of root */
6347 + int sufstrip, /* No. chars stripped from back */
6348 + int sufadd, /* No. chars added to back of root */
6349 + struct dent * firstdent, /* First dent for root */
6350 + struct flagent * pfxent, /* Pfx-flag entry for word */
6351 + struct flagent * sufent, /* Sfx-flag entry for word */
6352 + ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN],
6353 + /* Room to save words */
6354 + int * nsaved) /* Number saved so far (updated) */
6356 +#ifndef NO_CAPITALIZATION_SUPPORT
6357 + register struct dent * dent;
6358 +#endif /* NO_CAPITALIZATION_SUPPORT */
6360 + ichar_t newword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
6361 +#ifndef NO_CAPITALIZATION_SUPPORT
6362 + register ichar_t * p;
6366 +#endif /* NO_CAPITALIZATION_SUPPORT */
6368 + if (*nsaved >= MAX_CAPS)
6370 + (void) icharcpy (newword, word);
6371 + firstisupper = myupper (pattern[0]);
6372 +#ifdef NO_CAPITALIZATION_SUPPORT
6374 + ** Apply the old, simple-minded capitalization rules.
6378 + if (myupper (pattern[1]))
6382 + lowcase (newword);
6383 + newword[0] = mytoupper (newword[0]);
6387 + lowcase (newword);
6388 + (void) icharcpy (savearea[*nsaved], newword);
6391 +#else /* NO_CAPITALIZATION_SUPPORT */
6392 +#define flagsareok(dent) \
6393 + ((pfxent == NULL \
6394 + || TSTMASKBIT (dent->mask, pfxent->flagbit)) \
6395 + && (sufent == NULL \
6396 + || TSTMASKBIT (dent->mask, sufent->flagbit)))
6399 + if ((dent->flagfield & (CAPTYPEMASK | MOREVARIANTS)) == ALLCAPS)
6401 + upcase (newword); /* Uppercase required */
6402 + (void) icharcpy (savearea[*nsaved], newword);
6406 + for (p = pattern; *p; p++)
6413 + upcase (newword); /* Pattern was all caps */
6414 + (void) icharcpy (savearea[*nsaved], newword);
6418 + for (p = pattern + 1; *p; p++)
6426 + ** The pattern was all-lower or capitalized. If that's
6427 + ** legal, insert only that version.
6431 + if (captype (dent->flagfield) == CAPITALIZED
6432 + || captype (dent->flagfield) == ANYCASE)
6434 + lowcase (newword);
6435 + newword[0] = mytoupper (newword[0]);
6436 + (void) icharcpy (savearea[*nsaved], newword);
6443 + if (captype (dent->flagfield) == ANYCASE)
6445 + lowcase (newword);
6446 + (void) icharcpy (savearea[*nsaved], newword);
6451 + while (dent->flagfield & MOREVARIANTS)
6453 + dent = dent->next;
6454 + if (captype (dent->flagfield) == FOLLOWCASE
6455 + || !flagsareok (dent))
6459 + if (captype (dent->flagfield) == CAPITALIZED)
6461 + lowcase (newword);
6462 + newword[0] = mytoupper (newword[0]);
6463 + (void) icharcpy (savearea[*nsaved], newword);
6470 + if (captype (dent->flagfield) == ANYCASE)
6472 + lowcase (newword);
6473 + (void) icharcpy (savearea[*nsaved], newword);
6481 + ** Either the sample had complex capitalization, or the simple
6482 + ** capitalizations (all-lower or capitalized) are illegal.
6483 + ** Insert all legal capitalizations, including those that are
6484 + ** all-lower or capitalized. If the prototype is capitalized,
6485 + ** capitalized all-lower samples. Watch out for affixes.
6488 + p = strtosichar (dent->word, 1);
6489 + len = icharlen (p);
6490 + if (dent->flagfield & MOREVARIANTS)
6491 + dent = dent->next; /* Skip place-holder entry */
6494 + if (flagsareok (dent))
6496 + if (captype (dent->flagfield) != FOLLOWCASE)
6498 + lowcase (newword);
6499 + if (firstisupper || captype (dent->flagfield) == CAPITALIZED)
6500 + newword[0] = mytoupper (newword[0]);
6501 + (void) icharcpy (savearea[*nsaved], newword);
6503 + if (*nsaved >= MAX_CAPS)
6508 + /* Followcase is the tough one. */
6509 + p = strtosichar (dent->word, 1);
6510 + (void) bcopy ((char *) (p + prestrip),
6511 + (char *) (newword + preadd),
6512 + (len - prestrip - sufstrip) * sizeof (ichar_t));
6513 + if (myupper (p[prestrip]))
6515 + for (i = 0; i < preadd; i++)
6516 + newword[i] = mytoupper (newword[i]);
6520 + for (i = 0; i < preadd; i++)
6521 + newword[i] = mytolower (newword[i]);
6523 + limit = len + preadd + sufadd - prestrip - sufstrip;
6524 + i = len + preadd - prestrip - sufstrip;
6525 + p += len - sufstrip - 1;
6528 + for (p = newword + i; i < limit; i++, p++)
6529 + *p = mytoupper (*p);
6533 + for (p = newword + i; i < limit; i++, p++)
6534 + *p = mytolower (*p);
6536 + (void) icharcpy (savearea[*nsaved], newword);
6538 + if (*nsaved >= MAX_CAPS)
6542 + if ((dent->flagfield & MOREVARIANTS) == 0)
6543 + break; /* End of the line */
6544 + dent = dent->next;
6547 +#endif /* NO_CAPITALIZATION_SUPPORT */
6550 +insert(register ichar_t * word)
6553 + register char * realword;
6555 + realword = ichartosstr (word, 0);
6556 + for (i = 0; i < pcount; i++)
6557 + if (strcmp (possibilities[i], realword) == 0)
6560 + (void) strcpy (possibilities[pcount++], realword);
6561 + i = strlen (realword);
6562 + if (i > maxposslen)
6564 + if (pcount >= MAXPOSSIBLE)
6570 +** A trivial wrapper for rindex (file '/') on Unix, but
6571 +** saves a lot of ifdef-ing on MS-DOS.
6575 +last_slash (char *file)
6578 + char *slash = myrindex (file, '/');
6581 + ** Can have a backslash or a colon; both mean the basename
6582 + ** begins right after them.
6584 + char *bs = myrindex (file, '\\');
6587 + ** We can have both forward- and backslashes; return the
6588 + ** place of rightmost one of either gender.
6590 + if (slash == NULL || (bs != NULL && bs > slash))
6592 + if (slash == NULL && file[0] != '\0' && file[1] == ':')
6599 +myrindex(char *s, register char c)
6604 + x = s + strlen(s) - 1;
6614 diff -urBbN vim64.org/src/spell/version.h vim64/src/spell/version.h
6615 --- vim64.org/src/spell/version.h 1970-01-01 01:00:00.000000000 +0100
6616 +++ vim64/src/spell/version.h 2005-10-17 12:49:17.521833024 +0200
6619 + * Since the strings in this file are printed out when the "-v" switch is
6620 + * given to ispell, you may want to translate them into your native language.
6621 + * However, any translation of these strings MUST accurately preserve the
6622 + * legal rights under international law; you may wish to consult a lawyer
6623 + * about this since you will be responsible for the results of any
6624 + * incorrect translation.
6627 +Local char *Version_ID[] = {
6628 + "@(#) International Ispell Version 3.1.20 10/10/95",
6629 + "@(#) Copyright (c), 1983, by Pace Willisson",
6630 + "@(#) International version Copyright (c) 1987, 1988, 1990-1995,",
6631 + "@(#) by Geoff Kuenning, Granada Hills, CA. All rights reserved.",
6633 + "@(#) Redistribution and use in source and binary forms, with or without",
6634 + "@(#) modification, are permitted provided that the following conditions",
6637 + "@(#) 1. Redistributions of source code must retain the above copyright",
6638 + "@(#) notice, this list of conditions and the following disclaimer.",
6639 + "@(#) 2. Redistributions in binary form must reproduce the above",
6640 + "@(#) copyright notice, this list of conditions and the following",
6641 + "@(#) disclaimer in the documentation and/or other materials provided",
6642 + "@(#) with the distribution.",
6643 + "@(#) 3. All modifications to the source code must be clearly marked as",
6644 + "@(#) such. Binary redistributions based on modified source code",
6645 + "@(#) must be clearly marked as modified versions in the documentation",
6646 + "@(#) and/or other materials provided with the distribution.",
6647 + "@(#) 4. All advertising materials mentioning features or use of this",
6648 + "@(#) software must display the following acknowledgment:",
6649 + "@(#) This product includes software developed by Geoff Kuenning and",
6650 + "@(#) other unpaid contributors.",
6651 + "@(#) 5. The name of Geoff Kuenning may not be used to endorse or promote",
6652 + "@(#) products derived from this software without specific prior",
6653 + "@(#) written permission.",
6655 + "@(#) THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS",
6656 + "@(#) IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT",
6657 + "@(#) LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS",
6658 + "@(#) FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GEOFF",
6659 + "@(#) KUENNING OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,",
6660 + "@(#) INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
6661 + "@(#) (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR",
6662 + "@(#) SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)",
6663 + "@(#) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,",
6664 + "@(#) STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)",
6665 + "@(#) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED",
6666 + "@(#) OF THE POSSIBILITY OF SUCH DAMAGE.",
6670 +static char RCS_Version_ID[] =
6675 + * Revision 1.44 1995/10/11 05:03:28 geoff
6676 + * Upgrade to patch level 20
6678 + * Revision 1.43 1995/10/11 04:58:26 geoff
6679 + * Upgrade to patch 19
6681 + * Revision 1.42 1995/01/15 01:23:26 geoff
6682 + * Upgrade to patch level 18
6684 + * Revision 1.41 1995/01/15 01:14:30 geoff
6685 + * Upgrade to patch level 17
6687 + * Revision 1.40 1995/01/15 01:03:55 geoff
6688 + * Upgrade to patch level 16
6690 + * Revision 1.39 1995/01/15 01:01:01 geoff
6691 + * Upgrade to patch level 15
6693 + * Revision 1.38 1995/01/15 00:54:19 geoff
6694 + * Upgrade to patch level 14
6696 + * Revision 1.37 1994/11/21 07:03:01 geoff
6697 + * Update to patch level 13.
6699 + * Revision 1.36 1994/11/01 06:28:31 geoff
6700 + * Update to patch level 12
6702 + * Revision 1.35 1994/11/01 06:12:42 geoff
6703 + * Update to patch level 11
6705 + * Revision 1.34 1994/11/01 06:01:15 geoff
6706 + * Update to patch level 10
6708 + * Revision 1.33 1994/11/01 05:36:43 geoff
6709 + * Update to patch level 9
6711 + * Revision 1.32 1994/05/25 04:38:59 geoff
6712 + * Update to patch level 8
6714 + * Revision 1.31 1994/05/18 03:07:26 geoff
6715 + * Update to patch level 7
6717 + * Revision 1.30 1994/05/17 06:21:05 geoff
6718 + * Version update for ispell.el release
6720 + * Revision 1.29 1994/04/27 04:14:18 geoff
6721 + * Update to patch level 5
6723 + * Revision 1.28 1994/03/21 02:00:50 geoff
6724 + * Update to patch level 4
6726 + * Revision 1.27 1994/02/23 04:52:31 geoff
6727 + * Update to latest version.
6729 + * Revision 1.26 1994/02/08 05:59:20 geoff
6732 + * Revision 1.25 1994/02/07 08:58:28 geoff
6733 + * Get rid of a comma that confuses patch
6735 + * Revision 1.24 1994/02/07 08:24:23 geoff
6736 + * Upate patch level
6738 + * Revision 1.23 1994/01/25 07:12:21 geoff
6739 + * Get rid of all old RCS log lines in preparation for the 3.1 release.
6742 diff -urBbN vim64.org/src/spell/wm.h vim64/src/spell/wm.h
6743 --- vim64.org/src/spell/wm.h 1970-01-01 01:00:00.000000000 +0100
6744 +++ vim64/src/spell/wm.h 2005-10-17 12:49:17.521833024 +0200
6747 +enum _logical {False,True};
6748 +typedef enum _logical Logical;
6752 +typedef unsigned int Word;
6753 +typedef unsigned char Byte;
6756 +#define Local static
6758 diff -urBbN vim64.org/src/spell.c vim64/src/spell.c
6759 --- vim64.org/src/spell.c 1970-01-01 01:00:00.000000000 +0100
6760 +++ vim64/src/spell.c 2005-10-17 12:49:17.522832872 +0200
6762 +#include "spell/wm.h"
6765 +#include "ispell.h"
6766 +#define MAXWORDLEN 80
6768 +#ifdef FEAT_SPELL_HL
6770 +int spell_flag = 0;
6773 +ex_spell(exarg_T *eap)
6776 + if(strcmp(eap->arg, "on") == 0)
6781 + if(!reload_dict())
6785 + else if(STRCMP(eap->arg, "off") == 0)
6788 + EMSG2("Invalid :spell %s", eap->arg);
6789 + redraw_all_later(NOT_VALID);
6797 + if(spell_flag == 0)
6799 + spell_save_private_dict();
6801 + if(STRCMP(p_spell_lang, "") == 0)
6803 + EMSG("dictionary not defined");
6804 + do_cmdline((char_u *)"spell off", NULL, NULL, DOCMD_VERBOSE);
6808 + if ((err = linit(hashname)) != NULL)
6811 + do_cmdline((char_u *)"spell off", NULL, NULL, DOCMD_VERBOSE);
6815 + treeinit (NULL, p_spell_lang);
6819 +static colnr_T last_col;
6820 +static ichar_t curr_word[MAXWORDLEN + 1]; /* assume max. keyword len is 80 */
6821 +static char word_to_spell[MAXWORDLEN + 1];
6823 +static Logical in_word;
6825 +int my_is_char(char_u ccc);
6828 +get_spell_attr(spell_col, col, line)
6829 + colnr_T spell_col;
6837 + if(spell_col == 0)
6838 + last_col = 0, in_word = False, last_attr = 0;
6840 + if((spell_col < last_col) && in_word)
6841 + return(last_attr);
6842 + else if(spell_col >= last_col)
6846 + line_ptr = &line[spell_col];
6847 + curr_col = spell_col;
6848 + if(iswordch((ichar_t)(*line_ptr)) && *line_ptr)
6850 + while((spell_col > 0) && my_is_char(*(line_ptr - 1)))
6851 + spell_col--, line_ptr--;
6852 + while(isboundarych((ichar_t)(*(line_ptr))))
6853 + spell_col++, line_ptr++;
6855 + line_ptr = &line[spell_col];
6856 + curr_col = spell_col;
6857 + while(my_is_char(*line_ptr) && *line_ptr &&
6858 + ((curr_col - spell_col) < MAXWORDLEN))
6859 + curr_col++, line_ptr++;
6860 + while(isboundarych((ichar_t)(*(line_ptr - 1))))
6861 + curr_col--, line_ptr--;
6863 + if(curr_col - spell_col > 1)
6865 + /*for(i = 0; i < curr_col - spell_col; i++)
6866 + curr_word[i] = line[spell_col + i];
6867 + curr_word[curr_col - spell_col] = NUL;*/
6868 + strtoichar(curr_word,line+spell_col,(curr_col-spell_col+1)*sizeof(ichar_t),0);
6871 +/* for(i = 0; curr_word[i]; i++)
6872 + fprintf(stderr, "%c", curr_word[i]);
6873 + fprintf(stderr, "-%d\n", good((ichar_t *)curr_word, 0, 0, 0, 0)); wm */
6874 + if(good((ichar_t *)curr_word, 0, 0, 0, 0) == 0)
6875 + last_attr = hl_attr(HLF_SPELL);
6876 + last_col = curr_col;
6879 + return(last_attr);
6886 + if(iswordch((ichar_t)ccc) || isboundarych((ichar_t)ccc))
6893 +static ichar_t *itok;
6896 +set_to_private_dict(char *line, int cursor_col, int convert_to_lower)
6903 + b = line + cursor_col;
6907 + if(iswordch((ichar_t)(*b)) || isboundarych((ichar_t)(*b)))
6909 + while((iswordch((ichar_t)(*(b - 1))) ||
6910 + isboundarych((ichar_t)(*(b - 1)))) &&
6912 + b--, cursor_col--;
6913 + while(isboundarych((ichar_t)(*b)))
6915 + while((iswordch((ichar_t)(*(e))) || isboundarych((ichar_t)(*(e)))) &&
6918 + while(isboundarych((ichar_t)(*(e - 1))))
6920 + for(i = 0; b < e;)
6921 + word_to_spell[i++] = *b++;
6922 + word_to_spell[i] = '\0';
6923 + if(!convert_to_lower)
6924 + treeinsert (ichartosstr (strtosichar (word_to_spell, 0), 1),
6925 + ICHARTOSSTR_SIZE, 1);
6928 + itok = strtosichar (word_to_spell, 0);
6930 + treeinsert (ichartosstr (itok, 1), ICHARTOSSTR_SIZE, 1);
6932 + redraw_all_later(NOT_VALID);
6938 +spell_save_private_dict(void)
6945 diff -urBbN vim64.org/src/syntax.c vim64/src/syntax.c
6946 --- vim64.org/src/syntax.c 2005-07-24 19:39:04.000000000 +0200
6947 +++ vim64/src/syntax.c 2005-10-17 12:49:17.527832112 +0200
6948 @@ -5935,6 +5935,9 @@
6949 "VertSplit term=reverse cterm=reverse gui=reverse",
6950 "Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg",
6951 "VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold",
6952 +#ifdef FEAT_SPELL_HL
6953 + "Spell term=reverse ctermbg=NONE ctermfg=White guibg=NONE guifg=Red",
6955 "DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red",
6958 @@ -5955,6 +5958,9 @@
6959 "FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
6960 "SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
6961 "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue",
6962 +#ifdef FEAT_SPELL_HL
6963 + "Spell term=reverse ctermbg=NONE ctermfg=White guibg=NONE guifg=Red",
6965 "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta",
6966 "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan",
6968 @@ -5976,6 +5982,9 @@
6969 "FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
6970 "SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
6971 "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue",
6972 +#ifdef FEAT_SPELL_HL
6973 + "Spell term=reverse ctermbg=NONE ctermfg=White guibg=NONE guifg=Red",
6975 "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta",
6976 "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan",
6978 diff -urBbN vim64.org/src/version.c vim64/src/version.c
6979 --- vim64.org/src/version.c 2005-10-17 12:43:54.788895000 +0200
6980 +++ vim64/src/version.c 2005-10-17 12:49:17.529831808 +0200
6981 @@ -474,6 +474,11 @@
6985 +#ifdef FEAT_SPELL_HL
6990 /* only interesting on Unix systems */
6991 #if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__))
6993 @@ -1135,7 +1140,7 @@
7002 diff -urBbN vim64.org/src/version.h vim64/src/version.h
7003 --- vim64.org/src/version.h 2005-10-15 13:21:16.000000000 +0200
7004 +++ vim64/src/version.h 2005-10-17 12:50:20.563249272 +0200
7007 #define VIM_VERSION_NODOT "vim64"
7008 #define VIM_VERSION_SHORT "6.4"
7009 +#ifdef FEAT_SPELL_HL
7010 +#define VIM_VERSION_MEDIUM "6.4 + ispell 3.1.20 WM-3"
7012 #define VIM_VERSION_MEDIUM "6.4"
7014 #define VIM_VERSION_LONG "VIM - Vi IMproved 6.4 (2005 Oct 15)"
7015 #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 6.4 (2005 Oct 15, compiled "
7016 diff -urBbN vim64.org/src/vim.h vim64/src/vim.h
7017 --- vim64.org/src/vim.h 2005-10-08 16:22:05.000000000 +0200
7018 +++ vim64/src/vim.h 2005-10-17 12:49:17.532831352 +0200
7019 @@ -1076,13 +1076,14 @@
7020 , HLF_DED /* Deleted diff line */
7021 , HLF_TXD /* Text Changed in diff line */
7022 , HLF_SC /* Sign column */
7023 + , HLF_SPELL /* spell - string in dictionary WM */
7024 , HLF_COUNT /* MUST be the last one */
7027 /* the HL_FLAGS must be in the same order as the HLF_ enums! */
7028 #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
7029 'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
7030 - 'f', 'F', 'A', 'C', 'D', 'T', '>'}
7031 + 'f', 'F', 'A', 'C', 'D', 'T', '>', 'Z'}