author | viric@llimona |
Sat, 01 Sep 2007 13:04:10 +0200 | |
changeset 20 | 45798398f4c8 |
parent 17 | d95d9e7a2b81 |
child 21 | 01fe372188ac |
permissions | -rw-r--r-- |
10 | 1 |
enum { |
14 | 2 |
MAXWORD=200, |
17 | 3 |
MAXDEF=10000, |
4 |
END_OF_URL=-2, |
|
5 |
HTTP_DECODE_ERROR=-3 |
|
10 | 6 |
}; |
7 |
||
15 | 8 |
enum Case |
9 |
{ |
|
10 |
LCASE = 0, |
|
11 |
UCASE = 1 |
|
12 |
}; |
|
13 |
||
0 | 14 |
struct Words |
15 |
{ |
|
16 |
struct Word *first; |
|
17 |
int length; |
|
18 |
}; |
|
19 |
||
20 |
struct Word |
|
21 |
{ |
|
22 |
char *w; |
|
23 |
int def; |
|
24 |
}; |
|
25 |
||
26 |
struct Def |
|
27 |
{ |
|
28 |
char *d; |
|
29 |
int offset; |
|
30 |
int length; |
|
31 |
}; |
|
32 |
||
17 | 33 |
struct Dict |
34 |
{ |
|
35 |
unsigned char *index; |
|
36 |
int indexfd; |
|
37 |
int indexsize; |
|
38 |
FILE *defs; |
|
39 |
}; |
|
40 |
||
0 | 41 |
/* write.c */ |
42 |
void write_dictionary(const char *name); |
|
43 |
||
44 |
/* dict.c */ |
|
45 |
char * get_word(FILE *index); |
|
46 |
int get_int(FILE *index); |
|
47 |
char * get_def(FILE *fdefs, int offset, int length); |
|
8
09ec33061ff3
Added 'ia5' binary, and fixed the ia5 functions.
viric@llimona
parents:
5
diff
changeset
|
48 |
int str2int(const char *str); |
09ec33061ff3
Added 'ia5' binary, and fixed the ia5 functions.
viric@llimona
parents:
5
diff
changeset
|
49 |
int num_to_ia5(char *dest, int n); |
0 | 50 |
|
51 |
/* filter.c */ |
|
52 |
void filter_all(const char *filter_par); |
|
53 |
||
54 |
/* sort.c */ |
|
55 |
int sort_words(); |
|
56 |
/* load.c */ |
|
57 |
void load_init(); |
|
58 |
void load_dictionary(FILE *index, FILE *fdefs); |
|
59 |
void print_words(); |
|
2 | 60 |
|
61 |
/* fastmalloc */ |
|
62 |
void * fastmalloc(int newsize); |
|
5 | 63 |
|
64 |
/* repeated.c */ |
|
65 |
void new_hashdef(struct Def *ptr, int index); |
|
66 |
int def_repeated(struct Def *ptr); |
|
67 |
void init_repeated(); |
|
68 |
void remove_def(int i); |
|
10 | 69 |
|
70 |
||
71 |
/* FOR ZPROCESS */ |
|
72 |
/* zdefs.c */ |
|
73 |
void zprocess_def(const char *root, char *def); |
|
74 |
||
75 |
||
76 |
/* zhash.c */ |
|
77 |
void insert_word(const char *word, const char *unflexed); |
|
78 |
void init_wordlist(); |
|
79 |
void dump_wordlist(); |
|
80 |
||
81 |
/* zrus.c */ |
|
82 |
char * mix_accents(char *a, const char *b); |
|
83 |
void remove_accent(unsigned char *dest, const unsigned char *from); |
|
14 | 84 |
int until_newword(const unsigned char *str, int *index); |
85 |
int until_noword(const char *str, int *index); |
|
86 |
int skip_newline(const char *str, int *index); |
|
87 |
int is_ASCII(unsigned char c); |
|
15 | 88 |
int get_case(enum Case *vcase, const char *str); |
89 |
void get_lowcase_str(char *inout, const char *str); |
|
90 |
void reapply_case(char *out, const char *in, const enum Case *vcase); |
|
16
b4e251400e36
Improved hash on zprocess, and added parsing for "jo".
viric@llimona
parents:
15
diff
changeset
|
91 |
void remove_jo(char *str); |
14 | 92 |
|
93 |
/* find.c */ |
|
17 | 94 |
void init_dictionary(struct Dict *d, const char *base); |
95 |
void end_dictionary(struct Dict *d); |
|
96 |
void find_def(struct Dict *d, const char *word, char * def); |
|
97 |
||
98 |
/* http_dec.c */ |
|
99 |
int http_getc(FILE *f); |