1 /* ANSI-C code produced by gperf version 3.2 */
2 /* Command-line: gperf -m 10 ./iconv_open-zos.gperf */
3 /* Computed positions: -k'4,$' */
4
5 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
6 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
7 && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
8 && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
9 && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
10 && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
11 && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
12 && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
13 && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
14 && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
15 && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
16 && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
17 && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
18 && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
19 && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
20 && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
21 && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
22 && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
23 && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
24 && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
25 && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
26 && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
27 && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
28 /* The character set is not based on ISO-646. */
29 #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
30 #endif
31
32 #line 17 "./iconv_open-zos.gperf"
33 struct mapping { int standard_name; const char vendor_name[10 + 1]; };
34
35 #define TOTAL_KEYWORDS 49
36 #define MIN_WORD_LENGTH 3
37 #define MAX_WORD_LENGTH 11
38 #define MIN_HASH_VALUE 3
39 #define MAX_HASH_VALUE 64
40 /* maximum key range = 62, duplicates = 0 */
41
42 #ifdef __GNUC__
43 __inline
44 #else
45 #ifdef __cplusplus
46 inline
47 #endif
48 #endif
49 static unsigned int
50 mapping_hash (register const char *str, register size_t len)
51 {
52 static const unsigned char asso_values[] =
53 {
54 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
55 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
56 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
57 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
58 65, 65, 65, 65, 65, 65, 65, 65, 16, 38,
59 14, 1, 32, 22, 29, 3, 0, 7, 40, 2,
60 5, 18, 23, 65, 65, 65, 65, 65, 65, 65,
61 65, 65, 65, 0, 65, 0, 65, 65, 65, 0,
62 43, 65, 1, 65, 65, 8, 65, 65, 65, 65,
63 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
64 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
66 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
67 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
68 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
69 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
70 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
71 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
72 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
73 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
74 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
75 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
76 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
77 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
78 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
79 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
80 65, 65
81 };
82 register unsigned int hval = len;
83
84 switch (hval)
85 {
86 default:
87 hval += asso_values[(unsigned char)str[3]+6];
88 #if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
89 [[fallthrough]];
90 #elif defined __GNUC__ && __GNUC__ >= 7
91 __attribute__ ((__fallthrough__));
92 #endif
93 /*FALLTHROUGH*/
94 case 3:
95 break;
96 }
97 return hval + asso_values[(unsigned char)str[len - 1]];
98 }
99
100 struct stringpool_t
101 {
102 char stringpool_str3[sizeof("GBK")];
103 char stringpool_str5[sizeof("ASCII")];
104 char stringpool_str7[sizeof("CP1253")];
105 char stringpool_str8[sizeof("EUC-KR")];
106 char stringpool_str9[sizeof("CP1257")];
107 char stringpool_str10[sizeof("CP857")];
108 char stringpool_str11[sizeof("ISO-8859-8")];
109 char stringpool_str12[sizeof("ISO-8859-3")];
110 char stringpool_str13[sizeof("ISO-8859-13")];
111 char stringpool_str14[sizeof("ISO-8859-7")];
112 char stringpool_str15[sizeof("CP437")];
113 char stringpool_str16[sizeof("CP1129")];
114 char stringpool_str17[sizeof("CP869")];
115 char stringpool_str18[sizeof("ISO-8859-9")];
116 char stringpool_str19[sizeof("CP922")];
117 char stringpool_str20[sizeof("CP1252")];
118 char stringpool_str21[sizeof("CP852")];
119 char stringpool_str22[sizeof("CP1250")];
120 char stringpool_str23[sizeof("CP850")];
121 char stringpool_str24[sizeof("CP862")];
122 char stringpool_str25[sizeof("ISO-8859-2")];
123 char stringpool_str26[sizeof("CP932")];
124 char stringpool_str27[sizeof("GB2312")];
125 char stringpool_str28[sizeof("CP1255")];
126 char stringpool_str29[sizeof("CP855")];
127 char stringpool_str30[sizeof("KOI8-R")];
128 char stringpool_str31[sizeof("CP1125")];
129 char stringpool_str32[sizeof("CP865")];
130 char stringpool_str33[sizeof("ISO-8859-5")];
131 char stringpool_str34[sizeof("ISO-8859-15")];
132 char stringpool_str35[sizeof("CP1256")];
133 char stringpool_str36[sizeof("CP856")];
134 char stringpool_str37[sizeof("KOI8-U")];
135 char stringpool_str38[sizeof("CP1254")];
136 char stringpool_str39[sizeof("CP866")];
137 char stringpool_str40[sizeof("ISO-8859-6")];
138 char stringpool_str41[sizeof("CP1124")];
139 char stringpool_str42[sizeof("CP864")];
140 char stringpool_str43[sizeof("ISO-8859-4")];
141 char stringpool_str44[sizeof("CP1251")];
142 char stringpool_str45[sizeof("CP775")];
143 char stringpool_str46[sizeof("CP943")];
144 char stringpool_str47[sizeof("CP1131")];
145 char stringpool_str48[sizeof("CP861")];
146 char stringpool_str49[sizeof("ISO-8859-1")];
147 char stringpool_str50[sizeof("EUC-JP")];
148 char stringpool_str52[sizeof("CP949")];
149 char stringpool_str55[sizeof("CP874")];
150 char stringpool_str64[sizeof("CP1046")];
151 };
152 static const struct stringpool_t stringpool_contents =
153 {
154 "GBK",
155 "ASCII",
156 "CP1253",
157 "EUC-KR",
158 "CP1257",
159 "CP857",
160 "ISO-8859-8",
161 "ISO-8859-3",
162 "ISO-8859-13",
163 "ISO-8859-7",
164 "CP437",
165 "CP1129",
166 "CP869",
167 "ISO-8859-9",
168 "CP922",
169 "CP1252",
170 "CP852",
171 "CP1250",
172 "CP850",
173 "CP862",
174 "ISO-8859-2",
175 "CP932",
176 "GB2312",
177 "CP1255",
178 "CP855",
179 "KOI8-R",
180 "CP1125",
181 "CP865",
182 "ISO-8859-5",
183 "ISO-8859-15",
184 "CP1256",
185 "CP856",
186 "KOI8-U",
187 "CP1254",
188 "CP866",
189 "ISO-8859-6",
190 "CP1124",
191 "CP864",
192 "ISO-8859-4",
193 "CP1251",
194 "CP775",
195 "CP943",
196 "CP1131",
197 "CP861",
198 "ISO-8859-1",
199 "EUC-JP",
200 "CP949",
201 "CP874",
202 "CP1046"
203 };
204 #define stringpool ((const char *) &stringpool_contents)
205
206 static const struct mapping mappings[] =
207 {
208 {-1}, {-1}, {-1},
209 #line 76 "./iconv_open-zos.gperf"
210 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str3, "IBM-1386"},
211 {-1},
212 #line 28 "./iconv_open-zos.gperf"
213 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str5, "00367"},
214 {-1},
215 #line 68 "./iconv_open-zos.gperf"
216 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "IBM-5349"},
217 #line 75 "./iconv_open-zos.gperf"
218 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "IBM-eucKR"},
219 #line 72 "./iconv_open-zos.gperf"
220 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "09449"},
221 #line 48 "./iconv_open-zos.gperf"
222 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "00857"},
223 #line 36 "./iconv_open-zos.gperf"
224 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "05012"},
225 #line 31 "./iconv_open-zos.gperf"
226 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "00913"},
227 #line 38 "./iconv_open-zos.gperf"
228 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-13"},
229 #line 35 "./iconv_open-zos.gperf"
230 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"},
231 #line 42 "./iconv_open-zos.gperf"
232 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "IBM-437"},
233 #line 63 "./iconv_open-zos.gperf"
234 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "01129"},
235 #line 54 "./iconv_open-zos.gperf"
236 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "IBM-869"},
237 #line 37 "./iconv_open-zos.gperf"
238 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-9"},
239 #line 56 "./iconv_open-zos.gperf"
240 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "IBM-922"},
241 #line 67 "./iconv_open-zos.gperf"
242 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "IBM-5348"},
243 #line 45 "./iconv_open-zos.gperf"
244 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "IBM-852"},
245 #line 65 "./iconv_open-zos.gperf"
246 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "IBM-5346"},
247 #line 44 "./iconv_open-zos.gperf"
248 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "09042"},
249 #line 50 "./iconv_open-zos.gperf"
250 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str24, "IBM-862"},
251 #line 30 "./iconv_open-zos.gperf"
252 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-2"},
253 #line 57 "./iconv_open-zos.gperf"
254 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "IBM-943"},
255 #line 73 "./iconv_open-zos.gperf"
256 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "IBM-eucCN"},
257 #line 70 "./iconv_open-zos.gperf"
258 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str28, "09447"},
259 #line 46 "./iconv_open-zos.gperf"
260 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "13143"},
261 #line 40 "./iconv_open-zos.gperf"
262 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "00878"},
263 #line 62 "./iconv_open-zos.gperf"
264 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "IBM-1125"},
265 #line 52 "./iconv_open-zos.gperf"
266 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str32, "00865"},
267 #line 33 "./iconv_open-zos.gperf"
268 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "ISO8859-5"},
269 #line 39 "./iconv_open-zos.gperf"
270 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-15"},
271 #line 71 "./iconv_open-zos.gperf"
272 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "09448"},
273 #line 47 "./iconv_open-zos.gperf"
274 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str36, "IBM-856"},
275 #line 41 "./iconv_open-zos.gperf"
276 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str37, "01168"},
277 #line 69 "./iconv_open-zos.gperf"
278 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "IBM-5350"},
279 #line 53 "./iconv_open-zos.gperf"
280 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str39, "04962"},
281 #line 34 "./iconv_open-zos.gperf"
282 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "ISO8859-6"},
283 #line 61 "./iconv_open-zos.gperf"
284 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"},
285 #line 51 "./iconv_open-zos.gperf"
286 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str42, "IBM-864"},
287 #line 32 "./iconv_open-zos.gperf"
288 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"},
289 #line 66 "./iconv_open-zos.gperf"
290 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str44, "IBM-5347"},
291 #line 43 "./iconv_open-zos.gperf"
292 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str45, "00775"},
293 #line 58 "./iconv_open-zos.gperf"
294 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str46, "IBM-943"},
295 #line 64 "./iconv_open-zos.gperf"
296 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str47, "01131"},
297 #line 49 "./iconv_open-zos.gperf"
298 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str48, "IBM-861"},
299 #line 29 "./iconv_open-zos.gperf"
300 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str49, "ISO8859-1"},
301 #line 74 "./iconv_open-zos.gperf"
302 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str50, "01350"},
303 {-1},
304 #line 59 "./iconv_open-zos.gperf"
305 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str52, "IBM-1363"},
306 {-1}, {-1},
307 #line 55 "./iconv_open-zos.gperf"
308 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str55, "TIS-620"},
309 {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
310 #line 60 "./iconv_open-zos.gperf"
311 {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str64, "IBM-1046"}
312 };
313
314 const struct mapping *
315 mapping_lookup (register const char *str, register size_t len)
316 {
317 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
318 {
319 register unsigned int key = mapping_hash (str, len);
320
321 if (key <= MAX_HASH_VALUE)
322 {
323 register int o = mappings[key].standard_name;
324 if (o >= 0)
325 {
326 register const char *s = o + stringpool;
327
328 if (*str == *s && !strcmp (str + 1, s + 1))
329 return &mappings[key];
330 }
331 }
332 }
333 return 0;
334 }