1 /* C code produced by gperf version 2.5 (GNU C++ version) */
2 /* Command-line: gperf -acCgopt -k1,2,5,$ -N locfile_hash programs/locfile-kw.gperf */
3 /* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
5 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
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.
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.
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. */
24 #include "locfile-token.h"
27 #define TOTAL_KEYWORDS 74
28 #define MIN_WORD_LENGTH 3
29 #define MAX_WORD_LENGTH 17
30 #define MIN_HASH_VALUE 3
31 #define MAX_HASH_VALUE 178
32 /* maximum key range = 176, duplicates = 0 */
38 hash (register const char *str
, register int len
)
40 static const unsigned char asso_values
[] =
42 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
43 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
44 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
45 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
46 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
47 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
48 179, 179, 179, 179, 179, 179, 179, 0, 0, 0,
49 0, 0, 179, 0, 179, 179, 0, 179, 0, 45,
50 179, 179, 0, 0, 0, 5, 179, 179, 179, 10,
51 179, 179, 179, 179, 179, 5, 179, 0, 5, 0,
52 15, 20, 5, 20, 40, 20, 179, 25, 15, 50,
53 10, 0, 0, 179, 45, 50, 0, 30, 0, 5,
54 10, 60, 179, 179, 179, 179, 179, 179,
56 register int hval
= len
;
62 hval
+= asso_values
[str
[4]];
66 hval
+= asso_values
[str
[1]];
68 hval
+= asso_values
[str
[0]];
71 return hval
+ asso_values
[str
[len
- 1]];
77 const struct keyword_t
*
78 locfile_hash (register const char *str
, register int len
)
80 static const struct keyword_t wordlist
[] =
85 {"IGNORE", tok_ignore
, 0},
86 {"LC_TIME", tok_lc_time
, 0},
87 {"LC_CTYPE", tok_lc_ctype
, 0},
89 {"t_fmt", tok_t_fmt
, 0},
90 {"LC_MESSAGES", tok_lc_messages
, 0},
92 {"UNDEFINED", tok_undefined
, 0},
93 {"LC_NUMERIC", tok_lc_numeric
, 0},
95 {"collating-element", tok_collating_element
, 0},
96 {"position", tok_position
, 0},
98 {"alpha", tok_alpha
, 0},
100 {"positive_sign", tok_positive_sign
, 0},
102 {"d_fmt", tok_d_fmt
, 0},
104 {"forward", tok_forward
, 0},
106 {"abmon", tok_abmon
, 0},
107 {"collating-symbol", tok_collating_symbol
, 0},
108 {"d_t_fmt", tok_d_t_fmt
, 0},
109 {"backward", tok_backward
, 0},
111 {"punct", tok_punct
, 0},
113 {"p_sep_by_space", tok_p_sep_by_space
, 0},
114 {"digit", tok_digit
, 0},
115 {"",}, {"",}, {"",}, {"",},
116 {"cntrl", tok_cntrl
, 0},
117 {"p_sign_posn", tok_p_sign_posn
, 0},
119 {"charconv", tok_charconv
, 0},
120 {"n_sep_by_space", tok_n_sep_by_space
, 0},
121 {"print", tok_print
, 0},
122 {"xdigit", tok_xdigit
, 0},
123 {"toupper", tok_toupper
, 0},
124 {"negative_sign", tok_negative_sign
, 0},
126 {"LC_COLLATE", tok_lc_collate
, 0},
127 {"n_sign_posn", tok_n_sign_posn
, 0},
128 {"tolower", tok_tolower
, 0},
130 {"int_curr_symbol", tok_int_curr_symbol
, 0},
131 {"noexpr", tok_noexpr
, 0},
134 {"copy", tok_copy
, 0},
135 {"t_fmt_ampm", tok_t_fmt_ampm
, 0},
136 {"LC_MONETARY", tok_lc_monetary
, 0},
137 {"mon_thousands_sep", tok_mon_thousands_sep
, 0},
139 {"",}, {"",}, {"",}, {"",},
140 {"p_cs_precedes", tok_p_cs_precedes
, 0},
141 {"era_t_fmt", tok_era_t_fmt
, 0},
142 {"blank", tok_blank
, 0},
144 {"comment_char", tok_comment_char
, 0},
147 {"currency_symbol", tok_currency_symbol
, 0},
149 {"mon_decimal_point", tok_mon_decimal_point
, 0},
150 {"n_cs_precedes", tok_n_cs_precedes
, 0},
151 {"",}, {"",}, {"",}, {"",}, {"",},
152 {"era_d_fmt", tok_era_d_fmt
, 0},
153 {"alt_digits", tok_alt_digits
, 0},
154 {"era_d_t_fmt", tok_era_d_t_fmt
, 0},
156 {"grouping", tok_grouping
, 0},
158 {"space", tok_space
, 0},
160 {"decimal_point", tok_decimal_point
, 0},
161 {"charclass", tok_charclass
, 0},
162 {"int_frac_digits", tok_int_frac_digits
, 0},
163 {"order_start", tok_order_start
, 0},
164 {"mon_grouping", tok_mon_grouping
, 0},
165 {"thousands_sep", tok_thousands_sep
, 0},
166 {"from", tok_from
, 0},
167 {"nostr", tok_nostr
, 0},
168 {"",}, {"",}, {"",}, {"",},
169 {"lower", tok_lower
, 0},
171 {"order_end", tok_order_end
, 0},
173 {"frac_digits", tok_frac_digits
, 0},
175 {"alnum", tok_alnum
, 0},
177 {"repertoiremap", tok_repertoiremap
, 0},
179 {"upper", tok_upper
, 0},
180 {"escape_char", tok_escape_char
, 0},
182 {"abday", tok_abday
, 0},
183 {"yesstr", tok_yesstr
, 0},
184 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
186 {"yesexpr", tok_yesexpr
, 0},
187 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
188 {"graph", tok_graph
, 0},
189 {"",}, {"",}, {"",}, {"",},
190 {"am_pm", tok_am_pm
, 0},
191 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
192 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
193 {"",}, {"",}, {"",}, {"",},
194 {"era_year", tok_era_year
, 0},
197 if (len
<= MAX_WORD_LENGTH
&& len
>= MIN_WORD_LENGTH
)
199 register int key
= hash (str
, len
);
201 if (key
<= MAX_HASH_VALUE
&& key
>= 0)
203 register const char *s
= wordlist
[key
].name
;
205 if (*s
== *str
&& !strncmp (str
+ 1, s
+ 1, len
- 1))
206 return &wordlist
[key
];