Tizen 2.1 base
[external/enchant.git] / src / myspell / atypes.hxx
1 #ifndef _ATYPES_HXX_
2 #define _ATYPES_HXX_
3
4 #ifndef HUNSPELL_WARNING
5 #include <stdio.h>
6 #ifdef HUNSPELL_WARNING_ON
7 #define HUNSPELL_WARNING fprintf
8 #else
9 // empty inline function to switch off warnings (instead of the C99 standard variadic macros)
10 static inline void HUNSPELL_WARNING(FILE *, const char *, ...) {}
11 #endif
12 #endif
13
14 // HUNSTEM def.
15 #define HUNSTEM
16
17 #include "hashmgr.hxx"
18 #include "w_char.hxx"
19
20 #define SETSIZE         256
21 #define CONTSIZE        65536
22 #define MAXWORDLEN      100
23 #define MAXWORDUTF8LEN  256
24
25 // affentry options
26 #define aeXPRODUCT      (1 << 0)
27 #define aeUTF8          (1 << 1)
28 #define aeALIASF        (1 << 2)
29 #define aeALIASM        (1 << 3)
30 #define aeLONGCOND      (1 << 4)
31
32 // compound options
33 #define IN_CPD_NOT   0
34 #define IN_CPD_BEGIN 1
35 #define IN_CPD_END   2
36 #define IN_CPD_OTHER 3
37
38 // info options
39 #define  SPELL_COMPOUND  (1 << 0)
40 #define  SPELL_FORBIDDEN (1 << 1)
41 #define  SPELL_ALLCAP    (1 << 2)
42 #define  SPELL_NOCAP     (1 << 3)
43 #define  SPELL_INITCAP   (1 << 4)
44 #define  SPELL_ORIGCAP   (1 << 5)
45 #define  SPELL_WARN      (1 << 6)
46
47 #define MAXLNLEN        8192
48
49 #define MINCPDLEN       3
50 #define MAXCOMPOUND     10
51 #define MAXCONDLEN      20
52 #define MAXCONDLEN_1    (MAXCONDLEN - sizeof(char *))
53
54 #define MAXACC          1000
55
56 #define FLAG unsigned short
57 #define FLAG_NULL 0x00
58 #define FREE_FLAG(a) a = 0
59
60 #define TESTAFF( a, b , c ) flag_bsearch((unsigned short *) a, (unsigned short) b, c)
61
62 struct affentry
63 {
64    char * strip;
65    char * appnd;
66    unsigned char stripl;
67    unsigned char appndl;
68    char  numconds;
69    char  opts;
70    unsigned short aflag;
71    unsigned short * contclass;
72    short        contclasslen;
73    union {
74      char conds[MAXCONDLEN];
75      struct {
76        char conds1[MAXCONDLEN_1];
77        char * conds2;
78      } l;
79    } c;
80    char *       morphcode;
81 };
82
83 struct guessword {
84   char * word;
85   bool allow;
86   char * orig;
87 };
88
89 struct mapentry {
90   char ** set;
91   int len;
92 };
93
94 struct flagentry {
95   FLAG * def;
96   int len;
97 };
98
99 struct patentry {
100   char * pattern;
101   char * pattern2;
102   char * pattern3;
103   FLAG cond;
104   FLAG cond2;
105 };
106
107 #endif