Branch data Line data Source code
1 : : /* C++ code produced by gperf version 3.0.4 */
2 : : /* Command-line: /bin/gperf -C -t -l -L C++ -m 20 -Z AfmKeywordHash -k '1,4,6,$' /usr/local/src/libreoffice/vcl/generic/fontmanager/afm_keyword_list */
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-gnu-gperf@gnu.org>."
29 : : #endif
30 : :
31 : : struct hash_entry { const char* name; enum parseKey eKey; };
32 : :
33 : : #define TOTAL_KEYWORDS 56
34 : : #define MIN_WORD_LENGTH 1
35 : : #define MAX_WORD_LENGTH 18
36 : : #define MIN_HASH_VALUE 1
37 : : #define MAX_HASH_VALUE 57
38 : : /* maximum key range = 57, duplicates = 0 */
39 : :
40 : : class AfmKeywordHash
41 : : {
42 : : private:
43 : : static inline unsigned int hash (const char *str, unsigned int len);
44 : : public:
45 : : static const struct hash_entry *in_word_set (const char *str, unsigned int len);
46 : : };
47 : :
48 : : inline unsigned int
49 : 12128819 : AfmKeywordHash::hash (register const char *str, register unsigned int len)
50 : : {
51 : : static const unsigned char asso_values[] =
52 : : {
53 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
54 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
55 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
56 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
57 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
58 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
59 : : 58, 58, 58, 58, 58, 28, 1, 0, 9, 0,
60 : : 19, 58, 2, 10, 58, 0, 28, 0, 20, 58,
61 : : 44, 58, 58, 0, 16, 10, 24, 2, 3, 58,
62 : : 58, 58, 58, 58, 58, 58, 58, 6, 58, 0,
63 : : 19, 0, 58, 25, 14, 6, 58, 58, 17, 11,
64 : : 0, 17, 39, 58, 0, 0, 10, 58, 58, 58,
65 : : 13, 4, 58, 58, 58, 58, 58, 58, 58, 58,
66 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
67 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
68 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
69 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
70 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
71 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
72 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
73 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
74 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
75 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
76 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
77 : : 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
78 : : 58, 58, 58, 58, 58, 58
79 : : };
80 : 12128819 : register int hval = len;
81 : :
82 [ + + + ]: 12128819 : switch (hval)
83 : : {
84 : : default:
85 : 113915 : hval += asso_values[(unsigned char)str[5]];
86 : : /*FALLTHROUGH*/
87 : : case 5:
88 : : case 4:
89 : 117759 : hval += asso_values[(unsigned char)str[3]];
90 : : /*FALLTHROUGH*/
91 : : case 3:
92 : : case 2:
93 : : case 1:
94 : 12128819 : hval += asso_values[(unsigned char)str[0]];
95 : 12128819 : break;
96 : : }
97 : 12128819 : return hval + asso_values[(unsigned char)str[len - 1]];
98 : : }
99 : :
100 : : static const unsigned char lengthtable[] =
101 : : {
102 : : 0, 1, 2, 1, 2, 1, 3, 2, 3, 5, 10, 11, 12, 2,
103 : : 14, 15, 16, 11, 9, 13, 14, 12, 12, 14, 13, 9, 7, 9,
104 : : 7, 9, 14, 5, 6, 14, 12, 16, 10, 14, 11, 10, 7, 1,
105 : : 12, 8, 17, 18, 2, 3, 7, 1, 8, 8, 13, 6, 6, 8,
106 : : 0, 1
107 : : };
108 : :
109 : : static const struct hash_entry wordlist[] =
110 : : {
111 : : {(char*)0, NOPE},
112 : : {"C",CODE},
113 : : {"CC",COMPCHAR},
114 : : {"B",CHARBBOX},
115 : : {"CH",CODEHEX},
116 : : {"W",XYWIDTH},
117 : : {"KPX",KERNPAIRXAMT},
118 : : {"WX",XWIDTH},
119 : : {"W0X",X0WIDTH},
120 : : {"StdHW",STDHW},
121 : : {"Characters",CHARACTERS},
122 : : {"MetricsSets",METRICSSETS},
123 : : {"EndKernPairs",ENDKERNPAIRS},
124 : : {"Em",EM},
125 : : {"StartKernPairs",STARTKERNPAIRS},
126 : : {"StartComposites",STARTCOMPOSITES},
127 : : {"StartCharMetrics",STARTCHARMETRICS},
128 : : {"EndKernData",ENDKERNDATA},
129 : : {"Descender",DESCENDER},
130 : : {"StartKernData",STARTKERNDATA},
131 : : {"EndCharMetrics",ENDCHARMETRICS},
132 : : {"EndDirection",ENDDIRECTION},
133 : : {"CharacterSet",CHARACTERSET},
134 : : {"StartDirection",STARTDIRECTION},
135 : : {"EndComposites",ENDCOMPOSITES},
136 : : {"TrackKern",TRACKKERN},
137 : : {"Descent",DESCENT},
138 : : {"CapHeight",CAPHEIGHT},
139 : : {"Comment",COMMENT},
140 : : {"CharWidth",CHARWIDTH},
141 : : {"StartTrackKern",STARTTRACKKERN},
142 : : {"StdVW",STDVW},
143 : : {"Notice",NOTICE},
144 : : {"EndFontMetrics",ENDFONTMETRICS},
145 : : {"EndTrackKern",ENDTRACKKERN},
146 : : {"StartFontMetrics",STARTFONTMETRICS},
147 : : {"IsBaseFont",ISBASEFONT},
148 : : {"EncodingScheme",ENCODINGSCHEME},
149 : : {"ItalicAngle",ITALICANGLE},
150 : : {"FamilyName",FAMILYNAME},
151 : : {"XHeight",XHEIGHT},
152 : : {"N",CHARNAME},
153 : : {"IsFixedPitch",ISFIXEDPITCH},
154 : : {"FontName",FONTNAME},
155 : : {"UnderlinePosition",UNDERLINEPOSITION},
156 : : {"UnderlineThickness",UNDERLINETHICKNESS},
157 : : {"KP",KERNPAIR},
158 : : {"PCC",COMPCHARPIECE},
159 : : {"Version",VERSION},
160 : : {"V",VVECTOR},
161 : : {"FullName",FULLNAME},
162 : : {"FontBBox",FONTBBOX},
163 : : {"MappingScheme",MAPPINGSCHEME},
164 : : {"Weight",WEIGHT},
165 : : {"Ascent",ASCENT},
166 : : {"Ascender",ASCENDER},
167 : : {(char*)0, NOPE},
168 : : {"L",LIGATURE}
169 : : };
170 : :
171 : : const struct hash_entry *
172 : 12128819 : AfmKeywordHash::in_word_set (register const char *str, register unsigned int len)
173 : : {
174 [ + - ][ + - ]: 12128819 : if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
175 : : {
176 : 12128819 : register int key = hash (str, len);
177 : :
178 [ + - ][ + - ]: 12128819 : if (key <= MAX_HASH_VALUE && key >= 0)
179 [ + - ]: 12128819 : if (len == lengthtable[key])
180 : : {
181 : 12128819 : register const char *s = wordlist[key].name;
182 : :
183 [ + - ][ + - ]: 12128819 : if (s && *str == *s && !memcmp (str + 1, s + 1, len - 1))
[ + - ]
184 : 12128819 : return &wordlist[key];
185 : : }
186 : : }
187 : 12128819 : return 0;
188 : : }
|