antoine-source/appleworksgs/Spell/Inc/THESMISC.H

1 line
6.6 KiB
C++
Raw Normal View History

2023-03-04 02:45:20 +00:00
/***********************************************************************\ Filename: thesmisc.h \***********************************************************************/ #ifndef SC_THESMISC #define SC_THESMISC #ifndef _PROXLIB #include "proxlib.h" #endif #ifndef SC_SCDEF #include "scdef.h" #endif #ifndef SC_THES #include "thes.h" #endif /* flags set in control nibble of a meaning */ /* if corresponding lists are present */ /* HAS_SYN is not defined because it is always true */ #define HAS_CMP 0x10 #define HAS_REL 0x20 #define HAS_CON 0x40 #define HAS_ANT 0x80 /* general parameters and flags */ #define MAXINDEX 2048 /* max length of thes bin index */ #define LASTLIST 0x800000L /* set for last meaning of a word */ #define LASTMEAN 0x780000L /* set for last entry of a meaning */ #define LEXBITS 0x07FFFFL /* mask for lexicon address bits */ #define OVERFLOW 0x10000L /* 64K */ #define CODEFLD 8 #define CODEBITS 0x000FFL #define BINBITS 0x1FF00L #define IBINHDR 32 /* size of the i-bin headers */ #define INDFLD 14 #define INDFLAG 0x2000 #define INDBITS 0x1FFF #define MEANFLD 4 #define MEANBITS 0x000F #define MBINBITS 0x1FF0 #define DIRBITS 0x1FFFFL #define BLKBITS 0xFE00L #define WORDFLD 9 #define WORDBITS 0x001FFL #define POSBITS 0xF #define LISTFLD 4 #define LISTBITS 0xF0 #define LISTMAX 0xF #define HS_VERB 0x08000000L #define HS_NOUN 0x10000000L #define HS_INF 0x20000000L #define HS_SEEN 0x40000000L #define HS_SKIP 0x80000000L #define INFCODE 1 #define UNFCODE 0 #define UNFSEP '/' #define INFSEP '\016' #define binnum(whash) (((whash) & BINBITS) >> CODEFLD) #define codeval(whash) ((whash) & CODEBITS) #define indval(indhash) ((indhash) & INDBITS) #define meannum(mhash) ((mhash) & MEANBITS) #define meanbin(mhash) (((mhash) & MBINBITS) >> MEANFLD) #define eofind(mhash) (((mhash) & INDFLAG) == INDFLAG) #define wordno(dirhash) ((dirhash) & WORDBITS) #define blkno(dirhash) (((dirhash) & BLKBITS) >> WORDFLD) #define isset(hval,bval) (((hval) & (bval)) == (bval)) /* this defines the mode in which only the exceptions that go from */ /* inflection to root is found */ #define UNF_IR 0xFF /* function declarations */ long thesbit(); #define MAXREF 6 /* macros to test controls */ #define thunftst() (Thqcontrol & TH_INFPOS) #define thinftst(mi,ui) ((mi)>=(ui)) #define thpostst(pos) (Thqcontrol & (1 << pos)) /* structure to hold information about an unflectable ending */ typedef struct { char *en_end; /* the ending */ short en_len; /* length of ending */ short en_class; /* which class the ending falls into */ short en_pos; /* part of speech of unflected form */ short en_rel; /* how the root and inflection are related */ } END; extern short Thesprod; /* product type */ extern short Theswrev; /* word list type used */ extern short Thesnibin; /* size of ibin index table */ extern short Thesniadd; /* size of ioverflow add table */ extern short Thesnmbin; /* size of mbin index table */ extern short Thesnmadd; /* size of moverflow add table */ extern short Theslcode; /* length of longest huffman code */ extern short Thesnchars; /* number of entries in Thesxlate */ extern short Thesstrsiz; /* max. length of the lists */ extern short Thesmaxdef; /* length of longest definition */ extern short Thesmaxhash; /* max. number of words in the lists */ extern short Thesnumstr; /* no. of encoded words in the definitions */ extern short Thestotstr; /* */ extern short Thesdirfld; /* length of the direct hashes */ extern short Thesposfld; /* length of the POS field */ extern char *Theshuffstr; extern char **Theshuffind; /* thesa