| 1 | /* ANSI-C code produced by gperf version 3.1 */ | 
|---|
| 2 | /* Command-line: gperf -acCgopt -k'1,2,5,9,$' -L ANSI-C -N charmap_hash charmap-kw.gperf  */ | 
|---|
| 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 <bug-gperf@gnu.org>." | 
|---|
| 29 | #endif | 
|---|
| 30 |  | 
|---|
| 31 | #line 1 "charmap-kw.gperf" | 
|---|
| 32 |  | 
|---|
| 33 | /* Copyright (C) 1995-2020 Free Software Foundation, Inc. | 
|---|
| 34 | This file is part of the GNU C Library. | 
|---|
| 35 | Contributed by Ulrich Drepper, <drepper@gnu.org>. | 
|---|
| 36 |  | 
|---|
| 37 | This program is free software; you can redistribute it and/or modify | 
|---|
| 38 | it under the terms of the GNU General Public License as published | 
|---|
| 39 | by the Free Software Foundation; version 2 of the License, or | 
|---|
| 40 | (at your option) any later version. | 
|---|
| 41 |  | 
|---|
| 42 | This program is distributed in the hope that it will be useful, | 
|---|
| 43 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 44 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 45 | GNU General Public License for more details. | 
|---|
| 46 |  | 
|---|
| 47 | You should have received a copy of the GNU General Public License | 
|---|
| 48 | along with this program; if not, see | 
|---|
| 49 | <https://www.gnu.org/licenses/>.  */ | 
|---|
| 50 |  | 
|---|
| 51 | #include <string.h> | 
|---|
| 52 |  | 
|---|
| 53 | #include "locfile-token.h" | 
|---|
| 54 | #line 24 "charmap-kw.gperf" | 
|---|
| 55 | struct keyword_t ; | 
|---|
| 56 |  | 
|---|
| 57 | #define TOTAL_KEYWORDS 17 | 
|---|
| 58 | #define MIN_WORD_LENGTH 3 | 
|---|
| 59 | #define MAX_WORD_LENGTH 14 | 
|---|
| 60 | #define MIN_HASH_VALUE 3 | 
|---|
| 61 | #define MAX_HASH_VALUE 35 | 
|---|
| 62 | /* maximum key range = 33, duplicates = 0 */ | 
|---|
| 63 |  | 
|---|
| 64 | #ifdef __GNUC__ | 
|---|
| 65 | __inline | 
|---|
| 66 | #else | 
|---|
| 67 | #ifdef __cplusplus | 
|---|
| 68 | inline | 
|---|
| 69 | #endif | 
|---|
| 70 | #endif | 
|---|
| 71 | static unsigned int | 
|---|
| 72 | hash (register const char *str, register size_t len) | 
|---|
| 73 | { | 
|---|
| 74 | static const unsigned char asso_values[] = | 
|---|
| 75 | { | 
|---|
| 76 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 77 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 78 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 79 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 80 | 36, 36, 36, 36, 36, 36, 36, 36, 25, 20, | 
|---|
| 81 | 15, 10, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 82 | 36, 36, 36, 36, 36, 36, 36,  5,  0,  0, | 
|---|
| 83 | 5, 36,  0,  0, 36, 36, 36,  5,  0, 36, | 
|---|
| 84 | 0, 36,  0, 36,  0, 36, 36,  0, 36, 36, | 
|---|
| 85 | 36, 36, 36, 36, 36,  0, 36,  5,  0,  0, | 
|---|
| 86 | 5,  0, 36,  5,  0,  0, 36, 36, 36,  0, | 
|---|
| 87 | 0,  0,  0,  0,  0,  0,  0,  0, 36, 36, | 
|---|
| 88 | 0, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 89 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 90 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 91 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 92 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 93 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 94 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 95 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 96 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 97 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 98 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 99 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 100 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 
|---|
| 101 | 36, 36, 36, 36, 36, 36 | 
|---|
| 102 | }; | 
|---|
| 103 | register unsigned int hval = len; | 
|---|
| 104 |  | 
|---|
| 105 | switch (hval) | 
|---|
| 106 | { | 
|---|
| 107 | default: | 
|---|
| 108 | hval += asso_values[(unsigned char)str[8]]; | 
|---|
| 109 | /*FALLTHROUGH*/ | 
|---|
| 110 | case 8: | 
|---|
| 111 | case 7: | 
|---|
| 112 | case 6: | 
|---|
| 113 | case 5: | 
|---|
| 114 | hval += asso_values[(unsigned char)str[4]]; | 
|---|
| 115 | /*FALLTHROUGH*/ | 
|---|
| 116 | case 4: | 
|---|
| 117 | case 3: | 
|---|
| 118 | case 2: | 
|---|
| 119 | hval += asso_values[(unsigned char)str[1]]; | 
|---|
| 120 | /*FALLTHROUGH*/ | 
|---|
| 121 | case 1: | 
|---|
| 122 | hval += asso_values[(unsigned char)str[0]]; | 
|---|
| 123 | break; | 
|---|
| 124 | } | 
|---|
| 125 | return hval + asso_values[(unsigned char)str[len - 1]]; | 
|---|
| 126 | } | 
|---|
| 127 |  | 
|---|
| 128 | const struct keyword_t * | 
|---|
| 129 | charmap_hash (register const char *str, register size_t len) | 
|---|
| 130 | { | 
|---|
| 131 | static const struct keyword_t wordlist[] = | 
|---|
| 132 | { | 
|---|
| 133 | { ""}, { ""}, { ""}, | 
|---|
| 134 | #line 39 "charmap-kw.gperf" | 
|---|
| 135 | { "END",             tok_end,             0}, | 
|---|
| 136 | { ""}, | 
|---|
| 137 | #line 40 "charmap-kw.gperf" | 
|---|
| 138 | { "WIDTH",           tok_width,           0}, | 
|---|
| 139 | #line 35 "charmap-kw.gperf" | 
|---|
| 140 | { "escseq",          tok_escseq,          1}, | 
|---|
| 141 | #line 37 "charmap-kw.gperf" | 
|---|
| 142 | { "include",         tok_include,         1}, | 
|---|
| 143 | { ""}, { ""}, | 
|---|
| 144 | #line 28 "charmap-kw.gperf" | 
|---|
| 145 | { "mb_cur_min",      tok_mb_cur_min,      1}, | 
|---|
| 146 | #line 29 "charmap-kw.gperf" | 
|---|
| 147 | { "escape_char",     tok_escape_char,     1}, | 
|---|
| 148 | #line 30 "charmap-kw.gperf" | 
|---|
| 149 | { "comment_char",    tok_comment_char,    1}, | 
|---|
| 150 | #line 26 "charmap-kw.gperf" | 
|---|
| 151 | { "code_set_name",   tok_code_set_name,   1}, | 
|---|
| 152 | #line 41 "charmap-kw.gperf" | 
|---|
| 153 | { "WIDTH_VARIABLE",  tok_width_variable,  0}, | 
|---|
| 154 | #line 27 "charmap-kw.gperf" | 
|---|
| 155 | { "mb_cur_max",      tok_mb_cur_max,      1}, | 
|---|
| 156 | #line 36 "charmap-kw.gperf" | 
|---|
| 157 | { "addset",          tok_addset,          1}, | 
|---|
| 158 | #line 38 "charmap-kw.gperf" | 
|---|
| 159 | { "CHARMAP",         tok_charmap,         0}, | 
|---|
| 160 | #line 42 "charmap-kw.gperf" | 
|---|
| 161 | { "WIDTH_DEFAULT",   tok_width_default,   0}, | 
|---|
| 162 | { ""}, | 
|---|
| 163 | #line 34 "charmap-kw.gperf" | 
|---|
| 164 | { "g3esc",           tok_g3esc,           1}, | 
|---|
| 165 | { ""}, { ""}, { ""}, { ""}, | 
|---|
| 166 | #line 33 "charmap-kw.gperf" | 
|---|
| 167 | { "g2esc",           tok_g2esc,           1}, | 
|---|
| 168 | { ""}, { ""}, { ""}, { ""}, | 
|---|
| 169 | #line 32 "charmap-kw.gperf" | 
|---|
| 170 | { "g1esc",           tok_g1esc,           1}, | 
|---|
| 171 | { ""}, { ""}, { ""}, { ""}, | 
|---|
| 172 | #line 31 "charmap-kw.gperf" | 
|---|
| 173 | { "g0esc",           tok_g0esc,           1} | 
|---|
| 174 | }; | 
|---|
| 175 |  | 
|---|
| 176 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) | 
|---|
| 177 | { | 
|---|
| 178 | register unsigned int key = hash (str, len); | 
|---|
| 179 |  | 
|---|
| 180 | if (key <= MAX_HASH_VALUE) | 
|---|
| 181 | { | 
|---|
| 182 | register const char *s = wordlist[key].name; | 
|---|
| 183 |  | 
|---|
| 184 | if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') | 
|---|
| 185 | return &wordlist[key]; | 
|---|
| 186 | } | 
|---|
| 187 | } | 
|---|
| 188 | return 0; | 
|---|
| 189 | } | 
|---|
| 190 |  | 
|---|