Tizen 2.1 base
[external/enchant.git] / src / myspell / htypes.hxx
1 #ifndef _HTYPES_HXX_
2 #define _HTYPES_HXX_
3
4 #define ROTATE_LEN   5
5
6 #define ROTATE(v,q) \
7    (v) = ((v) << (q)) | (((v) >> (32 - q)) & ((1 << (q))-1));
8
9 // hentry options
10 #define H_OPT        (1 << 0)
11 #define H_OPT_ALIASM (1 << 1)
12 #define H_OPT_PHON   (1 << 2)
13
14 // see also csutil.hxx
15 #define HENTRY_WORD(h) &(h->word[0])
16
17 // approx. number  of user defined words
18 #define USERWORD 1000
19
20 struct hentry
21 {
22   unsigned char blen; // word length in bytes
23   unsigned char clen; // word length in characters (different for UTF-8 enc.)
24   short    alen;      // length of affix flag vector
25   unsigned short * astr;  // affix flag vector
26   struct   hentry * next; // next word with same hash code
27   struct   hentry * next_homonym; // next homonym word (with same hash code)
28   char     var;       // variable fields (only for special pronounciation yet)
29   char     word[1];   // variable-length word (8-bit or UTF-8 encoding)
30 };
31
32 #endif