]>
Commit | Line | Data |
---|---|---|
4b10dd6c UD |
1 | /* ANSI-C code produced by gperf version 2.7.1 (19981006 egcs) */ |
2 | /* Command-line: gperf -acCgopt -k1,2,5,9,$ -L ANSI-C -N locfile_hash programs/locfile-kw.gperf */ | |
3 | /* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. | |
c84142e8 | 4 | This file is part of the GNU C Library. |
4b10dd6c | 5 | Contributed by Ulrich Drepper <drepper@gnu.org>, 1996. |
19bc17a9 | 6 | |
c84142e8 UD |
7 | The GNU C Library is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU Library General Public License as | |
9 | published by the Free Software Foundation; either version 2 of the | |
10 | License, or (at your option) any later version. | |
19bc17a9 | 11 | |
c84142e8 UD |
12 | The GNU C Library is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | Library General Public License for more details. | |
19bc17a9 | 16 | |
c84142e8 UD |
17 | You should have received a copy of the GNU Library General Public |
18 | License along with the GNU C Library; see the file COPYING.LIB. If not, | |
19 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
20 | Boston, MA 02111-1307, USA. */ | |
19bc17a9 RM |
21 | |
22 | #include <string.h> | |
23 | ||
24 | #include "locfile-token.h" | |
25 | struct keyword_t ; | |
26 | ||
4b10dd6c | 27 | #define TOTAL_KEYWORDS 172 |
19bc17a9 | 28 | #define MIN_WORD_LENGTH 3 |
4b10dd6c | 29 | #define MAX_WORD_LENGTH 22 |
19bc17a9 | 30 | #define MIN_HASH_VALUE 3 |
4b10dd6c UD |
31 | #define MAX_HASH_VALUE 545 |
32 | /* maximum key range = 543, duplicates = 0 */ | |
19bc17a9 RM |
33 | |
34 | #ifdef __GNUC__ | |
4b10dd6c | 35 | __inline |
19bc17a9 RM |
36 | #endif |
37 | static unsigned int | |
4b10dd6c | 38 | hash (register const char *str, register unsigned int len) |
19bc17a9 | 39 | { |
4b10dd6c | 40 | static const unsigned short asso_values[] = |
19bc17a9 | 41 | { |
4b10dd6c UD |
42 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, |
43 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
44 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
45 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
46 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
47 | 5, 0, 546, 546, 546, 546, 546, 546, 546, 546, | |
48 | 546, 546, 546, 546, 546, 20, 546, 0, 0, 0, | |
49 | 5, 30, 0, 0, 546, 546, 0, 546, 0, 0, | |
50 | 546, 546, 10, 0, 5, 10, 546, 546, 546, 0, | |
51 | 546, 546, 546, 546, 546, 30, 546, 0, 10, 125, | |
52 | 5, 0, 105, 30, 5, 95, 546, 0, 105, 155, | |
53 | 135, 50, 75, 0, 5, 45, 0, 55, 0, 30, | |
54 | 25, 25, 10, 546, 546, 546, 546, 546, 546, 546, | |
55 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
56 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
57 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
58 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
59 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
60 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
61 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
62 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
63 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
64 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
65 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
66 | 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, | |
67 | 546, 546, 546, 546, 546, 546 | |
19bc17a9 RM |
68 | }; |
69 | register int hval = len; | |
70 | ||
71 | switch (hval) | |
72 | { | |
73 | default: | |
4b10dd6c UD |
74 | case 9: |
75 | hval += asso_values[(unsigned char)str[8]]; | |
76 | case 8: | |
77 | case 7: | |
78 | case 6: | |
19bc17a9 | 79 | case 5: |
4b10dd6c | 80 | hval += asso_values[(unsigned char)str[4]]; |
19bc17a9 RM |
81 | case 4: |
82 | case 3: | |
83 | case 2: | |
4b10dd6c | 84 | hval += asso_values[(unsigned char)str[1]]; |
19bc17a9 | 85 | case 1: |
4b10dd6c | 86 | hval += asso_values[(unsigned char)str[0]]; |
19bc17a9 RM |
87 | break; |
88 | } | |
4b10dd6c | 89 | return hval + asso_values[(unsigned char)str[len - 1]]; |
19bc17a9 RM |
90 | } |
91 | ||
92 | #ifdef __GNUC__ | |
4b10dd6c | 93 | __inline |
19bc17a9 RM |
94 | #endif |
95 | const struct keyword_t * | |
4b10dd6c | 96 | locfile_hash (register const char *str, register unsigned int len) |
19bc17a9 RM |
97 | { |
98 | static const struct keyword_t wordlist[] = | |
99 | { | |
4b10dd6c UD |
100 | {""}, {""}, {""}, |
101 | {"END", tok_end, 0}, | |
102 | {""}, {""}, {""}, | |
103 | {"LC_TIME", tok_lc_time, 0}, | |
104 | {"era", tok_era, 0}, | |
105 | {"date", tok_date, 0}, | |
106 | {"LC_ADDRESS", tok_lc_address, 0}, | |
107 | {""}, | |
108 | {"LC_TELEPHONE", tok_lc_telephone, 0}, | |
109 | {"LC_CTYPE", tok_lc_ctype, 0}, | |
110 | {"era_t_fmt", tok_era_t_fmt, 0}, | |
111 | {"LC_COLLATE", tok_lc_collate, 0}, | |
112 | {"height", tok_height, 0}, | |
113 | {"LC_IDENTIFICATION", tok_lc_identification, 0}, | |
114 | {""}, | |
115 | {"era_d_fmt", tok_era_d_fmt, 0}, | |
116 | {"LC_NUMERIC", tok_lc_numeric, 0}, | |
117 | {""}, {""}, {""}, | |
118 | {"UNDEFINED", tok_undefined, 0}, | |
119 | {""}, | |
120 | {"reorder-end", tok_reorder_end, 0}, | |
121 | {"LC_NAME", tok_lc_name, 0}, | |
122 | {"reorder-after", tok_reorder_after, 0}, | |
123 | {"LC_MEASUREMENT", tok_lc_measurement, 0}, | |
124 | {""}, | |
125 | {"LC_MONETARY", tok_lc_monetary, 0}, | |
126 | {""}, | |
127 | {"day", tok_day, 0}, | |
128 | {"week", tok_week, 0}, | |
129 | {"t_fmt", tok_t_fmt, 0}, | |
130 | {"yesstr", tok_yesstr, 0}, | |
131 | {""}, | |
132 | {"LC_PAPER", tok_lc_paper, 0}, | |
133 | {""}, | |
134 | {"d_fmt", tok_d_fmt, 0}, | |
135 | {"LC_MESSAGES", tok_lc_messages, 0}, | |
136 | {""}, | |
137 | {"era_year", tok_era_year, 0}, | |
138 | {""}, {""}, | |
139 | {"IGNORE", tok_ignore, 0}, | |
140 | {""}, {""}, {""}, | |
141 | {"graph", tok_graph, 0}, | |
142 | {""}, {""}, | |
143 | {"backward", tok_backward, 0}, | |
144 | {""}, {""}, {""}, | |
145 | {"address", tok_address, 0}, | |
146 | {""}, {""}, {""}, {""}, | |
147 | {"yesexpr", tok_yesexpr, 0}, | |
148 | {"audience", tok_audience, 0}, | |
149 | {""}, | |
150 | {"abday", tok_abday, 0}, | |
151 | {""}, {""}, {""}, {""}, {""}, | |
152 | {"order_start", tok_order_start, 0}, | |
153 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
154 | {"order_end", tok_order_end, 0}, | |
155 | {"reorder-sections-end", tok_reorder_sections_end, 0}, | |
156 | {""}, | |
157 | {"reorder-sections-after", tok_reorder_sections_after, 0}, | |
158 | {""}, {""}, | |
159 | {"print", tok_print, 0}, | |
160 | {""}, {""}, {""}, {""}, {""}, {""}, | |
161 | {"tolower", tok_tolower, 0}, | |
162 | {""}, | |
163 | {"translit_start", tok_translit_start, 0}, | |
164 | {""}, {""}, | |
165 | {"translit_end", tok_translit_end, 0}, | |
166 | {""}, {""}, | |
167 | {"title", tok_title, 0}, | |
168 | {""}, {""}, | |
169 | {"repertoiremap", tok_repertoiremap, 0}, | |
170 | {""}, | |
171 | {"digit", tok_digit, 0}, | |
172 | {""}, {""}, | |
173 | {"tel", tok_tel, 0}, | |
174 | {"else", tok_else, 0}, | |
175 | {"alpha", tok_alpha, 0}, | |
176 | {""}, {""}, | |
177 | {"timezone", tok_timezone, 0}, | |
178 | {""}, {""}, {""}, {""}, {""}, {""}, | |
179 | {"blank", tok_blank, 0}, | |
180 | {"tel_dom_fmt", tok_tel_dom_fmt, 0}, | |
181 | {""}, {""}, {""}, | |
182 | {"space", tok_space, 0}, | |
183 | {"era_d_t_fmt", tok_era_d_t_fmt, 0}, | |
184 | {"duo_valid_to", tok_duo_valid_to, 0}, | |
185 | {""}, {""}, {""}, | |
186 | {"xdigit", tok_xdigit, 0}, | |
187 | {""}, | |
188 | {"fax", tok_fax, 0}, | |
189 | {""}, | |
190 | {"punct", tok_punct, 0}, | |
191 | {""}, | |
192 | {"toupper", tok_toupper, 0}, | |
193 | {"symbol-equivalence", tok_symbol_equivalence, 0}, | |
194 | {""}, | |
195 | {"width", tok_width, 0}, | |
196 | {"escape_char", tok_escape_char, 0}, | |
197 | {""}, {""}, | |
198 | {"lang_name", tok_lang_name, 0}, | |
199 | {"upper", tok_upper, 0}, | |
200 | {"define", tok_define, 0}, | |
201 | {"d_t_fmt", tok_d_t_fmt, 0}, | |
202 | {"grouping", tok_grouping, 0}, | |
203 | {""}, {""}, {""}, | |
204 | {"lang_ab", tok_lang_ab, 0}, | |
205 | {"lang_lib", tok_lang_lib, 0}, | |
206 | {"territory", tok_territory, 0}, | |
207 | {""}, {""}, | |
208 | {"abbreviation", tok_abbreviation, 0}, | |
209 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
210 | {"alt_digits", tok_alt_digits, 0}, | |
211 | {""}, | |
212 | {"forward", tok_forward, 0}, | |
213 | {"language", tok_language, 0}, | |
214 | {""}, | |
215 | {"lower", tok_lower, 0}, | |
216 | {""}, {""}, | |
217 | {"name_fmt", tok_name_fmt, 0}, | |
218 | {""}, {""}, {""}, | |
219 | {"name_mr", tok_name_mr, 0}, | |
220 | {""}, {""}, {""}, {""}, | |
221 | {"contact", tok_contact, 0}, | |
222 | {"thousands_sep", tok_thousands_sep, 0}, | |
223 | {""}, {""}, | |
224 | {"country_ab3", tok_country_ab3, 0}, | |
225 | {""}, | |
226 | {"category", tok_category, 0}, | |
227 | {""}, {""}, | |
228 | {"country_ab2", tok_country_ab2, 0}, | |
229 | {""}, | |
230 | {"revision", tok_revision, 0}, | |
231 | {""}, {""}, {""}, {""}, {""}, {""}, | |
232 | {"nostr", tok_nostr, 0}, | |
233 | {""}, {""}, {""}, | |
234 | {"copy", tok_copy, 0}, | |
235 | {""}, {""}, {""}, | |
236 | {"outdigit", tok_outdigit, 0}, | |
237 | {""}, {""}, | |
238 | {"tel_int_fmt", tok_tel_int_fmt, 0}, | |
239 | {""}, {""}, | |
240 | {"elif", tok_elif, 0}, | |
241 | {""}, {""}, | |
242 | {"name_ms", tok_name_ms, 0}, | |
243 | {"name_mrs", tok_name_mrs, 0}, | |
244 | {""}, {""}, | |
245 | {"measurement", tok_measurement, 0}, | |
246 | {"collating-element", tok_collating_element, 0}, | |
247 | {""}, | |
248 | {"p_sep_by_space", tok_p_sep_by_space, 0}, | |
249 | {""}, | |
250 | {"source", tok_source, 0}, | |
251 | {"duo_p_cs_precedes", tok_duo_p_cs_precedes, 0}, | |
252 | {"duo_p_sep_by_space", tok_duo_p_sep_by_space, 0}, | |
253 | {""}, {""}, {""}, {""}, | |
254 | {"map", tok_map, 0}, | |
255 | {"duo_valid_from", tok_duo_valid_from, 0}, | |
256 | {""}, {""}, {""}, | |
257 | {"first_weekday", tok_first_weekday, 0}, | |
258 | {""}, | |
259 | {"conversion_rate", tok_conversion_rate, 0}, | |
260 | {""}, {""}, | |
261 | {"first_workday", tok_first_workday, 0}, | |
262 | {""}, {""}, {""}, {""}, | |
263 | {"decimal_point", tok_decimal_point, 0}, | |
264 | {""}, {""}, {""}, | |
265 | {"duo_int_p_sep_by_space", tok_duo_int_p_sep_by_space, 0}, | |
266 | {""}, {""}, | |
267 | {"duo_frac_digits", tok_duo_frac_digits, 0}, | |
268 | {""}, | |
269 | {"uno_valid_to", tok_uno_valid_to, 0}, | |
270 | {""}, {""}, | |
271 | {"default_missing", tok_default_missing, 0}, | |
272 | {""}, | |
273 | {"country_post", tok_country_post, 0}, | |
274 | {"charconv", tok_charconv, 0}, | |
275 | {"name_miss", tok_name_miss, 0}, | |
276 | {""}, {""}, {""}, | |
277 | {"position", tok_position, 0}, | |
278 | {"from", tok_from, 0}, | |
279 | {"t_fmt_ampm", tok_t_fmt_ampm, 0}, | |
280 | {"noexpr", tok_noexpr, 0}, | |
281 | {""}, {""}, {""}, | |
282 | {"coll_weight_max", tok_coll_weight_max, 0}, | |
283 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
284 | {"n_sep_by_space", tok_n_sep_by_space, 0}, | |
285 | {"abmon", tok_abmon, 0}, | |
286 | {""}, | |
287 | {"duo_n_cs_precedes", tok_duo_n_cs_precedes, 0}, | |
288 | {"duo_n_sep_by_space", tok_duo_n_sep_by_space, 0}, | |
289 | {""}, | |
290 | {"postal_fmt", tok_postal_fmt, 0}, | |
291 | {"frac_digits", tok_frac_digits, 0}, | |
292 | {"include", tok_include, 0}, | |
293 | {""}, {""}, {""}, | |
294 | {"duo_int_p_cs_precedes", tok_duo_int_p_cs_precedes, 0}, | |
295 | {""}, {""}, {""}, {""}, {""}, {""}, | |
296 | {"positive_sign", tok_positive_sign, 0}, | |
297 | {"section-symbol", tok_section_symbol, 0}, | |
298 | {""}, {""}, {""}, | |
299 | {"name_gen", tok_name_gen, 0}, | |
300 | {"duo_currency_symbol", tok_duo_currency_symbol, 0}, | |
301 | {""}, {""}, | |
302 | {"duo_int_n_sep_by_space", tok_duo_int_n_sep_by_space, 0}, | |
303 | {"negative_sign", tok_negative_sign, 0}, | |
304 | {""}, | |
305 | {"duo_p_sign_posn", tok_duo_p_sign_posn, 0}, | |
306 | {"country_car", tok_country_car, 0}, | |
307 | {"comment_char", tok_comment_char, 0}, | |
308 | {"p_cs_precedes", tok_p_cs_precedes, 0}, | |
309 | {""}, {""}, {""}, | |
310 | {"country_name", tok_country_name, 0}, | |
311 | {""}, | |
312 | {"duo_int_frac_digits", tok_duo_int_frac_digits, 0}, | |
313 | {"class", tok_class, 0}, | |
314 | {"collating-symbol", tok_collating_symbol, 0}, | |
315 | {""}, {""}, {""}, | |
316 | {"currency_symbol", tok_currency_symbol, 0}, | |
317 | {"p_sign_posn", tok_p_sign_posn, 0}, | |
318 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
319 | {""}, | |
320 | {"mon_thousands_sep", tok_mon_thousands_sep, 0}, | |
321 | {"mon", tok_mon, 0}, | |
322 | {""}, {""}, {""}, {""}, {""}, {""}, | |
323 | {"endif", tok_endif, 0}, | |
324 | {""}, | |
325 | {"mon_grouping", tok_mon_grouping, 0}, | |
326 | {""}, | |
327 | {"charclass", tok_charclass, 0}, | |
328 | {""}, | |
329 | {"duo_int_n_cs_precedes", tok_duo_int_n_cs_precedes, 0}, | |
330 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
331 | {"uno_valid_from", tok_uno_valid_from, 0}, | |
332 | {""}, {""}, {""}, {""}, {""}, | |
333 | {"email", tok_email, 0}, | |
334 | {""}, {""}, {""}, {""}, | |
335 | {"duo_n_sign_posn", tok_duo_n_sign_posn, 0}, | |
336 | {""}, {""}, | |
337 | {"n_cs_precedes", tok_n_cs_precedes, 0}, | |
338 | {""}, {""}, {""}, | |
339 | {"mon_decimal_point", tok_mon_decimal_point, 0}, | |
340 | {""}, | |
341 | {"duo_int_p_sign_posn", tok_duo_int_p_sign_posn, 0}, | |
342 | {""}, {""}, {""}, {""}, {""}, {""}, | |
343 | {"n_sign_posn", tok_n_sign_posn, 0}, | |
344 | {""}, {""}, {""}, {""}, {""}, | |
345 | {"int_p_cs_precedes", tok_int_p_cs_precedes, 0}, | |
346 | {"int_p_sep_by_space", tok_int_p_sep_by_space, 0}, | |
347 | {""}, {""}, {""}, {""}, | |
348 | {"cal_direction", tok_cal_direction, 0}, | |
349 | {"duo_int_curr_symbol", tok_duo_int_curr_symbol, 0}, | |
350 | {"undef", tok_undef, 0}, | |
351 | {""}, {""}, {""}, {""}, | |
352 | {"int_select", tok_int_select, 0}, | |
353 | {"application", tok_application, 0}, | |
354 | {""}, {""}, {""}, | |
355 | {"ifdef", tok_ifdef, 0}, | |
356 | {""}, | |
357 | {"country_isbn", tok_country_isbn, 0}, | |
358 | {""}, {""}, | |
359 | {"alnum", tok_alnum, 0}, | |
360 | {""}, {""}, {""}, {""}, | |
361 | {"int_frac_digits", tok_int_frac_digits, 0}, | |
362 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
363 | {"int_prefix", tok_int_prefix, 0}, | |
364 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
365 | {"duo_int_n_sign_posn", tok_duo_int_n_sign_posn, 0}, | |
366 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
367 | {"lang_term", tok_lang_term, 0}, | |
368 | {""}, {""}, | |
369 | {"int_n_cs_precedes", tok_int_n_cs_precedes, 0}, | |
370 | {"int_n_sep_by_space", tok_int_n_sep_by_space, 0}, | |
371 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
372 | {""}, {""}, | |
373 | {"am_pm", tok_am_pm, 0}, | |
374 | {""}, {""}, {""}, {""}, | |
375 | {"cntrl", tok_cntrl, 0}, | |
376 | {"country_num", tok_country_num, 0}, | |
377 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
378 | {"int_p_sign_posn", tok_int_p_sign_posn, 0}, | |
379 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
380 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
381 | {""}, | |
382 | {"int_curr_symbol", tok_int_curr_symbol, 0}, | |
383 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
384 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
385 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
386 | {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, | |
387 | {""}, {""}, {""}, | |
388 | {"int_n_sign_posn", tok_int_n_sign_posn, 0} | |
19bc17a9 RM |
389 | }; |
390 | ||
391 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) | |
392 | { | |
393 | register int key = hash (str, len); | |
394 | ||
395 | if (key <= MAX_HASH_VALUE && key >= 0) | |
396 | { | |
397 | register const char *s = wordlist[key].name; | |
398 | ||
4b10dd6c | 399 | if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) |
19bc17a9 RM |
400 | return &wordlist[key]; |
401 | } | |
402 | } | |
403 | return 0; | |
404 | } |