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