Commit | Line | Data |
---|---|---|
d02f3137 LC |
1 | /* ANSI-C code produced by gperf version 3.0.4 */ |
2 | /* Command-line: gperf -m 10 ./iconv_open-solaris.gperf */ | |
3 | /* Computed positions: -k'10' */ | |
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-gnu-gperf@gnu.org>." | |
30 | #endif | |
31 | ||
32 | #line 1 "./iconv_open-solaris.gperf" | |
33 | struct mapping { int standard_name; const char vendor_name[10 + 1]; }; | |
34 | ||
35 | #define TOTAL_KEYWORDS 13 | |
36 | #define MIN_WORD_LENGTH 5 | |
37 | #define MAX_WORD_LENGTH 11 | |
38 | #define MIN_HASH_VALUE 5 | |
39 | #define MAX_HASH_VALUE 19 | |
40 | /* maximum key range = 15, 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 unsigned int len) | |
51 | { | |
52 | static const unsigned char asso_values[] = | |
53 | { | |
54 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
55 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
56 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
57 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
58 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, | |
59 | 9, 8, 7, 6, 5, 4, 3, 2, 20, 20, | |
60 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
61 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
62 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
63 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
64 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
65 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
66 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
67 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
68 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
69 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
70 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
71 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
72 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
73 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
74 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
75 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
76 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
77 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
78 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |
79 | 20, 20, 20, 20, 20, 20 | |
80 | }; | |
81 | register int hval = len; | |
82 | ||
83 | switch (hval) | |
84 | { | |
85 | default: | |
86 | hval += asso_values[(unsigned char)str[9]]; | |
87 | /*FALLTHROUGH*/ | |
88 | case 9: | |
89 | case 8: | |
90 | case 7: | |
91 | case 6: | |
92 | case 5: | |
93 | break; | |
94 | } | |
95 | return hval; | |
96 | } | |
97 | ||
98 | struct stringpool_t | |
99 | { | |
100 | char stringpool_str5[sizeof("ASCII")]; | |
101 | char stringpool_str6[sizeof("CP1251")]; | |
102 | char stringpool_str7[sizeof("$ abc")]; | |
103 | char stringpool_str10[sizeof("ISO-8859-1")]; | |
104 | char stringpool_str11[sizeof("ISO-8859-15")]; | |
105 | char stringpool_str12[sizeof("ISO-8859-9")]; | |
106 | char stringpool_str13[sizeof("ISO-8859-8")]; | |
107 | char stringpool_str14[sizeof("ISO-8859-7")]; | |
108 | char stringpool_str15[sizeof("ISO-8859-6")]; | |
109 | char stringpool_str16[sizeof("ISO-8859-5")]; | |
110 | char stringpool_str17[sizeof("ISO-8859-4")]; | |
111 | char stringpool_str18[sizeof("ISO-8859-3")]; | |
112 | char stringpool_str19[sizeof("ISO-8859-2")]; | |
113 | }; | |
114 | static const struct stringpool_t stringpool_contents = | |
115 | { | |
116 | "ASCII", | |
117 | "CP1251", | |
118 | "$ abc", | |
119 | "ISO-8859-1", | |
120 | "ISO-8859-15", | |
121 | "ISO-8859-9", | |
122 | "ISO-8859-8", | |
123 | "ISO-8859-7", | |
124 | "ISO-8859-6", | |
125 | "ISO-8859-5", | |
126 | "ISO-8859-4", | |
127 | "ISO-8859-3", | |
128 | "ISO-8859-2" | |
129 | }; | |
130 | #define stringpool ((const char *) &stringpool_contents) | |
131 | ||
132 | static const struct mapping mappings[] = | |
133 | { | |
134 | {-1}, {-1}, {-1}, {-1}, {-1}, | |
135 | #line 19 "./iconv_open-solaris.gperf" | |
136 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "646"}, | |
137 | #line 30 "./iconv_open-solaris.gperf" | |
138 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "ansi-1251"}, | |
139 | #line 18 "./iconv_open-solaris.gperf" | |
140 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str7}, | |
141 | {-1}, {-1}, | |
142 | #line 20 "./iconv_open-solaris.gperf" | |
143 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-1"}, | |
144 | #line 29 "./iconv_open-solaris.gperf" | |
145 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"}, | |
146 | #line 28 "./iconv_open-solaris.gperf" | |
147 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-9"}, | |
148 | #line 27 "./iconv_open-solaris.gperf" | |
149 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-8"}, | |
150 | #line 26 "./iconv_open-solaris.gperf" | |
151 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"}, | |
152 | #line 25 "./iconv_open-solaris.gperf" | |
153 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-6"}, | |
154 | #line 24 "./iconv_open-solaris.gperf" | |
155 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "ISO8859-5"}, | |
156 | #line 23 "./iconv_open-solaris.gperf" | |
157 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-4"}, | |
158 | #line 22 "./iconv_open-solaris.gperf" | |
159 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-3"}, | |
160 | #line 21 "./iconv_open-solaris.gperf" | |
161 | {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-2"} | |
162 | }; | |
163 | ||
164 | #ifdef __GNUC__ | |
165 | __inline | |
166 | #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ | |
167 | __attribute__ ((__gnu_inline__)) | |
168 | #endif | |
169 | #endif | |
170 | const struct mapping * | |
171 | mapping_lookup (register const char *str, register unsigned int len) | |
172 | { | |
173 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) | |
174 | { | |
175 | register int key = mapping_hash (str, len); | |
176 | ||
177 | if (key <= MAX_HASH_VALUE && key >= 0) | |
178 | { | |
179 | register int o = mappings[key].standard_name; | |
180 | if (o >= 0) | |
181 | { | |
182 | register const char *s = o + stringpool; | |
183 | ||
184 | if (*str == *s && !strcmp (str + 1, s + 1)) | |
185 | return &mappings[key]; | |
186 | } | |
187 | } | |
188 | } | |
189 | return 0; | |
190 | } |