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