1 /* ANSI-C code produced by gperf version 3.1 */
2 /* Command-line: gperf -pt -T -L ANSI-C -N onigenc_euc_jp_lookup_property_name --output-file gperf1.tmp euc_jp_prop.gperf */
3 /* Computed positions: -k'1,3' */
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 1 "euc_jp_prop.gperf"
33
34 #include "regint.h"
35
36 #define TOTAL_KEYWORDS 16
37 #define MIN_WORD_LENGTH 4
38 #define MAX_WORD_LENGTH 8
39 #define MIN_HASH_VALUE 4
40 #define MAX_HASH_VALUE 55
41 /* maximum key range = 52, duplicates = 0 */
42
43 #ifdef __GNUC__
44 __inline
45 #else
46 #ifdef __cplusplus
47 inline
48 #endif
49 #endif
50 static unsigned int
hash(register const char * str,register size_t len)51 hash (register const char *str, register size_t len)
52 {
53 static unsigned char asso_values[] =
54 {
55 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
57 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
58 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
59 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
60 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
61 56, 56, 56, 56, 56, 0, 3, 10, 25, 56,
62 56, 30, 0, 56, 56, 0, 20, 56, 56, 56,
63 15, 56, 56, 20, 56, 30, 56, 0, 0, 56,
64 56, 56, 56, 56, 56, 56, 56, 15, 56, 56,
65 56, 56, 56, 25, 56, 10, 56, 56, 56, 56,
66 5, 56, 0, 56, 0, 56, 5, 56, 56, 20,
67 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
68 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
69 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
70 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
71 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
72 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
73 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
74 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
75 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
76 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
77 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
78 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
79 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
80 56, 56, 56, 56, 56, 56
81 };
82 return (unsigned int )len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
83 }
84
85 struct PropertyNameCtype *
onigenc_euc_jp_lookup_property_name(register const char * str,register size_t len)86 onigenc_euc_jp_lookup_property_name (register const char *str, register size_t len)
87 {
88 static struct PropertyNameCtype wordlist[] =
89 {
90 {""}, {""}, {""}, {""},
91 #line 22 "euc_jp_prop.gperf"
92 {"Word", 12},
93 #line 11 "euc_jp_prop.gperf"
94 {"Alpha", 1},
95 {""}, {""},
96 #line 25 "euc_jp_prop.gperf"
97 {"Hiragana", 15},
98 {""},
99 #line 23 "euc_jp_prop.gperf"
100 {"Alnum", 13},
101 {""}, {""},
102 #line 26 "euc_jp_prop.gperf"
103 {"Katakana", 16},
104 {""},
105 #line 24 "euc_jp_prop.gperf"
106 {"ASCII", 14},
107 #line 21 "euc_jp_prop.gperf"
108 {"XDigit", 11},
109 {""}, {""}, {""},
110 #line 13 "euc_jp_prop.gperf"
111 {"Cntrl", 3},
112 {""}, {""},
113 #line 12 "euc_jp_prop.gperf"
114 {"Blank", 2},
115 {""},
116 #line 18 "euc_jp_prop.gperf"
117 {"Punct", 8},
118 {""}, {""}, {""}, {""},
119 #line 17 "euc_jp_prop.gperf"
120 {"Print", 7},
121 {""}, {""}, {""}, {""},
122 #line 20 "euc_jp_prop.gperf"
123 {"Upper", 10},
124 {""}, {""}, {""}, {""},
125 #line 19 "euc_jp_prop.gperf"
126 {"Space", 9},
127 {""}, {""}, {""}, {""},
128 #line 16 "euc_jp_prop.gperf"
129 {"Lower", 6},
130 {""}, {""}, {""}, {""},
131 #line 15 "euc_jp_prop.gperf"
132 {"Graph", 5},
133 {""}, {""}, {""}, {""},
134 #line 14 "euc_jp_prop.gperf"
135 {"Digit", 4}
136 };
137
138 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
139 {
140 register unsigned int key = hash (str, len);
141
142 if (key <= MAX_HASH_VALUE)
143 {
144 register const char *s = wordlist[key].name;
145
146 if (*str == *s && !strcmp (str + 1, s + 1))
147 return &wordlist[key];
148 }
149 }
150 return 0;
151 }
152