1 /* This file was converted by gperf_fold_key_conv.py
2 from gperf output file. */
3 /* ANSI-C code produced by gperf version 3.0.4 */
4 /* Command-line: gperf -n -C -T -c -t -j1 -L ANSI-C -F,-1 -N unicode_fold2_key unicode_fold2_key.gperf */
5 /* Computed positions: -k'3,6' */
6
7
8
9 /* This gperf source file was generated by make_unicode_fold_data.py */
10 #include <string.h>
11 #include "regenc.h"
12
13 #define TOTAL_KEYWORDS 59
14 #define MIN_WORD_LENGTH 6
15 #define MAX_WORD_LENGTH 6
16 #define MIN_HASH_VALUE 0
17 #define MAX_HASH_VALUE 58
18 /* maximum key range = 59, duplicates = 0 */
19
20 #ifdef __GNUC__
21 __inline
22 #else
23 #ifdef __cplusplus
24 inline
25 #endif
26 #endif
27 /*ARGSUSED*/
28 static unsigned int
hash(OnigCodePoint codes[])29 hash(OnigCodePoint codes[])
30 {
31 static const unsigned char asso_values[] =
32 {
33 58, 57, 56, 55, 54, 53, 52, 16, 50, 59,
34 15, 59, 25, 59, 59, 59, 59, 59, 59, 3,
35 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
36 59, 59, 49, 48, 47, 46, 45, 44, 43, 42,
37 59, 59, 59, 59, 59, 59, 59, 59, 59, 21,
38 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
39 59, 59, 59, 59, 59, 59, 2, 59, 59, 59,
40 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
41 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
42 59, 59, 59, 59, 59, 59, 40, 20, 39, 38,
43 37, 14, 5, 36, 20, 7, 25, 34, 29, 32,
44 16, 59, 31, 59, 59, 2, 1, 59, 25, 15,
45 59, 14, 59, 59, 28, 59, 2, 59, 59, 59,
46 11, 59, 59, 59, 59, 59, 59, 59, 59, 59,
47 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
48 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
49 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
50 59, 59, 24, 59, 22, 59, 59, 11, 59, 59,
51 59, 59, 59, 7, 59, 0, 59, 59, 16, 59,
52 1, 59, 59, 16, 59, 59, 59, 15, 59, 59,
53 59, 6, 59, 59, 59, 59, 0, 59, 59, 59,
54 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
55 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
56 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
57 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
58 59, 59, 59, 59, 59, 59
59 };
60 return asso_values[(unsigned char)onig_codes_byte_at(codes, 5)] + asso_values[(unsigned char)onig_codes_byte_at(codes, 2)];
61 }
62
63 #ifdef __GNUC__
64 __inline
65 #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
66 __attribute__ ((__gnu_inline__))
67 #endif
68 #endif
69 int
unicode_fold2_key(OnigCodePoint codes[])70 unicode_fold2_key(OnigCodePoint codes[])
71 {
72 static const int wordlist[] =
73 {
74
75 101,
76
77 253,
78
79 76,
80
81 29,
82
83 24,
84
85 239,
86
87 96,
88
89 71,
90
91 92,
92
93 67,
94
95 4,
96
97 62,
98
99 8,
100
101 58,
102
103 234,
104
105 109,
106
107 164,
108
109 88,
110
111 84,
112
113 80,
114
115 214,
116
117 0,
118
119 54,
120
121 261,
122
123 50,
124
125 105,
126
127 121,
128
129 125,
130
131 257,
132
133 42,
134
135 38,
136
137 249,
138
139 46,
140
141 117,
142
143 12,
144
145 113,
146
147 244,
148
149 229,
150
151 224,
152
153 219,
154
155 209,
156
157 16,
158
159 204,
160
161 199,
162
163 194,
164
165 189,
166
167 184,
168
169 179,
170
171 174,
172
173 169,
174
175 20,
176
177 34,
178
179 159,
180
181 154,
182
183 149,
184
185 144,
186
187 139,
188
189 134,
190
191 129
192 };
193
194 if (0 == 0)
195 {
196 int key = hash(codes);
197
198 if (key <= MAX_HASH_VALUE && key >= 0)
199 {
200 int index = wordlist[key];
201
202 if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds2 + index, 2) == 0)
203 return index;
204 }
205 }
206 return -1;
207 }
208
209
210