Rev 8100 | Rev 8149 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8100 | Rev 8123 | ||
---|---|---|---|
Line 25... | Line 25... | ||
25 | #define diclim 2*1024*1024 |
25 | #define diclim 2*1024*1024 |
26 | /* limit of source length */ |
26 | /* limit of source length */ |
27 | #define sourcelim 16*1024*1024 |
27 | #define sourcelim 16*1024*1024 |
28 | 28 | ||
29 | /***************** Nothing should need change hereafter *****************/ |
29 | /***************** Nothing should need change hereafter *****************/ |
30 | - | ||
- | 30 | #include "suffix.h" |
|
31 | #include "../wims.h" |
31 | #include "../wims.h" |
32 | #include "../Lib/libwims.h" |
32 | #include "../Lib/libwims.h" |
33 | 33 | ||
34 | char *inpbuf, outbuf[2*(MAX_LINELEN+1)]; |
34 | char *inpbuf, outbuf[2*(MAX_LINELEN+1)]; |
35 | char *dicbuf; |
35 | char *dicbuf; |
Line 61... | Line 61... | ||
61 | { |
61 | { |
62 | printf("%s",inpbuf); exit(0); |
62 | printf("%s",inpbuf); exit(0); |
63 | } |
63 | } |
64 | 64 | ||
65 | /* Points to the end of the word */ |
65 | /* Points to the end of the word */ |
66 | /* |
66 | /* |
67 | char *find_word_end(char *p) |
67 | char *find_word_end(char *p) |
68 | { |
68 | { |
69 | int i; |
69 | int i; |
70 | for(i=0;!isspace(*p) && *p!=0 && i<MAX_LINELEN; p++,i++); |
70 | for(i=0;!isspace(*p) && *p!=0 && i<MAX_LINELEN; p++,i++); |
71 | return p; |
71 | return p; |
Line 95... | Line 95... | ||
95 | int k; |
95 | int k; |
96 | if(nocase) k=strncasecmp((char*)entry[i1].original,s2,entry[i1].olen); |
96 | if(nocase) k=strncasecmp((char*)entry[i1].original,s2,entry[i1].olen); |
97 | else k=strncmp((char*)entry[i1].original,s2,entry[i1].olen); |
97 | else k=strncmp((char*)entry[i1].original,s2,entry[i1].olen); |
98 | if(k==0 && (isalnum(*(s2+entry[i1].olen)) || (*(s2+entry[i1].olen)&128)!=0)) return -1; |
98 | if(k==0 && (isalnum(*(s2+entry[i1].olen)) || (*(s2+entry[i1].olen)&128)!=0)) return -1; |
99 | else return k; |
99 | else return k; |
100 | } |
100 | } |
101 | 101 | ||
102 | /* searches a list. Returns index if found, -1 if nomatch. |
102 | /* searches a list. Returns index if found, -1 if nomatch. |
103 | * Uses binary search, list must be sorted. */ |
103 | * Uses binary search, list must be sorted. */ |
104 | int search_list2(struct entry *list, int items, size_t item_size, const char *str) |
104 | int search_list2(struct entry *list, int items, size_t item_size, const char *str) |
105 | { |
105 | { |
106 | int i1,i2,j,k,t,t1; |
106 | int i1,i2,j,k,t,t1; |
Line 129... | Line 129... | ||
129 | if(k==0) t=j; |
129 | if(k==0) t=j; |
130 | } |
130 | } |
131 | return t; |
131 | return t; |
132 | } |
132 | } |
133 | 133 | ||
134 | /* modify a string. Bufferlen must be |
134 | /* modify a string. Bufferlen must be at least MAX_LINELEN */ |
135 | void string_modify3(char *start, char *bad_beg, char *bad_end, char *good,...) |
135 | void string_modify3(char *start, char *bad_beg, char *bad_end, char *good,...) |
136 | { |
136 | { |
137 | char buf[MAX_LINELEN+1]; |
137 | char buf[MAX_LINELEN+1]; |
138 | va_list vp; |
138 | va_list vp; |
139 | 139 | ||
Line 169... | Line 169... | ||
169 | for(p2=pp;isspace(*p2);p2++); |
169 | for(p2=pp;isspace(*p2);p2++); |
170 | ovlstrcpy(pp,p2); pp--; |
170 | ovlstrcpy(pp,p2); pp--; |
171 | } |
171 | } |
172 | } |
172 | } |
173 | } |
173 | } |
174 | - | ||
175 | #include "suffix.c" |
- | |
176 | 174 | ||
177 | /* Prepare dictionary */ |
175 | /* Prepare dictionary */ |
178 | void prepare_dic(void) |
176 | void prepare_dic(void) |
179 | { |
177 | { |
180 | int i,l; |
178 | int i,l; |