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