| 1 | /* C code produced by gperf version 3.0.4 */ |
| 2 | /* Command-line: gperf -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property enc/jis/props.kwd */ |
| 3 | |
| 4 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ |
| 5 | && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ |
| 6 | && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ |
| 7 | && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ |
| 8 | && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ |
| 9 | && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ |
| 10 | && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ |
| 11 | && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ |
| 12 | && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ |
| 13 | && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ |
| 14 | && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ |
| 15 | && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ |
| 16 | && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ |
| 17 | && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ |
| 18 | && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ |
| 19 | && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ |
| 20 | && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ |
| 21 | && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ |
| 22 | && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ |
| 23 | && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ |
| 24 | && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ |
| 25 | && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ |
| 26 | && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) |
| 27 | /* The character set is not based on ISO-646. */ |
| 28 | error "gperf generated tables don't work with this execution character set. Please report a bug to <[email protected]>." |
| 29 | #endif |
| 30 | |
| 31 | #line 1 "enc/jis/props.kwd" |
| 32 | /* -*- c -*- */ |
| 33 | #define GPERF_DOWNCASE 1 |
| 34 | #define GPERF_CASE_STRNCMP 1 |
| 35 | |
| 36 | static inline int |
| 37 | gperf_case_strncmp(const char *s1, const char *s2, unsigned int n) |
| 38 | { |
| 39 | const UChar *str = (const UChar *)s1; |
| 40 | const UChar *s = (const UChar *)s2; |
| 41 | return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, n); |
| 42 | } |
| 43 | |
| 44 | enum onigenc_jis_ctype { |
| 45 | onigenc_jis_min = ONIGENC_MAX_STD_CTYPE, |
| 46 | onigenc_jis_hiragana, |
| 47 | onigenc_jis_katakana, |
| 48 | onigenc_jis_han, |
| 49 | onigenc_jis_latin, |
| 50 | onigenc_jis_greek, |
| 51 | onigenc_jis_cyrillic, |
| 52 | onigenc_jis_max |
| 53 | }; |
| 54 | |
| 55 | enum {PropertyListNum = onigenc_jis_max - onigenc_jis_min - 1}; |
| 56 | |
| 57 | static const OnigCodePoint* const PropertyList[PropertyListNum] = { |
| 58 | CR_Hiragana, |
| 59 | CR_Katakana, |
| 60 | CR_Han, |
| 61 | CR_Latin, |
| 62 | CR_Greek, |
| 63 | CR_Cyrillic, |
| 64 | }; |
| 65 | |
| 66 | struct enc_property { |
| 67 | signed char name; |
| 68 | unsigned char ctype; |
| 69 | }; |
| 70 | |
| 71 | static const struct enc_property *onig_jis_property(const char *str, unsigned int len); |
| 72 | #line 43 "enc/jis/props.kwd" |
| 73 | struct enc_property; |
| 74 | |
| 75 | #define TOTAL_KEYWORDS 6 |
| 76 | #define MIN_WORD_LENGTH 3 |
| 77 | #define MAX_WORD_LENGTH 8 |
| 78 | #define MIN_HASH_VALUE 5 |
| 79 | #define MAX_HASH_VALUE 12 |
| 80 | /* maximum key range = 8, duplicates = 0 */ |
| 81 | |
| 82 | #ifndef GPERF_DOWNCASE |
| 83 | #define GPERF_DOWNCASE 1 |
| 84 | static unsigned char gperf_downcase[256] = |
| 85 | { |
| 86 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
| 87 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, |
| 88 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
| 89 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, |
| 90 | 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, |
| 91 | 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, |
| 92 | 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, |
| 93 | 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, |
| 94 | 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, |
| 95 | 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, |
| 96 | 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, |
| 97 | 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, |
| 98 | 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, |
| 99 | 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, |
| 100 | 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, |
| 101 | 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, |
| 102 | 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, |
| 103 | 255 |
| 104 | }; |
| 105 | #endif |
| 106 | |
| 107 | #ifndef GPERF_CASE_STRNCMP |
| 108 | #define GPERF_CASE_STRNCMP 1 |
| 109 | static int |
| 110 | gperf_case_strncmp (s1, s2, n) |
| 111 | register const char *s1; |
| 112 | register const char *s2; |
| 113 | register unsigned int n; |
| 114 | { |
| 115 | for (; n > 0;) |
| 116 | { |
| 117 | unsigned char c1 = gperf_downcase[(unsigned char)*s1++]; |
| 118 | unsigned char c2 = gperf_downcase[(unsigned char)*s2++]; |
| 119 | if (c1 != 0 && c1 == c2) |
| 120 | { |
| 121 | n--; |
| 122 | continue; |
| 123 | } |
| 124 | return (int)c1 - (int)c2; |
| 125 | } |
| 126 | return 0; |
| 127 | } |
| 128 | #endif |
| 129 | |
| 130 | #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) || defined(__GNUC_STDC_INLINE__) |
| 131 | inline |
| 132 | #elif defined(__GNUC__) |
| 133 | __inline |
| 134 | #endif |
| 135 | static unsigned int |
| 136 | onig_jis_property_hash (str, len) |
| 137 | register const char *str; |
| 138 | register unsigned int len; |
| 139 | { |
| 140 | static const unsigned char asso_values[] = |
| 141 | { |
| 142 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 143 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 144 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 145 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 146 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 147 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 148 | 13, 13, 13, 13, 13, 13, 13, 3, 13, 2, |
| 149 | 13, 1, 1, 13, 13, 2, 1, 13, 1, 13, |
| 150 | 13, 13, 1, 13, 1, 13, 13, 13, 13, 13, |
| 151 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 3, |
| 152 | 13, 2, 13, 1, 1, 13, 13, 2, 1, 13, |
| 153 | 1, 13, 13, 13, 1, 13, 1, 13, 13, 13, |
| 154 | 13, 13, 13, 13, 13, 13, 13, 13 |
| 155 | }; |
| 156 | return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]]; |
| 157 | } |
| 158 | |
| 159 | struct onig_jis_property_pool_t |
| 160 | { |
| 161 | char onig_jis_property_pool_str5[sizeof("han")]; |
| 162 | char onig_jis_property_pool_str7[sizeof("latin")]; |
| 163 | char onig_jis_property_pool_str8[sizeof("greek")]; |
| 164 | char onig_jis_property_pool_str10[sizeof("hiragana")]; |
| 165 | char onig_jis_property_pool_str11[sizeof("katakana")]; |
| 166 | char onig_jis_property_pool_str12[sizeof("cyrillic")]; |
| 167 | }; |
| 168 | static const struct onig_jis_property_pool_t onig_jis_property_pool_contents = |
| 169 | { |
| 170 | "han", |
| 171 | "latin", |
| 172 | "greek", |
| 173 | "hiragana", |
| 174 | "katakana", |
| 175 | "cyrillic" |
| 176 | }; |
| 177 | #define onig_jis_property_pool ((const char *) &onig_jis_property_pool_contents) |
| 178 | #ifdef __GNUC__ |
| 179 | __inline |
| 180 | #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ |
| 181 | __attribute__ ((__gnu_inline__)) |
| 182 | #endif |
| 183 | #endif |
| 184 | const struct enc_property * |
| 185 | onig_jis_property (str, len) |
| 186 | register const char *str; |
| 187 | register unsigned int len; |
| 188 | { |
| 189 | static const struct enc_property wordlist[] = |
| 190 | { |
| 191 | {-1}, {-1}, {-1}, {-1}, {-1}, |
| 192 | #line 48 "enc/jis/props.kwd" |
| 193 | {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str5), onigenc_jis_han}, |
| 194 | {-1}, |
| 195 | #line 49 "enc/jis/props.kwd" |
| 196 | {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str7), onigenc_jis_latin}, |
| 197 | #line 50 "enc/jis/props.kwd" |
| 198 | {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str8), onigenc_jis_greek}, |
| 199 | {-1}, |
| 200 | #line 46 "enc/jis/props.kwd" |
| 201 | {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str10), onigenc_jis_hiragana}, |
| 202 | #line 47 "enc/jis/props.kwd" |
| 203 | {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str11), onigenc_jis_katakana}, |
| 204 | #line 51 "enc/jis/props.kwd" |
| 205 | {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str12), onigenc_jis_cyrillic} |
| 206 | }; |
| 207 | |
| 208 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
| 209 | { |
| 210 | register int key = onig_jis_property_hash (str, len); |
| 211 | |
| 212 | if (key <= MAX_HASH_VALUE && key >= 0) |
| 213 | { |
| 214 | register int o = wordlist[key].name; |
| 215 | if (o >= 0) |
| 216 | { |
| 217 | register const char *s = o + onig_jis_property_pool; |
| 218 | |
| 219 | if ((((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gperf_case_strncmp (str, s, len) && s[len] == '\0') |
| 220 | return &wordlist[key]; |
| 221 | } |
| 222 | } |
| 223 | } |
| 224 | return 0; |
| 225 | } |
| 226 | #line 52 "enc/jis/props.kwd" |
| 227 |