34 #include <sys/types.h>
259 #include "ispell_def.h"
267 #define MAXAFFIXLEN 20
290 extern int gnMaskBits;
305 #define MASKTYPE long
307 #ifndef MASKTYPE_WIDTH
308 #define MASKTYPE_WIDTH 32
313 #if MASKBITS < MASKTYPE_WIDTH
315 #define MASKBITS MASKTYPE_WIDTH
331 #ifndef MAXSTRINGCHARS
332 #define MAXSTRINGCHARS 128
339 #ifndef MAXSTRINGCHARLEN
340 #define MAXSTRINGCHARLEN 10
367 #define MAXPATHLEN 512
382 #if defined(__STDC__) || defined(__cplusplus)
401 #define MASKSIZE (gnMaskBits / MASKTYPE_WIDTH)
404 extern int TSTMASKBIT P ((MASKTYPE * mask,
int bit));
407 #define TSTMASKBIT(mask, bit) \
408 ((mask)[(bit) / MASKTYPE_WIDTH] & \
409 ((MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1))))
417 #define FLAGBASE ((MASKTYPE_WIDTH) - 6)
420 #define FLAGBASE ((MASKTYPE_WIDTH) - 6)
430 #if (SET_SIZE + MAXSTRINGCHARS) <= 256
432 #define ICHAR_IS_CHAR
437 typedef unsigned char ichar_t;
438 #define icharlen(s) strlen ((char *) (s))
439 #define icharcpy(a, b) strcpy ((char *) (a), (char *) (b))
440 #define icharcmp(a, b) strcmp ((char *) (a), (char *) (b))
441 #define icharncmp(a, b, n) strncmp ((char *) (a), (char *) (b), (n))
442 #define chartoichar(x) ((ichar_t) (x))
444 typedef unsigned short ichar_t;
445 #define chartoichar(x) ((ichar_t) (unsigned char) (x))
453 struct dent * dictent;
454 struct flagent * prefix;
455 struct flagent * suffix;
458 ichar_t* icharcpy (ichar_t* out, ichar_t* in);
459 int icharlen (ichar_t* in);
460 int icharcmp (ichar_t* s1, ichar_t* s2);
461 int icharncmp (ichar_t* s1, ichar_t* s2,
int n);
542 #define flagfield flags
544 #define flagfield mask[1]
546 #define USED ((MASKTYPE) 1 << (FLAGBASE + 0))
547 #define KEEP ((MASKTYPE) 1 << (FLAGBASE + 1))
548 #ifdef NO_CAPITALIZATION_SUPPORT
549 #define ALLFLAGS (USED | KEEP)
551 #define ANYCASE ((MASKTYPE) 0 << (FLAGBASE + 2))
552 #define ALLCAPS ((MASKTYPE) 1 << (FLAGBASE + 2))
553 #define CAPITALIZED ((MASKTYPE) 2 << (FLAGBASE + 2))
554 #define FOLLOWCASE ((MASKTYPE) 3 << (FLAGBASE + 2))
555 #define CAPTYPEMASK ((MASKTYPE) 3 << (FLAGBASE + 2))
556 #define MOREVARIANTS ((MASKTYPE) 1 << (FLAGBASE + 4))
557 #define ALLFLAGS (USED | KEEP | CAPTYPEMASK | MOREVARIANTS)
558 #define captype(x) ((x) & CAPTYPEMASK)
573 char conds[SET_SIZE + MAXSTRINGCHARS];
579 #define FF_CROSSPRODUCT (1 << 0)
580 #define FF_COMPOUNDONLY (1 << 1)
585 struct flagent * ent;
609 unsigned short magic;
610 unsigned short compileoptions;
611 short maxstringchars;
612 short maxstringcharlen;
629 unsigned short sortorder[SET_SIZE + MAXSTRINGCHARS];
630 ichar_t lowerconv[SET_SIZE + MAXSTRINGCHARS];
631 ichar_t upperconv[SET_SIZE + MAXSTRINGCHARS];
632 char wordchars[SET_SIZE + MAXSTRINGCHARS];
633 char upperchars[SET_SIZE + MAXSTRINGCHARS];
634 char lowerchars[SET_SIZE + MAXSTRINGCHARS];
635 char boundarychars[SET_SIZE + MAXSTRINGCHARS];
636 char stringstarts[SET_SIZE];
637 char stringchars[MAXSTRINGCHARS][MAXSTRINGCHARLEN + 1];
638 unsigned int stringdups[MAXSTRINGCHARS];
639 int dupnos[MAXSTRINGCHARS];
640 unsigned short magic2;
648 # define MAGIC8BIT 0x01
650 # define MAGIC8BIT 0x00
652 #ifdef NO_CAPITALIZATION_SUPPORT
653 # define MAGICCAPITALIZATION 0x00
655 # define MAGICCAPITALIZATION 0x02
657 # define MAGICMASKSET 0x04
660 # define MAGICMASKSET 0x00
665 # define MAGICMASKSET 0x08
667 # define MAGICMASKSET 0x0C
672 #define COMPILEOPTIONS (MAGIC8BIT | MAGICCAPITALIZATION | MAGICMASKSET)
677 #define NRLEFTPAREN hashheader.nrchars[0]
678 #define NRRIGHTPAREN hashheader.nrchars[1]
679 #define NRDOT hashheader.nrchars[2]
680 #define NRBACKSLASH hashheader.nrchars[3]
681 #define NRSTAR hashheader.nrchars[4]
686 #define TEXLEFTPAREN hashheader.texchars[0]
687 #define TEXRIGHTPAREN hashheader.texchars[1]
688 #define TEXLEFTSQUARE hashheader.texchars[2]
689 #define TEXRIGHTSQUARE hashheader.texchars[3]
690 #define TEXLEFTCURLY hashheader.texchars[4]
691 #define TEXRIGHTCURLY hashheader.texchars[5]
692 #define TEXLEFTANGLE hashheader.texchars[6]
693 #define TEXRIGHTANGLE hashheader.texchars[7]
694 #define TEXBACKSLASH hashheader.texchars[8]
695 #define TEXDOLLAR hashheader.texchars[9]
696 #define TEXSTAR hashheader.texchars[10]
697 #define TEXDOT hashheader.texchars[11]
698 #define TEXPERCENT hashheader.texchars[12]
703 #define COMPOUND_NEVER 0
704 #define COMPOUND_ANYTIME 1
705 #define COMPOUND_CONTROLLED 2
722 #define isstringch(ptr, canon) (isstringstart (*(ptr)) \
723 && stringcharlen ((ptr), (canon)) > 0)
724 #define l_isstringch(ptr, len, canon) \
725 (isstringstart (*(ptr)) \
726 && (len = stringcharlen ((ptr), (canon))) \
728 #define l1_isstringch(ptr, len, canon) \
730 isstringstart ((unsigned char)(*(ptr))) \
732 stringcharlen ((ptr), (canon))) \
740 #define ICHARTOSSTR_SIZE (INPUTWORDLEN + 4 * MAXAFFIXLEN + 4)
741 #define STRTOSICHAR_SIZE ((INPUTWORDLEN + 4 * MAXAFFIXLEN + 4) \
753 #define INIT(decl, init) decl = init
755 #define INIT(decl, init) extern decl
759 INIT (
int minimenusize, 2);
761 INIT (
int minimenusize, 0);
765 INIT (
int dumpflag, 0);
771 INIT (
int xflag, DEFNOBACKUPFLAG);
772 INIT (
int deftflag, -1);
773 INIT (
int tflag, DEFTEXFLAG);
774 INIT (
int prefstringchar, -1);
778 INIT (
char tempfile[MAXPATHLEN],
"");
780 INIT (
int minword, MINWORD);
781 INIT (
int sortit, 1);
782 INIT (
int compoundflag, -1);
783 INIT (
int tryhardflag, -1);
785 INIT (
char * currentfile, NULL);
788 INIT (
int math_mode, 0);
795 INIT (
char LaTeX_Mode,
'P');