]>
Commit | Line | Data |
---|---|---|
cc093cd5 JR |
1 | diff -ur swish-e-2.7.0-2014-09-14/src/compress.c swish-e-2.7.0-2014-09-14.zlib/src/compress.c |
2 | --- swish-e-2.7.0-2014-09-14/src/compress.c 2014-09-15 02:01:51.000000000 +0200 | |
3 | +++ swish-e-2.7.0-2014-09-14.zlib/src/compress.c 2017-07-01 10:52:31.160708484 +0200 | |
4 | @@ -163,7 +163,7 @@ | |
5 | } | |
6 | ||
7 | /* Uncompress a number from a file */ | |
8 | -int uncompress1(FILE * fp, int (*f_getc) (FILE *)) | |
9 | +int sw_uncompress1(FILE * fp, int (*f_getc) (FILE *)) | |
10 | { | |
11 | int _c; | |
12 | int num = 0; | |
13 | @@ -175,7 +175,7 @@ | |
14 | _c = (int) f_getc(fp); | |
15 | ||
16 | if (_c < 0) { | |
17 | - progerr("_c is < 0 in uncompress1()\n"); | |
18 | + progerr("_c is < 0 in sw_uncompress1()\n"); | |
19 | } | |
20 | ||
21 | num <<= 7; | |
22 | @@ -193,7 +193,7 @@ | |
23 | ||
24 | /* same routine but this works with a memory forward buffer instead of file */ | |
25 | /* it also increases the buffer pointer */ | |
26 | -int uncompress2(unsigned char **buffer) | |
27 | +int sw_uncompress2(unsigned char **buffer) | |
28 | { | |
29 | int _c; | |
30 | int num = 0; | |
31 | @@ -636,10 +636,10 @@ | |
32 | else | |
33 | (*frequency) |= (*flag) & 15; /* Binary 00001111 */ | |
34 | ||
35 | - *filenum = uncompress2(&p); | |
36 | + *filenum = sw_uncompress2(&p); | |
37 | ||
38 | if(! (*frequency)) | |
39 | - *frequency = uncompress2(&p); | |
40 | + *frequency = sw_uncompress2(&p); | |
41 | ||
42 | *buf = p; | |
43 | } | |
44 | @@ -688,7 +688,7 @@ | |
45 | } | |
46 | ||
47 | /* First position is always "as is" */ | |
48 | - posdata[0] = (unsigned int)uncompress2(&p); | |
49 | + posdata[0] = (unsigned int)sw_uncompress2(&p); | |
50 | ||
51 | /* Check if positions where stored as two values per byte or the old "compress" style */ | |
52 | if(flag & POS_4_BIT) | |
53 | @@ -706,7 +706,7 @@ | |
54 | { | |
55 | for (i = 1; i < frequency; i++) | |
56 | { | |
57 | - tmp = uncompress2(&p); | |
58 | + tmp = sw_uncompress2(&p); | |
59 | posdata[i] = (unsigned int)tmp; | |
60 | } | |
61 | } | |
62 | diff -ur swish-e-2.7.0-2014-09-14/src/compress.h swish-e-2.7.0-2014-09-14.zlib/src/compress.h | |
63 | --- swish-e-2.7.0-2014-09-14/src/compress.h 2014-09-15 02:01:51.000000000 +0200 | |
64 | +++ swish-e-2.7.0-2014-09-14.zlib/src/compress.h 2017-07-01 10:52:31.170708616 +0200 | |
65 | @@ -35,8 +35,8 @@ | |
66 | /* unsigned char *compress2(int num, unsigned char *buffer);*/ | |
67 | unsigned char *compress3(int num, unsigned char *buffer); | |
68 | ||
69 | -int uncompress1(FILE *fp, int (*f_getc)(FILE *fp)); | |
70 | -int uncompress2(unsigned char **buffer); | |
71 | +int sw_uncompress1(FILE *fp, int (*f_getc)(FILE *fp)); | |
72 | +int sw_uncompress2(unsigned char **buffer); | |
73 | ||
74 | ||
75 | unsigned long PACKLONG(unsigned long num); | |
76 | diff -ur swish-e-2.7.0-2014-09-14/src/db_native.c swish-e-2.7.0-2014-09-14.zlib/src/db_native.c | |
77 | --- swish-e-2.7.0-2014-09-14/src/db_native.c 2014-09-15 02:01:51.000000000 +0200 | |
78 | +++ swish-e-2.7.0-2014-09-14.zlib/src/db_native.c 2017-07-01 10:52:31.177375371 +0200 | |
79 | @@ -725,11 +725,11 @@ | |
80 | FILE *fp = SW_DB->fp_header; | |
81 | int tmp; | |
82 | ||
83 | - tmp = uncompress1(fp, sw_fgetc); | |
84 | + tmp = sw_uncompress1(fp, sw_fgetc); | |
85 | *id = tmp; | |
86 | if (tmp) | |
87 | { | |
88 | - tmp = uncompress1(fp, sw_fgetc); | |
89 | + tmp = sw_uncompress1(fp, sw_fgetc); | |
90 | *s = (unsigned char *) emalloc(tmp + 1); | |
91 | *len = tmp; | |
92 | int ret = sw_fread(*s, *len, sizeof(char), fp); | |
93 | @@ -1078,7 +1078,7 @@ | |
94 | buf = data.data; | |
95 | ||
96 | /* Get saved_bytes and adjust data_size */ | |
97 | - *saved_bytes = uncompress2(&buf); | |
98 | + *saved_bytes = sw_uncompress2(&buf); | |
99 | *data_size -= ((char *)buf - (char *)data.data); | |
100 | *worddata = emalloc(*data_size); | |
101 | memcpy(*worddata,buf, *data_size); | |
102 | @@ -1352,13 +1352,13 @@ | |
103 | next = readfileoffset(fp,sw_fread); | |
104 | ||
105 | /* read propID for this record */ | |
106 | - id = uncompress1(fp,sw_fgetc); | |
107 | + id = sw_uncompress1(fp,sw_fgetc); | |
108 | ||
109 | while(1) | |
110 | { | |
111 | if(id == propID) /* this is the property we are looking for */ | |
112 | { | |
113 | - tmp = uncompress1(fp,sw_fgetc); | |
114 | + tmp = sw_uncompress1(fp,sw_fgetc); | |
115 | *sz_data = tmp; | |
116 | ||
117 | *data = emalloc(*sz_data); | |
118 | @@ -1372,7 +1372,7 @@ | |
119 | { | |
120 | sw_fseek(fp,next,SEEK_SET); | |
121 | next = readfileoffset(fp,sw_fread); | |
122 | - id = uncompress1(fp,sw_fgetc); | |
123 | + id = sw_uncompress1(fp,sw_fgetc); | |
124 | } | |
125 | else | |
126 | { | |
127 | @@ -1750,10 +1750,10 @@ | |
128 | #endif | |
129 | ||
130 | /* read compressed size (for use in zlib uncompression) */ | |
131 | - *buf_len = uncompress1( SW_DB->fp_prop, sw_fgetc ); | |
132 | + *buf_len = sw_uncompress1( SW_DB->fp_prop, sw_fgetc ); | |
133 | ||
134 | /* Get the uncompressed size */ | |
135 | - saved_bytes = uncompress1( SW_DB->fp_prop, sw_fgetc ); | |
136 | + saved_bytes = sw_uncompress1( SW_DB->fp_prop, sw_fgetc ); | |
137 | ||
138 | /* If saved_bytes is 0 there was not any compression */ | |
139 | if( !saved_bytes ) /* adjust *uncompressed_len */ | |
140 | diff -ur swish-e-2.7.0-2014-09-14/src/db_read.c swish-e-2.7.0-2014-09-14.zlib/src/db_read.c | |
141 | --- swish-e-2.7.0-2014-09-14/src/db_read.c 2014-09-15 02:01:51.000000000 +0200 | |
142 | +++ swish-e-2.7.0-2014-09-14.zlib/src/db_read.c 2017-07-01 10:52:31.157375107 +0200 | |
143 | @@ -253,24 +253,24 @@ | |
144 | /* First clear out the default metanames */ | |
145 | freeMetaEntries( header ); | |
146 | ||
147 | - num_metanames = uncompress2(&s); | |
148 | + num_metanames = sw_uncompress2(&s); | |
149 | ||
150 | for (i = 0; i < num_metanames; i++) | |
151 | { | |
152 | - len = uncompress2(&s); | |
153 | + len = sw_uncompress2(&s); | |
154 | word = emalloc(len +1); | |
155 | memcpy(word,s,len); s += len; | |
156 | word[len] = '\0'; | |
157 | /* Read metaID */ | |
158 | - metaID = uncompress2(&s); | |
159 | + metaID = sw_uncompress2(&s); | |
160 | /* metaType was saved as metaType+1 */ | |
161 | - metaType = uncompress2(&s); | |
162 | + metaType = sw_uncompress2(&s); | |
163 | ||
164 | - alias = uncompress2(&s) - 1; | |
165 | + alias = sw_uncompress2(&s) - 1; | |
166 | ||
167 | - sort_len = uncompress2(&s); | |
168 | + sort_len = sw_uncompress2(&s); | |
169 | ||
170 | - bias = uncompress2(&s) - RANK_BIAS_RANGE - 1; | |
171 | + bias = sw_uncompress2(&s) - RANK_BIAS_RANGE - 1; | |
172 | ||
173 | ||
174 | /* add the meta tag */ | |
175 | @@ -295,11 +295,11 @@ | |
176 | ||
177 | unsigned char *s = (unsigned char *)buffer; | |
178 | ||
179 | - num_words = uncompress2(&s); | |
180 | + num_words = sw_uncompress2(&s); | |
181 | ||
182 | for (i=0; i < num_words ; i++) | |
183 | { | |
184 | - len = uncompress2(&s); | |
185 | + len = sw_uncompress2(&s); | |
186 | word = emalloc(len+1); | |
187 | memcpy(word,s,len); s += len; | |
188 | word[len] = '\0'; | |
189 | @@ -318,10 +318,10 @@ | |
190 | int tmp,i; | |
191 | unsigned char *s = (unsigned char *)buffer; | |
192 | ||
193 | - tmp = uncompress2(&s); /* Jump the number of elements */ | |
194 | + tmp = sw_uncompress2(&s); /* Jump the number of elements */ | |
195 | for (i = 0; i < table_size; i++) | |
196 | { | |
197 | - tmp = uncompress2(&s); /* Gut all the elements */ | |
198 | + tmp = sw_uncompress2(&s); /* Gut all the elements */ | |
199 | table[i] = tmp - 1; | |
200 | } | |
201 | } | |
202 | diff -ur swish-e-2.7.0-2014-09-14/src/db_write.c swish-e-2.7.0-2014-09-14.zlib/src/db_write.c | |
203 | --- swish-e-2.7.0-2014-09-14/src/db_write.c 2014-09-15 02:01:51.000000000 +0200 | |
204 | +++ swish-e-2.7.0-2014-09-14.zlib/src/db_write.c 2017-07-01 10:52:31.167375238 +0200 | |
205 | @@ -207,7 +207,7 @@ | |
206 | /* Jump pointer to next element */ | |
207 | p = compressed_data + sizeof(LOCATION *); | |
208 | ||
209 | - metaID = uncompress2(&p); | |
210 | + metaID = sw_uncompress2(&p); | |
211 | ||
212 | memcpy((char *)&chunk_size,(char *)p,sizeof(chunk_size)); | |
213 | p += sizeof(chunk_size); | |
214 | diff -ur swish-e-2.7.0-2014-09-14/src/dump.c swish-e-2.7.0-2014-09-14.zlib/src/dump.c | |
215 | --- swish-e-2.7.0-2014-09-14/src/dump.c 2014-09-15 02:01:51.000000000 +0200 | |
216 | +++ swish-e-2.7.0-2014-09-14.zlib/src/dump.c 2017-07-01 10:52:31.194042257 +0200 | |
217 | @@ -246,8 +246,8 @@ | |
218 | /* parse and print word's data */ | |
219 | s = worddata; | |
220 | ||
221 | - tmpval = uncompress2(&s); /* tfrequency */ | |
222 | - metaID = uncompress2(&s); /* metaID */ | |
223 | + tmpval = sw_uncompress2(&s); /* tfrequency */ | |
224 | + metaID = sw_uncompress2(&s); /* metaID */ | |
225 | ||
226 | r_nextposmeta = UNPACKLONG2(s); | |
227 | s += sizeof(long); | |
228 | @@ -276,7 +276,7 @@ | |
229 | if ( metadata_length == (s - start)) | |
230 | { | |
231 | filenum = 0; | |
232 | - metaID = uncompress2(&s); | |
233 | + metaID = sw_uncompress2(&s); | |
234 | ||
235 | r_nextposmeta = UNPACKLONG2(s); | |
236 | s += sizeof(long); | |
237 | @@ -336,8 +336,8 @@ | |
238 | /* parse and print word's data */ | |
239 | s = worddata; | |
240 | ||
241 | - tmpval = uncompress2(&s); /* tfrequency */ | |
242 | - metaID = uncompress2(&s); /* metaID */ | |
243 | + tmpval = sw_uncompress2(&s); /* tfrequency */ | |
244 | + metaID = sw_uncompress2(&s); /* metaID */ | |
245 | ||
246 | r_nextposmeta = UNPACKLONG2(s); | |
247 | s += sizeof(long); | |
248 | @@ -438,7 +438,7 @@ | |
249 | if ( metadata_length == (s - start)) | |
250 | { | |
251 | filenum = 0; | |
252 | - metaID = uncompress2(&s); | |
253 | + metaID = sw_uncompress2(&s); | |
254 | ||
255 | r_nextposmeta = UNPACKLONG2(s); | |
256 | s += sizeof(long); | |
257 | diff -ur swish-e-2.7.0-2014-09-14/src/index.c swish-e-2.7.0-2014-09-14.zlib/src/index.c | |
258 | --- swish-e-2.7.0-2014-09-14/src/index.c 2014-09-15 02:01:51.000000000 +0200 | |
259 | +++ swish-e-2.7.0-2014-09-14.zlib/src/index.c 2017-07-01 10:52:31.167375238 +0200 | |
260 | @@ -1684,7 +1684,7 @@ | |
261 | /* Jump pointer to next element */ | |
262 | p = compressed_data + sizeof(LOCATION *); | |
263 | ||
264 | - metaID = uncompress2(&p); | |
265 | + metaID = sw_uncompress2(&p); | |
266 | ||
267 | memcpy((char *)&chunk_size,(char *)p,sizeof(chunk_size)); | |
268 | p += sizeof(chunk_size); | |
269 | @@ -1778,8 +1778,8 @@ | |
270 | ||
271 | p = worddata; | |
272 | ||
273 | - tmpval = uncompress2(&p); /* tfrequency */ | |
274 | - metaID = uncompress2(&p); /* metaID */ | |
275 | + tmpval = sw_uncompress2(&p); /* tfrequency */ | |
276 | + metaID = sw_uncompress2(&p); /* metaID */ | |
277 | r_nextposmeta = UNPACKLONG2(p); | |
278 | w_nextposmeta = p; | |
279 | p += sizeof(long); | |
280 | @@ -1843,7 +1843,7 @@ | |
281 | if(q != p) | |
282 | PACKLONG2(q - worddata, w_nextposmeta); | |
283 | ||
284 | - metaID = uncompress2(&p); | |
285 | + metaID = sw_uncompress2(&p); | |
286 | q = compress3(metaID,q); | |
287 | ||
288 | r_nextposmeta = UNPACKLONG2(p); | |
289 | @@ -1971,7 +1971,7 @@ | |
290 | /* Jump next offset */ | |
291 | compressed_data += sizeof(LOCATION *); | |
292 | ||
293 | - metaID = uncompress2(&compressed_data); | |
294 | + metaID = sw_uncompress2(&compressed_data); | |
295 | uncompress_location_values(&compressed_data,&flag,&filenum,&frequency); | |
296 | pi[0] = metaID; | |
297 | pi[1] = filenum; | |
298 | @@ -2525,7 +2525,7 @@ | |
299 | for(tprev =NULL, tloc = e->allLocationList; tloc; ) | |
300 | { | |
301 | tp = (unsigned char *)tloc + sizeof(void *); | |
302 | - tmp = uncompress2(&tp); /* Read metaID */ | |
303 | + tmp = sw_uncompress2(&tp); /* Read metaID */ | |
304 | if(tmp > metaID) | |
305 | break; | |
306 | tprev = tloc; | |
307 | @@ -2595,7 +2595,7 @@ | |
308 | p += sizeof(LOCATION *); | |
309 | ||
310 | /* get metaID of LOCATION */ | |
311 | - metaID = uncompress2(&p); | |
312 | + metaID = sw_uncompress2(&p); | |
313 | ||
314 | /* Check for new metaID */ | |
315 | if(metaID != curmetaID) | |
316 | @@ -2810,7 +2810,7 @@ | |
317 | } | |
318 | ||
319 | fp = idx->fp_loc_read[idx_swap_file]; | |
320 | - while((lenbuf = uncompress1(fp, idx->swap_getc))) | |
321 | + while((lenbuf = sw_uncompress1(fp, idx->swap_getc))) | |
322 | { | |
323 | if(ep == NULL) | |
324 | { | |
325 | @@ -2890,7 +2890,7 @@ | |
326 | /* Jump fileoffset */ | |
327 | compressed_data += sizeof(LOCATION *); | |
328 | ||
329 | - metaID = uncompress2(&compressed_data); | |
330 | + metaID = sw_uncompress2(&compressed_data); | |
331 | pi[0] = metaID; | |
332 | pi[1] = i-k; | |
333 | ptmp2 += 2 * sizeof(int); | |
334 | diff -ur swish-e-2.7.0-2014-09-14/src/merge.c swish-e-2.7.0-2014-09-14.zlib/src/merge.c | |
335 | --- swish-e-2.7.0-2014-09-14/src/merge.c 2014-09-15 02:01:51.000000000 +0200 | |
336 | +++ swish-e-2.7.0-2014-09-14.zlib/src/merge.c 2017-07-01 10:52:31.170708616 +0200 | |
337 | @@ -225,8 +225,8 @@ | |
338 | ||
339 | /* Now, parse word's data */ | |
340 | s = worddata; | |
341 | - tmpval = uncompress2(&s); /* tfrequency */ | |
342 | - metaID = uncompress2(&s); /* metaID */ | |
343 | + tmpval = sw_uncompress2(&s); /* tfrequency */ | |
344 | + metaID = sw_uncompress2(&s); /* metaID */ | |
345 | ||
346 | if (metaID) | |
347 | { | |
348 | @@ -280,7 +280,7 @@ | |
349 | if ( metadata_length == (s - start)) | |
350 | { | |
351 | filenum = 0; | |
352 | - metaID = uncompress2(&s); | |
353 | + metaID = sw_uncompress2(&s); | |
354 | ||
355 | r_nextposmeta = UNPACKLONG2(s); | |
356 | s += sizeof(long); | |
357 | diff -ur swish-e-2.7.0-2014-09-14/src/result_sort.c swish-e-2.7.0-2014-09-14.zlib/src/result_sort.c | |
358 | --- swish-e-2.7.0-2014-09-14/src/result_sort.c 2014-09-15 02:01:51.000000000 +0200 | |
359 | +++ swish-e-2.7.0-2014-09-14.zlib/src/result_sort.c 2017-07-01 10:52:31.180708748 +0200 | |
360 | @@ -252,7 +252,7 @@ | |
361 | ||
362 | /* Unpack / decompress the numbers */ | |
363 | for (j = 0; j < indexf->header.totalfiles; j++) | |
364 | - m->sorted_data[j] = uncompress2(&s); | |
365 | + m->sorted_data[j] = sw_uncompress2(&s); | |
366 | ||
367 | efree(buffer); | |
368 | } | |
369 | diff -ur swish-e-2.7.0-2014-09-14/src/search.c swish-e-2.7.0-2014-09-14.zlib/src/search.c | |
370 | --- swish-e-2.7.0-2014-09-14/src/search.c 2014-09-15 02:01:51.000000000 +0200 | |
371 | +++ swish-e-2.7.0-2014-09-14.zlib/src/search.c 2017-07-01 10:52:31.160708484 +0200 | |
372 | @@ -1729,10 +1729,10 @@ | |
373 | // buffer structure = <tfreq><metaID><delta to next meta> | |
374 | ||
375 | /* Get the data of the word */ | |
376 | - tfrequency += uncompress2(&s); /* tfrequency - number of files with this word */ | |
377 | + tfrequency += sw_uncompress2(&s); /* tfrequency - number of files with this word */ | |
378 | ||
379 | /* Now look for a correct Metaname */ | |
380 | - curmetaID = uncompress2(&s); | |
381 | + curmetaID = sw_uncompress2(&s); | |
382 | ||
383 | while (curmetaID) | |
384 | { | |
385 | @@ -1751,7 +1751,7 @@ | |
386 | if(s == (buffer + sz_buffer)) | |
387 | break; /* exit if no more meta data */ | |
388 | ||
389 | - curmetaID = uncompress2(&s); | |
390 | + curmetaID = sw_uncompress2(&s); | |
391 | } | |
392 | ||
393 | if (curmetaID == metaID) /* found a matching meta value */ |