]>
Commit | Line | Data |
---|---|---|
c4b576de JB |
1 | diff -Nur recode-3.6.orig/src/combine.c recode-3.6/src/combine.c |
2 | --- recode-3.6.orig/src/combine.c Sat Jul 1 21:08:35 2000 | |
3 | +++ recode-3.6/src/combine.c Sun Oct 27 12:01:29 2002 | |
5b4a1f52 JB |
4 | @@ -91,7 +91,7 @@ |
5 | if (before_options || after_options) | |
6 | return false; | |
7 | ||
8 | - table = hash_initialize (0, NULL, combined_hash, combined_compare, NULL); | |
c4b576de | 9 | + table = _recode_hash_initialize (0, NULL, combined_hash, combined_compare, NULL); |
5b4a1f52 JB |
10 | |
11 | if (!table) | |
12 | return false; | |
13 | @@ -103,7 +103,7 @@ | |
14 | ||
15 | while (*data != DONE) | |
16 | { | |
17 | - if (!hash_insert (table, data)) | |
c4b576de | 18 | + if (!_recode_hash_insert (table, data)) |
5b4a1f52 JB |
19 | return false; |
20 | ||
21 | while (*data != DONE) | |
22 | @@ -127,7 +127,7 @@ | |
23 | while (value = get_byte (subtask), value != EOF) | |
24 | { | |
25 | unsigned short lookup = value; | |
26 | - unsigned short *result = hash_lookup (table, &lookup); | |
c4b576de | 27 | + unsigned short *result = _recode_hash_lookup (table, &lookup); |
5b4a1f52 JB |
28 | |
29 | if (result) | |
30 | { | |
31 | @@ -154,7 +154,7 @@ | |
32 | while (get_ucs2 (&value, subtask)) | |
33 | { | |
34 | unsigned short lookup = value; | |
35 | - unsigned short *result = hash_lookup (table, &lookup); | |
c4b576de | 36 | + unsigned short *result = _recode_hash_lookup (table, &lookup); |
5b4a1f52 JB |
37 | |
38 | if (result) | |
39 | { | |
40 | @@ -186,7 +186,7 @@ | |
41 | while (true) | |
42 | { | |
43 | unsigned short lookup = value; | |
44 | - unsigned short *result = hash_lookup (table, &lookup); | |
c4b576de | 45 | + unsigned short *result = _recode_hash_lookup (table, &lookup); |
5b4a1f52 JB |
46 | |
47 | if (result) | |
48 | { | |
49 | @@ -219,7 +219,7 @@ | |
50 | while (true) | |
51 | { | |
52 | unsigned short lookup = value; | |
53 | - unsigned short *result = hash_lookup (table, &lookup); | |
c4b576de | 54 | + unsigned short *result = _recode_hash_lookup (table, &lookup); |
5b4a1f52 JB |
55 | |
56 | if (result) | |
57 | { | |
c4b576de | 58 | @@ -325,7 +325,7 @@ |
5b4a1f52 JB |
59 | struct state lookup; |
60 | ||
61 | lookup.character = character; | |
62 | - state = hash_lookup (table, &lookup); | |
c4b576de | 63 | + state = _recode_hash_lookup (table, &lookup); |
5b4a1f52 JB |
64 | if (!state) |
65 | { | |
66 | if (state= (struct state *) malloc (sizeof (struct state)), !state) | |
c4b576de | 67 | @@ -337,7 +337,7 @@ |
5b4a1f52 JB |
68 | state->unshift = NULL; |
69 | state->next = NULL; | |
70 | ||
71 | - if (!hash_insert (table, state)) | |
c4b576de | 72 | + if (!_recode_hash_insert (table, state)) |
5b4a1f52 JB |
73 | return NULL; |
74 | } | |
75 | return state; | |
c4b576de | 76 | @@ -366,7 +366,7 @@ |
5b4a1f52 JB |
77 | struct state lookup; |
78 | ||
79 | lookup.character = character; | |
80 | - return hash_lookup (table, &lookup); | |
c4b576de | 81 | + return _recode_hash_lookup (table, &lookup); |
5b4a1f52 JB |
82 | } |
83 | } | |
84 | ||
c4b576de | 85 | @@ -382,7 +382,7 @@ |
5b4a1f52 JB |
86 | if (before_options || after_options) |
87 | return false; | |
88 | ||
c4b576de JB |
89 | - table = hash_initialize (0, NULL, state_hash, state_compare, state_free); |
90 | + table = _recode_hash_initialize (0, NULL, state_hash, state_compare, state_free); | |
5b4a1f52 JB |
91 | |
92 | if (!table) | |
93 | return false; | |
c4b576de JB |
94 | diff -Nur recode-3.6.orig/src/hash.c recode-3.6/src/hash.c |
95 | --- recode-3.6.orig/src/hash.c Mon Jan 22 17:55:31 2001 | |
96 | +++ recode-3.6/src/hash.c Sun Oct 27 12:01:29 2002 | |
97 | @@ -116,7 +116,7 @@ | |
5b4a1f52 JB |
98 | the same quantity. */ |
99 | ||
100 | unsigned | |
101 | -hash_get_n_buckets (const Hash_table *table) | |
c4b576de | 102 | +_recode_hash_get_n_buckets (const Hash_table *table) |
5b4a1f52 JB |
103 | { |
104 | return table->n_buckets; | |
105 | } | |
c4b576de | 106 | @@ -124,7 +124,7 @@ |
5b4a1f52 JB |
107 | /* Return the number of slots in use (non-empty buckets). */ |
108 | ||
109 | unsigned | |
110 | -hash_get_n_buckets_used (const Hash_table *table) | |
c4b576de | 111 | +_recode_hash_get_n_buckets_used (const Hash_table *table) |
5b4a1f52 JB |
112 | { |
113 | return table->n_buckets_used; | |
114 | } | |
c4b576de | 115 | @@ -132,7 +132,7 @@ |
5b4a1f52 JB |
116 | /* Return the number of active entries. */ |
117 | ||
118 | unsigned | |
119 | -hash_get_n_entries (const Hash_table *table) | |
c4b576de | 120 | +_recode_hash_get_n_entries (const Hash_table *table) |
5b4a1f52 JB |
121 | { |
122 | return table->n_entries; | |
123 | } | |
c4b576de | 124 | @@ -140,7 +140,7 @@ |
5b4a1f52 JB |
125 | /* Return the length of the longest chain (bucket). */ |
126 | ||
127 | unsigned | |
128 | -hash_get_max_bucket_length (const Hash_table *table) | |
c4b576de | 129 | +_recode_hash_get_max_bucket_length (const Hash_table *table) |
5b4a1f52 JB |
130 | { |
131 | struct hash_entry *bucket; | |
132 | unsigned max_bucket_length = 0; | |
c4b576de | 133 | @@ -167,7 +167,7 @@ |
5b4a1f52 JB |
134 | statistics. */ |
135 | ||
136 | bool | |
137 | -hash_table_ok (const Hash_table *table) | |
c4b576de | 138 | +_recode_hash_table_ok (const Hash_table *table) |
5b4a1f52 JB |
139 | { |
140 | struct hash_entry *bucket; | |
141 | unsigned n_buckets_used = 0; | |
c4b576de | 142 | @@ -196,12 +196,12 @@ |
5b4a1f52 JB |
143 | } |
144 | ||
145 | void | |
146 | -hash_print_statistics (const Hash_table *table, FILE *stream) | |
c4b576de | 147 | +_recode_hash_print_statistics (const Hash_table *table, FILE *stream) |
5b4a1f52 JB |
148 | { |
149 | - unsigned n_entries = hash_get_n_entries (table); | |
150 | - unsigned n_buckets = hash_get_n_buckets (table); | |
151 | - unsigned n_buckets_used = hash_get_n_buckets_used (table); | |
152 | - unsigned max_bucket_length = hash_get_max_bucket_length (table); | |
c4b576de JB |
153 | + unsigned n_entries = _recode_hash_get_n_entries (table); |
154 | + unsigned n_buckets = _recode_hash_get_n_buckets (table); | |
155 | + unsigned n_buckets_used = _recode_hash_get_n_buckets_used (table); | |
156 | + unsigned max_bucket_length = _recode_hash_get_max_bucket_length (table); | |
5b4a1f52 JB |
157 | |
158 | fprintf (stream, "# entries: %u\n", n_entries); | |
159 | fprintf (stream, "# buckets: %u\n", n_buckets); | |
c4b576de | 160 | @@ -214,7 +214,7 @@ |
5b4a1f52 JB |
161 | entry from the table. Otherwise, return NULL. */ |
162 | ||
163 | void * | |
164 | -hash_lookup (const Hash_table *table, const void *entry) | |
c4b576de | 165 | +_recode_hash_lookup (const Hash_table *table, const void *entry) |
5b4a1f52 JB |
166 | { |
167 | struct hash_entry *bucket | |
168 | = table->bucket + table->hasher (entry, table->n_buckets); | |
c4b576de | 169 | @@ -242,7 +242,7 @@ |
5b4a1f52 JB |
170 | /* Return the first data in the table, or NULL if the table is empty. */ |
171 | ||
172 | void * | |
173 | -hash_get_first (const Hash_table *table) | |
c4b576de | 174 | +_recode_hash_get_first (const Hash_table *table) |
5b4a1f52 JB |
175 | { |
176 | struct hash_entry *bucket; | |
177 | ||
c4b576de | 178 | @@ -261,7 +261,7 @@ |
5b4a1f52 JB |
179 | Return NULL if there is no more entries. */ |
180 | ||
181 | void * | |
182 | -hash_get_next (const Hash_table *table, const void *entry) | |
c4b576de | 183 | +_recode_hash_get_next (const Hash_table *table, const void *entry) |
5b4a1f52 JB |
184 | { |
185 | struct hash_entry *bucket | |
186 | = table->bucket + table->hasher (entry, table->n_buckets); | |
c4b576de | 187 | @@ -288,7 +288,7 @@ |
5b4a1f52 JB |
188 | pointers. */ |
189 | ||
190 | unsigned | |
191 | -hash_get_entries (const Hash_table *table, void **buffer, | |
c4b576de | 192 | +_recode_hash_get_entries (const Hash_table *table, void **buffer, |
5b4a1f52 JB |
193 | unsigned buffer_size) |
194 | { | |
195 | unsigned counter = 0; | |
c4b576de | 196 | @@ -320,7 +320,7 @@ |
5b4a1f52 JB |
197 | returns nonzero. When it returns zero, the walking is interrupted. */ |
198 | ||
199 | unsigned | |
200 | -hash_do_for_each (const Hash_table *table, Hash_processor processor, | |
c4b576de | 201 | +_recode_hash_do_for_each (const Hash_table *table, Hash_processor processor, |
5b4a1f52 JB |
202 | void *processor_data) |
203 | { | |
204 | unsigned counter = 0; | |
c4b576de | 205 | @@ -357,7 +357,7 @@ |
5b4a1f52 JB |
206 | may not be good for your application." */ |
207 | ||
208 | unsigned | |
209 | -hash_string (const char *string, unsigned n_buckets) | |
c4b576de | 210 | +_recode_hash_string (const char *string, unsigned n_buckets) |
5b4a1f52 JB |
211 | { |
212 | # ifndef CHAR_BIT | |
213 | # define CHAR_BIT 8 | |
c4b576de | 214 | @@ -385,7 +385,7 @@ |
5b4a1f52 JB |
215 | (By the way, what happened to this excellent man? Is he still alive?) */ |
216 | ||
217 | unsigned | |
218 | -hash_string (const char *string, unsigned n_buckets) | |
c4b576de | 219 | +_recode_hash_string (const char *string, unsigned n_buckets) |
5b4a1f52 JB |
220 | { |
221 | unsigned value = 0; | |
222 | ||
c4b576de | 223 | @@ -436,7 +436,7 @@ |
5b4a1f52 JB |
224 | } |
225 | ||
226 | void | |
227 | -hash_reset_tuning (Hash_tuning *tuning) | |
c4b576de | 228 | +_recode_hash_reset_tuning (Hash_tuning *tuning) |
5b4a1f52 JB |
229 | { |
230 | *tuning = default_tuning; | |
231 | } | |
c4b576de | 232 | @@ -498,7 +498,7 @@ |
5b4a1f52 JB |
233 | values. */ |
234 | ||
235 | Hash_table * | |
236 | -hash_initialize (unsigned candidate, const Hash_tuning *tuning, | |
c4b576de | 237 | +_recode_hash_initialize (unsigned candidate, const Hash_tuning *tuning, |
5b4a1f52 JB |
238 | Hash_hasher hasher, Hash_comparator comparator, |
239 | Hash_data_freer data_freer) | |
240 | { | |
c4b576de | 241 | @@ -563,7 +563,7 @@ |
5b4a1f52 JB |
242 | affected entries. */ |
243 | ||
244 | void | |
245 | -hash_clear (Hash_table *table) | |
c4b576de | 246 | +_recode_hash_clear (Hash_table *table) |
5b4a1f52 JB |
247 | { |
248 | struct hash_entry *bucket; | |
249 | struct hash_entry *cursor; | |
c4b576de | 250 | @@ -603,7 +603,7 @@ |
5b4a1f52 JB |
251 | entry. */ |
252 | ||
253 | void | |
254 | -hash_free (Hash_table *table) | |
c4b576de | 255 | +_recode_hash_free (Hash_table *table) |
5b4a1f52 JB |
256 | { |
257 | struct hash_entry *bucket; | |
258 | struct hash_entry *cursor; | |
c4b576de | 259 | @@ -773,14 +773,14 @@ |
5b4a1f52 JB |
260 | exact number of buckets desired. */ |
261 | ||
262 | bool | |
263 | -hash_rehash (Hash_table *table, unsigned candidate) | |
c4b576de | 264 | +_recode_hash_rehash (Hash_table *table, unsigned candidate) |
5b4a1f52 JB |
265 | { |
266 | Hash_table *new_table; | |
267 | struct hash_entry *bucket; | |
268 | struct hash_entry *cursor; | |
269 | struct hash_entry *next; | |
270 | ||
271 | - new_table = hash_initialize (candidate, table->tuning, table->hasher, | |
c4b576de | 272 | + new_table = _recode_hash_initialize (candidate, table->tuning, table->hasher, |
5b4a1f52 JB |
273 | table->comparator, table->data_freer); |
274 | if (new_table == NULL) | |
275 | return false; | |
c4b576de | 276 | @@ -859,7 +859,7 @@ |
5b4a1f52 JB |
277 | Return NULL if the storage required for insertion cannot be allocated. */ |
278 | ||
279 | void * | |
280 | -hash_insert (Hash_table *table, const void *entry) | |
c4b576de | 281 | +_recode_hash_insert (Hash_table *table, const void *entry) |
5b4a1f52 JB |
282 | { |
283 | void *data; | |
284 | struct hash_entry *bucket; | |
c4b576de | 285 | @@ -916,7 +916,7 @@ |
5b4a1f52 JB |
286 | * tuning->growth_threshold)); |
287 | ||
288 | /* If the rehash fails, arrange to return NULL. */ | |
289 | - if (!hash_rehash (table, candidate)) | |
c4b576de | 290 | + if (!_recode_hash_rehash (table, candidate)) |
5b4a1f52 JB |
291 | entry = NULL; |
292 | } | |
293 | } | |
c4b576de | 294 | @@ -929,7 +929,7 @@ |
5b4a1f52 JB |
295 | table, don't modify the table and return NULL. */ |
296 | ||
297 | void * | |
298 | -hash_delete (Hash_table *table, const void *entry) | |
c4b576de | 299 | +_recode_hash_delete (Hash_table *table, const void *entry) |
5b4a1f52 JB |
300 | { |
301 | void *data; | |
302 | struct hash_entry *bucket; | |
c4b576de | 303 | @@ -961,7 +961,7 @@ |
5b4a1f52 JB |
304 | : (table->n_buckets * tuning->shrink_factor |
305 | * tuning->growth_threshold)); | |
306 | ||
307 | - hash_rehash (table, candidate); | |
c4b576de | 308 | + _recode_hash_rehash (table, candidate); |
5b4a1f52 JB |
309 | } |
310 | } | |
311 | } | |
c4b576de | 312 | @@ -974,7 +974,7 @@ |
5b4a1f52 JB |
313 | #if TESTING |
314 | ||
315 | void | |
316 | -hash_print (const Hash_table *table) | |
c4b576de | 317 | +_recode_hash_print (const Hash_table *table) |
5b4a1f52 JB |
318 | { |
319 | struct hash_entry *bucket; | |
320 | ||
c4b576de JB |
321 | diff -Nur recode-3.6.orig/src/hash.h recode-3.6/src/hash.h |
322 | --- recode-3.6.orig/src/hash.h Thu Aug 3 03:21:15 2000 | |
323 | +++ recode-3.6/src/hash.h Sun Oct 27 12:01:29 2002 | |
5b4a1f52 JB |
324 | @@ -91,30 +91,30 @@ |
325 | typedef struct hash_table Hash_table; | |
326 | ||
327 | /* Information and lookup. */ | |
328 | -unsigned hash_get_n_buckets PARAMS ((const Hash_table *)); | |
329 | -unsigned hash_get_n_buckets_used PARAMS ((const Hash_table *)); | |
330 | -unsigned hash_get_n_entries PARAMS ((const Hash_table *)); | |
331 | -unsigned hash_get_max_bucket_length PARAMS ((const Hash_table *)); | |
332 | -bool hash_table_ok PARAMS ((const Hash_table *)); | |
333 | -void hash_print_statistics PARAMS ((const Hash_table *, FILE *)); | |
334 | -void *hash_lookup PARAMS ((const Hash_table *, const void *)); | |
c4b576de JB |
335 | +unsigned _recode_hash_get_n_buckets PARAMS ((const Hash_table *)); |
336 | +unsigned _recode_hash_get_n_buckets_used PARAMS ((const Hash_table *)); | |
337 | +unsigned _recode_hash_get_n_entries PARAMS ((const Hash_table *)); | |
338 | +unsigned _recode_hash_get_max_bucket_length PARAMS ((const Hash_table *)); | |
339 | +bool _recode_hash_table_ok PARAMS ((const Hash_table *)); | |
340 | +void _recode_hash_print_statistics PARAMS ((const Hash_table *, FILE *)); | |
341 | +void *_recode_hash_lookup PARAMS ((const Hash_table *, const void *)); | |
5b4a1f52 JB |
342 | |
343 | /* Walking. */ | |
344 | -void *hash_get_first PARAMS ((const Hash_table *)); | |
345 | -void *hash_get_next PARAMS ((const Hash_table *, const void *)); | |
346 | -unsigned hash_get_entries PARAMS ((const Hash_table *, void **, unsigned)); | |
347 | -unsigned hash_do_for_each PARAMS ((const Hash_table *, Hash_processor, void *)); | |
c4b576de JB |
348 | +void *_recode_hash_get_first PARAMS ((const Hash_table *)); |
349 | +void *_recode_hash_get_next PARAMS ((const Hash_table *, const void *)); | |
350 | +unsigned _recode_hash_get_entries PARAMS ((const Hash_table *, void **, unsigned)); | |
351 | +unsigned _recode_hash_do_for_each PARAMS ((const Hash_table *, Hash_processor, void *)); | |
5b4a1f52 JB |
352 | |
353 | /* Allocation and clean-up. */ | |
354 | -unsigned hash_string PARAMS ((const char *, unsigned)); | |
355 | -void hash_reset_tuning PARAMS ((Hash_tuning *)); | |
356 | -Hash_table *hash_initialize PARAMS ((unsigned, const Hash_tuning *, | |
c4b576de JB |
357 | +unsigned _recode_hash_string PARAMS ((const char *, unsigned)); |
358 | +void _recode_hash_reset_tuning PARAMS ((Hash_tuning *)); | |
359 | +Hash_table *_recode_hash_initialize PARAMS ((unsigned, const Hash_tuning *, | |
5b4a1f52 JB |
360 | Hash_hasher, Hash_comparator, |
361 | Hash_data_freer)); | |
362 | -void hash_clear PARAMS ((Hash_table *)); | |
363 | -void hash_free PARAMS ((Hash_table *)); | |
c4b576de JB |
364 | +void _recode_hash_clear PARAMS ((Hash_table *)); |
365 | +void _recode_hash_free PARAMS ((Hash_table *)); | |
5b4a1f52 JB |
366 | |
367 | /* Insertion and deletion. */ | |
368 | -bool hash_rehash PARAMS ((Hash_table *, unsigned)); | |
369 | -void *hash_insert PARAMS ((Hash_table *, const void *)); | |
370 | -void *hash_delete PARAMS ((Hash_table *, const void *)); | |
c4b576de JB |
371 | +bool _recode_hash_rehash PARAMS ((Hash_table *, unsigned)); |
372 | +void *_recode_hash_insert PARAMS ((Hash_table *, const void *)); | |
373 | +void *_recode_hash_delete PARAMS ((Hash_table *, const void *)); | |
374 | diff -Nur recode-3.6.orig/src/html.c recode-3.6/src/html.c | |
375 | --- recode-3.6.orig/src/html.c Fri Aug 18 23:34:28 2000 | |
376 | +++ recode-3.6/src/html.c Sun Oct 27 12:01:29 2002 | |
377 | @@ -425,14 +425,14 @@ | |
5b4a1f52 JB |
378 | if (before_options || after_options) |
379 | return false; | |
380 | ||
381 | - table = hash_initialize (0, NULL, code_hash, code_compare, NULL); | |
c4b576de | 382 | + table = _recode_hash_initialize (0, NULL, code_hash, code_compare, NULL); |
5b4a1f52 JB |
383 | if (!table) |
384 | return false; | |
385 | ||
386 | for (cursor = translations; cursor->code; cursor++) | |
387 | if (cursor->flags & mask | |
388 | && (!request->diacritics_only || cursor->code > 128)) | |
389 | - if (!hash_insert (table, cursor)) | |
c4b576de | 390 | + if (!_recode_hash_insert (table, cursor)) |
5b4a1f52 JB |
391 | return false; |
392 | ||
393 | step->step_type = RECODE_UCS2_TO_STRING; | |
c4b576de | 394 | @@ -516,7 +516,7 @@ |
5b4a1f52 JB |
395 | struct ucs2_to_string *entry; |
396 | ||
397 | lookup.code = value; | |
398 | - entry = hash_lookup (table, &lookup); | |
c4b576de | 399 | + entry = _recode_hash_lookup (table, &lookup); |
5b4a1f52 JB |
400 | if (entry) |
401 | { | |
402 | const char *cursor = entry->string; | |
c4b576de | 403 | @@ -573,7 +573,7 @@ |
5b4a1f52 JB |
404 | { |
405 | struct ucs2_to_string const *data = void_data; | |
406 | ||
407 | - return hash_string (data->string, table_size); | |
c4b576de | 408 | + return _recode_hash_string (data->string, table_size); |
5b4a1f52 JB |
409 | } |
410 | ||
411 | /*----------------------------------------. | |
c4b576de | 412 | @@ -606,14 +606,14 @@ |
5b4a1f52 JB |
413 | if (before_options || after_options) |
414 | return false; | |
415 | ||
416 | - table = hash_initialize (0, NULL, string_hash, string_compare, NULL); | |
c4b576de | 417 | + table = _recode_hash_initialize (0, NULL, string_hash, string_compare, NULL); |
5b4a1f52 JB |
418 | if (!table) |
419 | return false; | |
420 | ||
421 | for (cursor = translations; cursor->code; cursor++) | |
422 | if (cursor->flags & mask | |
423 | && (!request->diacritics_only || cursor->code > 128)) | |
424 | - if (!hash_insert (table, cursor)) | |
c4b576de | 425 | + if (!_recode_hash_insert (table, cursor)) |
5b4a1f52 JB |
426 | return false; |
427 | ||
428 | step->step_type = RECODE_STRING_TO_UCS2; | |
c4b576de | 429 | @@ -825,7 +825,7 @@ |
5b4a1f52 JB |
430 | struct ucs2_to_string *entry; |
431 | ||
432 | lookup.string = buffer; | |
433 | - entry = hash_lookup (subtask->step->step_table, &lookup); | |
c4b576de | 434 | + entry = _recode_hash_lookup (subtask->step->step_table, &lookup); |
5b4a1f52 JB |
435 | if (entry) |
436 | { | |
437 | put_ucs2 (entry->code, subtask); | |
c4b576de JB |
438 | diff -Nur recode-3.6.orig/src/names.c recode-3.6/src/names.c |
439 | --- recode-3.6.orig/src/names.c Wed Dec 6 20:41:29 2000 | |
440 | +++ recode-3.6/src/names.c Sun Oct 27 12:01:29 2002 | |
5b4a1f52 JB |
441 | @@ -89,7 +89,7 @@ |
442 | { | |
443 | RECODE_CONST_ALIAS alias = void_alias; | |
444 | ||
445 | - return hash_string (alias->name, limit); | |
c4b576de | 446 | + return _recode_hash_string (alias->name, limit); |
5b4a1f52 JB |
447 | } |
448 | ||
449 | static bool | |
450 | @@ -108,7 +108,7 @@ | |
451 | outer->number_of_symbols = 0; | |
452 | ||
453 | outer->alias_table | |
c4b576de JB |
454 | - = hash_initialize (800, NULL, alias_hasher, alias_comparator, free); |
455 | + = _recode_hash_initialize (800, NULL, alias_hasher, alias_comparator, free); | |
5b4a1f52 JB |
456 | if (!outer->alias_table) |
457 | return false; | |
458 | ||
c4b576de | 459 | @@ -270,7 +270,7 @@ |
5b4a1f52 JB |
460 | lookup.name = name; |
461 | if (!lookup.name) | |
462 | return NULL; | |
463 | - if (alias = hash_lookup (outer->alias_table, &lookup), alias) | |
c4b576de | 464 | + if (alias = _recode_hash_lookup (outer->alias_table, &lookup), alias) |
5b4a1f52 JB |
465 | return alias; |
466 | ||
467 | /* If we reach this point, find_type is necessarily one of SYMBOL_CREATE_*. | |
c4b576de | 468 | @@ -296,7 +296,7 @@ |
5b4a1f52 JB |
469 | alias->name = name; |
470 | alias->symbol = symbol; | |
471 | alias->implied_surfaces = NULL; | |
472 | - if (!hash_insert (outer->alias_table, alias)) | |
c4b576de | 473 | + if (!_recode_hash_insert (outer->alias_table, alias)) |
5b4a1f52 JB |
474 | { |
475 | free (symbol); | |
476 | free (alias); | |
c4b576de | 477 | @@ -328,7 +328,7 @@ |
5b4a1f52 JB |
478 | symbol = alias->symbol; |
479 | ||
480 | lookup.name = name; | |
481 | - if (alias = hash_lookup (outer->alias_table, &lookup), alias) | |
c4b576de | 482 | + if (alias = _recode_hash_lookup (outer->alias_table, &lookup), alias) |
5b4a1f52 JB |
483 | { |
484 | if (alias->symbol == symbol) | |
485 | return alias; | |
c4b576de | 486 | @@ -344,7 +344,7 @@ |
5b4a1f52 JB |
487 | alias->name = name; |
488 | alias->symbol = symbol; | |
489 | alias->implied_surfaces = NULL; | |
490 | - if (!hash_insert (outer->alias_table, alias)) | |
c4b576de | 491 | + if (!_recode_hash_insert (outer->alias_table, alias)) |
5b4a1f52 JB |
492 | { |
493 | free (alias); | |
494 | return NULL; | |
c4b576de | 495 | @@ -446,7 +446,7 @@ |
5b4a1f52 JB |
496 | struct make_argmatch_walk walk; /* wanderer's data */ |
497 | ||
498 | #if HASH_STATS | |
499 | - hash_print_statistics (outer->alias_table, stderr); | |
c4b576de | 500 | + _recode_hash_print_statistics (outer->alias_table, stderr); |
5b4a1f52 JB |
501 | #endif |
502 | ||
503 | /* It may happen that new modules are added only once all initialisation | |
c4b576de | 504 | @@ -468,7 +468,7 @@ |
5b4a1f52 JB |
505 | walk.outer = outer; |
506 | walk.charset_counter = 0; | |
507 | walk.surface_counter = 0; | |
508 | - hash_do_for_each (outer->alias_table, make_argmatch_walker_1, &walk); | |
c4b576de | 509 | + _recode_hash_do_for_each (outer->alias_table, make_argmatch_walker_1, &walk); |
5b4a1f52 JB |
510 | |
511 | /* Allocate the argmatch and realname arrays, each with a NULL sentinel. */ | |
512 | ||
c4b576de | 513 | @@ -500,7 +500,7 @@ |
5b4a1f52 JB |
514 | |
515 | walk.charset_counter = 0; | |
516 | walk.surface_counter = 0; | |
517 | - hash_do_for_each (outer->alias_table, make_argmatch_walker_2, &walk); | |
c4b576de | 518 | + _recode_hash_do_for_each (outer->alias_table, make_argmatch_walker_2, &walk); |
5b4a1f52 JB |
519 | |
520 | return true; | |
521 | } | |
c4b576de | 522 | @@ -655,7 +655,7 @@ |
5b4a1f52 JB |
523 | /* Count how many symbols we have. */ |
524 | ||
525 | walk.number = 0; | |
526 | - hash_do_for_each (outer->alias_table, list_symbols_walker_1, &walk); | |
c4b576de | 527 | + _recode_hash_do_for_each (outer->alias_table, list_symbols_walker_1, &walk); |
5b4a1f52 JB |
528 | |
529 | /* Allocate a structure to hold them. */ | |
530 | ||
c4b576de | 531 | @@ -665,7 +665,7 @@ |
5b4a1f52 JB |
532 | /* Copy all symbols in it. */ |
533 | ||
534 | walk.number = 0; | |
535 | - hash_do_for_each (outer->alias_table, list_symbols_walker_2, &walk); | |
c4b576de | 536 | + _recode_hash_do_for_each (outer->alias_table, list_symbols_walker_2, &walk); |
5b4a1f52 JB |
537 | |
538 | /* Sort it. */ | |
539 | ||
c4b576de JB |
540 | diff -Nur recode-3.6.orig/src/outer.c recode-3.6/src/outer.c |
541 | --- recode-3.6.orig/src/outer.c Wed Aug 30 22:16:14 2000 | |
542 | +++ recode-3.6/src/outer.c Sun Oct 27 12:01:53 2002 | |
543 | @@ -615,7 +615,7 @@ | |
544 | if (outer->pair_restriction) | |
545 | free (outer->pair_restriction); | |
546 | if (outer->alias_table) | |
547 | - hash_free (outer->alias_table); | |
548 | + _recode_hash_free (outer->alias_table); | |
549 | if (outer->argmatch_charset_array) | |
550 | free (outer->argmatch_charset_array); | |
551 | if (outer->one_to_same) | |
552 | diff -Nur recode-3.6.orig/src/recode.c recode-3.6/src/recode.c | |
553 | --- recode-3.6.orig/src/recode.c Sat Jul 1 20:22:55 2000 | |
554 | +++ recode-3.6/src/recode.c Sun Oct 27 12:01:29 2002 | |
555 | @@ -419,14 +419,14 @@ | |
5b4a1f52 JB |
556 | if (before_options || after_options) |
557 | return false; | |
558 | ||
559 | - table = hash_initialize (0, NULL, | |
c4b576de | 560 | + table = _recode_hash_initialize (0, NULL, |
5b4a1f52 JB |
561 | ucs2_to_byte_hash, ucs2_to_byte_compare, NULL); |
562 | if (!table) | |
563 | return false; | |
c4b576de JB |
564 | |
565 | if (!ALLOC (data, 256, struct ucs2_to_byte)) | |
566 | { | |
567 | - hash_free (table); | |
568 | + _recode_hash_free (table); | |
569 | return false; | |
570 | } | |
571 | ||
572 | @@ -434,9 +434,9 @@ | |
5b4a1f52 JB |
573 | { |
574 | data[counter].code = code_to_ucs2 (step->after, counter); | |
575 | data[counter].byte = counter; | |
576 | - if (!hash_insert (table, data + counter)) | |
c4b576de JB |
577 | + if (!_recode_hash_insert (table, data + counter)) |
578 | { | |
579 | - hash_free (table); | |
580 | + _recode_hash_free (table); | |
581 | free (data); | |
582 | return false; | |
583 | } | |
584 | @@ -457,7 +457,7 @@ | |
5b4a1f52 JB |
585 | while (get_ucs2 (&input_value, subtask)) |
586 | { | |
587 | lookup.code = input_value; | |
588 | - entry = hash_lookup (table, &lookup); | |
c4b576de | 589 | + entry = _recode_hash_lookup (table, &lookup); |
5b4a1f52 JB |
590 | if (entry) |
591 | put_byte (entry->byte, subtask); | |
592 | else | |
c4b576de JB |
593 | diff -Nur recode-3.6.orig/src/testdump.c recode-3.6/src/testdump.c |
594 | --- recode-3.6.orig/src/testdump.c Thu Jun 29 17:23:52 2000 | |
595 | +++ recode-3.6/src/testdump.c Sun Oct 27 12:01:29 2002 | |
5b4a1f52 JB |
596 | @@ -152,7 +152,7 @@ |
597 | size_t size; /* number of different characters */ | |
598 | struct ucs2_to_count **array; /* array into hash table items */ | |
599 | ||
600 | - table = hash_initialize (0, NULL, | |
c4b576de JB |
601 | + table = _recode_hash_initialize (0, NULL, |
602 | ucs2_to_count_hash, ucs2_to_count_compare, free); | |
5b4a1f52 JB |
603 | if (!table) |
604 | return false; | |
c4b576de | 605 | @@ -168,21 +168,21 @@ |
5b4a1f52 JB |
606 | struct ucs2_to_count *entry; |
607 | ||
608 | lookup.code = character; | |
609 | - entry = hash_lookup (table, &lookup); | |
c4b576de | 610 | + entry = _recode_hash_lookup (table, &lookup); |
5b4a1f52 JB |
611 | if (entry) |
612 | entry->count++; | |
613 | else | |
c4b576de JB |
614 | { |
615 | if (!ALLOC (entry, 1, struct ucs2_to_count)) | |
616 | { | |
617 | - hash_free (table); | |
618 | + _recode_hash_free (table); | |
619 | return false; | |
620 | } | |
5b4a1f52 JB |
621 | entry->code = character; |
622 | entry->count = 1; | |
623 | - if (!hash_insert (table, entry)) | |
c4b576de JB |
624 | + if (!_recode_hash_insert (table, entry)) |
625 | { | |
626 | - hash_free (table); | |
627 | + _recode_hash_free (table); | |
628 | free (entry); | |
629 | return false; | |
630 | } | |
631 | @@ -192,14 +192,14 @@ | |
5b4a1f52 JB |
632 | |
633 | /* Sort results. */ | |
634 | ||
635 | - size = hash_get_n_entries (table); | |
c4b576de | 636 | + size = _recode_hash_get_n_entries (table); |
5b4a1f52 JB |
637 | |
638 | if (!ALLOC (array, size, struct ucs2_to_count *)) | |
c4b576de JB |
639 | { |
640 | - hash_free (table); | |
641 | + _recode_hash_free (table); | |
642 | return false; | |
643 | } | |
5b4a1f52 | 644 | - hash_get_entries (table, (void **) array, size); |
c4b576de | 645 | + _recode_hash_get_entries (table, (void **) array, size); |
5b4a1f52 JB |
646 | |
647 | qsort (array, size, sizeof (struct ucs2_to_count *), compare_item); | |
648 | ||
c4b576de JB |
649 | @@ -260,7 +260,7 @@ |
650 | /* Clean-up. */ | |
651 | ||
652 | free (array); | |
5b4a1f52 | 653 | - hash_free (table); |
c4b576de | 654 | + _recode_hash_free (table); |
5b4a1f52 JB |
655 | |
656 | SUBTASK_RETURN (subtask); | |
657 | } |