htypes.hxx 924 B

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