33 #include <sys/types.h>
258 #include "ispell_def.h"
266 #define MAXAFFIXLEN 20
289 extern int gnMaskBits;
304 #define MASKTYPE long
306 #ifndef MASKTYPE_WIDTH
307 #define MASKTYPE_WIDTH 32
312 #if MASKBITS < MASKTYPE_WIDTH
314 #define MASKBITS MASKTYPE_WIDTH
330 #ifndef MAXSTRINGCHARS
331 #define MAXSTRINGCHARS 128
338 #ifndef MAXSTRINGCHARLEN
339 #define MAXSTRINGCHARLEN 10
366 #define MAXPATHLEN 512
381 #if defined(__STDC__) || defined(__cplusplus)
400 #define MASKSIZE (gnMaskBits / MASKTYPE_WIDTH)
403 extern int TSTMASKBIT P ((MASKTYPE * mask,
int bit));
406 #define TSTMASKBIT(mask, bit) \
407 ((mask)[(bit) / MASKTYPE_WIDTH] & \
408 ((MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1))))
416 #define FLAGBASE ((MASKTYPE_WIDTH) - 6)
419 #define FLAGBASE ((MASKTYPE_WIDTH) - 6)
429 #if (SET_SIZE + MAXSTRINGCHARS) <= 256
431 #define ICHAR_IS_CHAR
436 typedef unsigned char ichar_t;
437 #define icharlen(s) strlen ((char *) (s))
438 #define icharcpy(a, b) strcpy ((char *) (a), (char *) (b))
439 #define icharcmp(a, b) strcmp ((char *) (a), (char *) (b))
440 #define icharncmp(a, b, n) strncmp ((char *) (a), (char *) (b), (n))
441 #define chartoichar(x) ((ichar_t) (x))
443 typedef unsigned short ichar_t;
444 #define chartoichar(x) ((ichar_t) (unsigned char) (x))
452 struct dent * dictent;
453 struct flagent * prefix;
454 struct flagent * suffix;
457 ichar_t* icharcpy (ichar_t* out, ichar_t* in);
458 int icharlen (ichar_t* in);
459 int icharcmp (ichar_t* s1, ichar_t* s2);
460 int icharncmp (ichar_t* s1, ichar_t* s2,
int n);
541 #define flagfield flags
543 #define flagfield mask[1]
545 #define USED ((MASKTYPE) 1 << (FLAGBASE + 0))
546 #define KEEP ((MASKTYPE) 1 << (FLAGBASE + 1))
547 #ifdef NO_CAPITALIZATION_SUPPORT
548 #define ALLFLAGS (USED | KEEP)
550 #define ANYCASE ((MASKTYPE) 0 << (FLAGBASE + 2))
551 #define ALLCAPS ((MASKTYPE) 1 << (FLAGBASE + 2))
552 #define CAPITALIZED ((MASKTYPE) 2 << (FLAGBASE + 2))
553 #define FOLLOWCASE ((MASKTYPE) 3 << (FLAGBASE + 2))
554 #define CAPTYPEMASK ((MASKTYPE) 3 << (FLAGBASE + 2))
555 #define MOREVARIANTS ((MASKTYPE) 1 << (FLAGBASE + 4))
556 #define ALLFLAGS (USED | KEEP | CAPTYPEMASK | MOREVARIANTS)
557 #define captype(x) ((x) & CAPTYPEMASK)
572 char conds[SET_SIZE + MAXSTRINGCHARS];
578 #define FF_CROSSPRODUCT (1 << 0)
579 #define FF_COMPOUNDONLY (1 << 1)
584 struct flagent * ent;
608 unsigned short magic;
609 unsigned short compileoptions;
610 short maxstringchars;
611 short maxstringcharlen;
628 unsigned short sortorder[SET_SIZE + MAXSTRINGCHARS];
629 ichar_t lowerconv[SET_SIZE + MAXSTRINGCHARS];
630 ichar_t upperconv[SET_SIZE + MAXSTRINGCHARS];
631 char wordchars[SET_SIZE + MAXSTRINGCHARS];
632 char upperchars[SET_SIZE + MAXSTRINGCHARS];
633 char lowerchars[SET_SIZE + MAXSTRINGCHARS];
634 char boundarychars[SET_SIZE + MAXSTRINGCHARS];
635 char stringstarts[SET_SIZE];
636 char stringchars[MAXSTRINGCHARS][MAXSTRINGCHARLEN + 1];
637 unsigned int stringdups[MAXSTRINGCHARS];
638 int dupnos[MAXSTRINGCHARS];
639 unsigned short magic2;
647 # define MAGIC8BIT 0x01
649 # define MAGIC8BIT 0x00
651 #ifdef NO_CAPITALIZATION_SUPPORT
652 # define MAGICCAPITALIZATION 0x00
654 # define MAGICCAPITALIZATION 0x02
656 # define MAGICMASKSET 0x04
659 # define MAGICMASKSET 0x00
664 # define MAGICMASKSET 0x08
666 # define MAGICMASKSET 0x0C
671 #define COMPILEOPTIONS (MAGIC8BIT | MAGICCAPITALIZATION | MAGICMASKSET)
676 #define NRLEFTPAREN hashheader.nrchars[0]
677 #define NRRIGHTPAREN hashheader.nrchars[1]
678 #define NRDOT hashheader.nrchars[2]
679 #define NRBACKSLASH hashheader.nrchars[3]
680 #define NRSTAR hashheader.nrchars[4]
685 #define TEXLEFTPAREN hashheader.texchars[0]
686 #define TEXRIGHTPAREN hashheader.texchars[1]
687 #define TEXLEFTSQUARE hashheader.texchars[2]
688 #define TEXRIGHTSQUARE hashheader.texchars[3]
689 #define TEXLEFTCURLY hashheader.texchars[4]
690 #define TEXRIGHTCURLY hashheader.texchars[5]
691 #define TEXLEFTANGLE hashheader.texchars[6]
692 #define TEXRIGHTANGLE hashheader.texchars[7]
693 #define TEXBACKSLASH hashheader.texchars[8]
694 #define TEXDOLLAR hashheader.texchars[9]
695 #define TEXSTAR hashheader.texchars[10]
696 #define TEXDOT hashheader.texchars[11]
697 #define TEXPERCENT hashheader.texchars[12]
702 #define COMPOUND_NEVER 0
703 #define COMPOUND_ANYTIME 1
704 #define COMPOUND_CONTROLLED 2
721 #define isstringch(ptr, canon) (isstringstart (*(ptr)) \
722 && stringcharlen ((ptr), (canon)) > 0)
723 #define l_isstringch(ptr, len, canon) \
724 (isstringstart (*(ptr)) \
725 && (len = stringcharlen ((ptr), (canon))) \
727 #define l1_isstringch(ptr, len, canon) \
729 isstringstart ((unsigned char)(*(ptr))) \
731 stringcharlen ((ptr), (canon))) \
739 #define ICHARTOSSTR_SIZE (INPUTWORDLEN + 4 * MAXAFFIXLEN + 4)
740 #define STRTOSICHAR_SIZE ((INPUTWORDLEN + 4 * MAXAFFIXLEN + 4) \
752 #define INIT(decl, init) decl = init
754 #define INIT(decl, init) extern decl
758 INIT (
int minimenusize, 2);
760 INIT (
int minimenusize, 0);
764 INIT (
int dumpflag, 0);
770 INIT (
int xflag, DEFNOBACKUPFLAG);
771 INIT (
int deftflag, -1);
772 INIT (
int tflag, DEFTEXFLAG);
773 INIT (
int prefstringchar, -1);
777 INIT (
char tempfile[MAXPATHLEN],
"");
779 INIT (
int minword, MINWORD);
780 INIT (
int sortit, 1);
781 INIT (
int compoundflag, -1);
782 INIT (
int tryhardflag, -1);
784 INIT (
char * currentfile, NULL);
787 INIT (
int math_mode, 0);
794 INIT (
char LaTeX_Mode,
'P');