4 // some maximum sizes for buffers
6 #define MAX_LN_LEN 16384
9 // a meaning with definition, count of synonyms and synonym list
20 int nw; /* number of entries in thesaurus */
21 char** list; /* stores word list */
22 unsigned int* offst; /* stores offset list */
23 char * encoding; /* stores text encoding; */
27 // disallow copy-constructor and assignment-operator for now
29 MyThes(const MyThes &);
30 MyThes & operator = (const MyThes &);
33 MyThes(const char* idxpath, const char* datpath);
36 // lookup text in index and return number of meanings
37 // each meaning entry has a defintion, synonym count and pointer
38 // when complete return the *original* meaning entry and count via
39 // CleanUpAfterLookup to properly handle memory deallocation
41 int Lookup(const char * pText, int len, mentry** pme);
43 void CleanUpAfterLookup(mentry** pme, int nmean);
45 char* get_th_encoding();
48 // Open index and dat files and load list array
49 int thInitialize (const char* indxpath, const char* datpath);
51 // internal close and cleanup dat and idx files
54 // read a text line (\n terminated) stripping off line terminator
55 int readLine(FILE * pf, char * buf, int nc);
57 // binary search on null terminated character strings
58 int binsearch(char * wrd, char* list[], int nlst);
60 // string duplication routine
61 char * mystrdup(const char * p);
63 // remove cross-platform text line end characters
64 void mychomp(char * s);
66 // return index of char in string
67 int mystr_indexOfChar(const char * d, int c);