atypes.hxx 2.0 KB

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