viric@10: enum { viric@14: MAXWORD=200, viric@24: MAXDEF=100000, viric@17: END_OF_URL=-2, viric@17: HTTP_DECODE_ERROR=-3 viric@10: }; viric@10: viric@15: enum Case viric@15: { viric@15: LCASE = 0, viric@15: UCASE = 1 viric@15: }; viric@15: viric@0: struct Words viric@0: { viric@0: struct Word *first; viric@0: int length; viric@0: }; viric@0: viric@0: struct Word viric@0: { viric@0: char *w; viric@0: int def; viric@0: }; viric@0: viric@0: struct Def viric@0: { viric@0: char *d; viric@0: int offset; viric@0: int length; viric@0: }; viric@0: viric@17: struct Dict viric@17: { viric@17: unsigned char *index; viric@17: int indexfd; viric@17: int indexsize; viric@17: FILE *defs; viric@21: int trim_first_line; viric@21: int trim_last_newlines; viric@17: }; viric@17: viric@0: /* write.c */ viric@0: void write_dictionary(const char *name); viric@0: viric@0: /* dict.c */ viric@0: char * get_word(FILE *index); viric@0: int get_int(FILE *index); viric@0: char * get_def(FILE *fdefs, int offset, int length); viric@8: int str2int(const char *str); viric@8: int num_to_ia5(char *dest, int n); viric@0: viric@0: /* filter.c */ viric@0: void filter_all(const char *filter_par); viric@0: viric@0: /* sort.c */ viric@0: int sort_words(); viric@0: /* load.c */ viric@0: void load_init(); viric@0: void load_dictionary(FILE *index, FILE *fdefs); viric@0: void print_words(); viric@2: viric@2: /* fastmalloc */ viric@2: void * fastmalloc(int newsize); viric@5: viric@5: /* repeated.c */ viric@5: void new_hashdef(struct Def *ptr, int index); viric@5: int def_repeated(struct Def *ptr); viric@5: void init_repeated(); viric@5: void remove_def(int i); viric@10: viric@10: viric@10: /* FOR ZPROCESS */ viric@10: /* zdefs.c */ viric@10: void zprocess_def(const char *root, char *def); viric@10: viric@10: viric@10: /* zhash.c */ viric@10: void insert_word(const char *word, const char *unflexed); viric@10: void init_wordlist(); viric@10: void dump_wordlist(); viric@10: viric@10: /* zrus.c */ viric@10: char * mix_accents(char *a, const char *b); viric@10: void remove_accent(unsigned char *dest, const unsigned char *from); viric@14: int until_newword(const unsigned char *str, int *index); viric@14: int until_noword(const char *str, int *index); viric@14: int skip_newline(const char *str, int *index); viric@14: int is_ASCII(unsigned char c); viric@15: int get_case(enum Case *vcase, const char *str); viric@15: void get_lowcase_str(char *inout, const char *str); viric@15: void reapply_case(char *out, const char *in, const enum Case *vcase); viric@16: void remove_jo(char *str); viric@14: viric@14: /* find.c */ viric@17: void init_dictionary(struct Dict *d, const char *base); viric@17: void end_dictionary(struct Dict *d); viric@17: void find_def(struct Dict *d, const char *word, char * def); viric@17: viric@17: /* http_dec.c */ viric@17: int http_getc(FILE *f);