1*c142477cSAndrew Rist /**************************************************************
2*c142477cSAndrew Rist *
3*c142477cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*c142477cSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*c142477cSAndrew Rist * distributed with this work for additional information
6*c142477cSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*c142477cSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*c142477cSAndrew Rist * "License"); you may not use this file except in compliance
9*c142477cSAndrew Rist * with the License. You may obtain a copy of the License at
10*c142477cSAndrew Rist *
11*c142477cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*c142477cSAndrew Rist *
13*c142477cSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*c142477cSAndrew Rist * software distributed under the License is distributed on an
15*c142477cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c142477cSAndrew Rist * KIND, either express or implied. See the License for the
17*c142477cSAndrew Rist * specific language governing permissions and limitations
18*c142477cSAndrew Rist * under the License.
19*c142477cSAndrew Rist *
20*c142477cSAndrew Rist *************************************************************/
21*c142477cSAndrew Rist
22cdf0e10cSrcweir /* C++ code produced by gperf version 3.0.1 */
23cdf0e10cSrcweir /* Command-line: gperf -C -t -l -L C++ -m 20 -Z PdfKeywordHash keyword_list */
24cdf0e10cSrcweir /* Computed positions: -k'4-5,$' */
25cdf0e10cSrcweir
26cdf0e10cSrcweir #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
27cdf0e10cSrcweir && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
28cdf0e10cSrcweir && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
29cdf0e10cSrcweir && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
30cdf0e10cSrcweir && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
31cdf0e10cSrcweir && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
32cdf0e10cSrcweir && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
33cdf0e10cSrcweir && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
34cdf0e10cSrcweir && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
35cdf0e10cSrcweir && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
36cdf0e10cSrcweir && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
37cdf0e10cSrcweir && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
38cdf0e10cSrcweir && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
39cdf0e10cSrcweir && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
40cdf0e10cSrcweir && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
41cdf0e10cSrcweir && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
42cdf0e10cSrcweir && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
43cdf0e10cSrcweir && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
44cdf0e10cSrcweir && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
45cdf0e10cSrcweir && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
46cdf0e10cSrcweir && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
47cdf0e10cSrcweir && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
48cdf0e10cSrcweir && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
49cdf0e10cSrcweir /* The character set is not based on ISO-646. */
50cdf0e10cSrcweir #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
51cdf0e10cSrcweir #endif
52cdf0e10cSrcweir
53cdf0e10cSrcweir #line 1 "keyword_list"
54cdf0e10cSrcweir struct hash_entry { const char* name; enum parseKey eKey; };
55cdf0e10cSrcweir
56cdf0e10cSrcweir #if defined __GNUC__
57cdf0e10cSrcweir #pragma GCC system_header
58cdf0e10cSrcweir #endif
59cdf0e10cSrcweir
60cdf0e10cSrcweir #define TOTAL_KEYWORDS 46
61cdf0e10cSrcweir #define MIN_WORD_LENGTH 7
62cdf0e10cSrcweir #define MAX_WORD_LENGTH 19
63cdf0e10cSrcweir #define MIN_HASH_VALUE 8
64cdf0e10cSrcweir #define MAX_HASH_VALUE 68
65cdf0e10cSrcweir /* maximum key range = 61, duplicates = 0 */
66cdf0e10cSrcweir
67cdf0e10cSrcweir class PdfKeywordHash
68cdf0e10cSrcweir {
69cdf0e10cSrcweir private:
70cdf0e10cSrcweir static inline unsigned int hash (const char *str, unsigned int len);
71cdf0e10cSrcweir public:
72cdf0e10cSrcweir static const struct hash_entry *in_word_set (const char *str, unsigned int len);
73cdf0e10cSrcweir };
74cdf0e10cSrcweir
75cdf0e10cSrcweir inline unsigned int
hash(register const char * str,register unsigned int len)76cdf0e10cSrcweir PdfKeywordHash::hash (register const char *str, register unsigned int len)
77cdf0e10cSrcweir {
78cdf0e10cSrcweir static const unsigned char asso_values[] =
79cdf0e10cSrcweir {
80cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
81cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
82cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
83cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
84cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
85cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
86cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 9, 69, 38, 69,
87cdf0e10cSrcweir 1, 69, 69, 69, 31, 69, 16, 35, 21, 69,
88cdf0e10cSrcweir 15, 0, 69, 21, 15, 69, 69, 69, 69, 69,
89cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 0, 15, 69,
90cdf0e10cSrcweir 69, 5, 8, 69, 4, 8, 0, 20, 2, 27,
91cdf0e10cSrcweir 11, 31, 0, 69, 0, 9, 0, 5, 69, 5,
92cdf0e10cSrcweir 69, 13, 69, 69, 69, 69, 69, 69, 69, 69,
93cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
94cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
95cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
96cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
97cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
98cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
99cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
100cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
101cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
102cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
103cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
104cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
105cdf0e10cSrcweir 69, 69, 69, 69, 69, 69, 69
106cdf0e10cSrcweir };
107cdf0e10cSrcweir return len + asso_values[(unsigned char)str[4]+1] + asso_values[(unsigned char)str[3]] + asso_values[(unsigned char)str[len - 1]];
108cdf0e10cSrcweir }
109cdf0e10cSrcweir
110cdf0e10cSrcweir const struct hash_entry *
in_word_set(register const char * str,register unsigned int len)111cdf0e10cSrcweir PdfKeywordHash::in_word_set (register const char *str, register unsigned int len)
112cdf0e10cSrcweir {
113cdf0e10cSrcweir static const unsigned char lengthtable[] =
114cdf0e10cSrcweir {
115cdf0e10cSrcweir 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 8, 12,
116cdf0e10cSrcweir 8, 10, 10, 12, 13, 9, 15, 16, 17, 14, 15, 15, 10, 13,
117cdf0e10cSrcweir 14, 15, 14, 11, 12, 9, 9, 17, 13, 19, 11, 8, 14, 9,
118cdf0e10cSrcweir 7, 9, 19, 17, 15, 10, 13, 10, 9, 8, 17, 12, 8, 0,
119cdf0e10cSrcweir 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 8
120cdf0e10cSrcweir };
121cdf0e10cSrcweir static const struct hash_entry wordlist[] =
122cdf0e10cSrcweir {
123cdf0e10cSrcweir {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
124cdf0e10cSrcweir #line 29 "keyword_list"
125cdf0e10cSrcweir {"setFont",SETFONT},
126cdf0e10cSrcweir {""}, {""}, {""},
127cdf0e10cSrcweir #line 8 "keyword_list"
128cdf0e10cSrcweir {"clipPath",CLIPPATH},
129cdf0e10cSrcweir #line 28 "keyword_list"
130cdf0e10cSrcweir {"setFillColor",SETFILLCOLOR},
131cdf0e10cSrcweir #line 19 "keyword_list"
132cdf0e10cSrcweir {"fillPath",FILLPATH},
133cdf0e10cSrcweir #line 46 "keyword_list"
134cdf0e10cSrcweir {"updateFont",UPDATEFONT},
135cdf0e10cSrcweir #line 17 "keyword_list"
136cdf0e10cSrcweir {"eoClipPath",EOCLIPPATH},
137cdf0e10cSrcweir #line 25 "keyword_list"
138cdf0e10cSrcweir {"restoreState",RESTORESTATE},
139cdf0e10cSrcweir #line 47 "keyword_list"
140cdf0e10cSrcweir {"updateLineCap",UPDATELINECAP},
141cdf0e10cSrcweir #line 39 "keyword_list"
142cdf0e10cSrcweir {"startPage",STARTPAGE},
143cdf0e10cSrcweir #line 43 "keyword_list"
144cdf0e10cSrcweir {"updateFillColor",UPDATEFILLCOLOR},
145cdf0e10cSrcweir #line 51 "keyword_list"
146cdf0e10cSrcweir {"updateMiterLimit",UPDATEMITERLIMIT},
147cdf0e10cSrcweir #line 52 "keyword_list"
148cdf0e10cSrcweir {"updateStrokeColor",UPDATESTROKECOLOR},
149cdf0e10cSrcweir #line 48 "keyword_list"
150cdf0e10cSrcweir {"updateLineDash",UPDATELINEDASH},
151cdf0e10cSrcweir #line 50 "keyword_list"
152cdf0e10cSrcweir {"updateLineWidth",UPDATELINEWIDTH},
153cdf0e10cSrcweir #line 41 "keyword_list"
154cdf0e10cSrcweir {"updateBlendMode",UPDATEBLENDMODE},
155cdf0e10cSrcweir #line 30 "keyword_list"
156cdf0e10cSrcweir {"setLineCap",SETLINECAP},
157cdf0e10cSrcweir #line 21 "keyword_list"
158cdf0e10cSrcweir {"intersectClip",INTERSECTCLIP},
159cdf0e10cSrcweir #line 45 "keyword_list"
160cdf0e10cSrcweir {"updateFlatness",UPDATEFLATNESS},
161cdf0e10cSrcweir #line 22 "keyword_list"
162cdf0e10cSrcweir {"intersectEoClip",INTERSECTEOCLIP},
163cdf0e10cSrcweir #line 49 "keyword_list"
164cdf0e10cSrcweir {"updateLineJoin",UPDATELINEJOIN},
165cdf0e10cSrcweir #line 31 "keyword_list"
166cdf0e10cSrcweir {"setLineDash",SETLINEDASH},
167cdf0e10cSrcweir #line 33 "keyword_list"
168cdf0e10cSrcweir {"setLineWidth",SETLINEWIDTH},
169cdf0e10cSrcweir #line 24 "keyword_list"
170cdf0e10cSrcweir {"pushState",PUSHSTATE},
171cdf0e10cSrcweir #line 26 "keyword_list"
172cdf0e10cSrcweir {"saveState",SAVESTATE},
173cdf0e10cSrcweir #line 44 "keyword_list"
174cdf0e10cSrcweir {"updateFillOpacity",UPDATEFILLOPACITY},
175cdf0e10cSrcweir #line 16 "keyword_list"
176cdf0e10cSrcweir {"endTextObject",ENDTEXTOBJECT},
177cdf0e10cSrcweir #line 53 "keyword_list"
178cdf0e10cSrcweir {"updateStrokeOpacity",UPDATESTROKEOPACITY},
179cdf0e10cSrcweir #line 32 "keyword_list"
180cdf0e10cSrcweir {"setLineJoin",SETLINEJOIN},
181cdf0e10cSrcweir #line 23 "keyword_list"
182cdf0e10cSrcweir {"popState",POPSTATE},
183cdf0e10cSrcweir #line 36 "keyword_list"
184cdf0e10cSrcweir {"setStrokeColor",SETSTROKECOLOR},
185cdf0e10cSrcweir #line 42 "keyword_list"
186cdf0e10cSrcweir {"updateCtm",UPDATECTM},
187cdf0e10cSrcweir #line 15 "keyword_list"
188cdf0e10cSrcweir {"endPage",ENDPAGE},
189cdf0e10cSrcweir #line 20 "keyword_list"
190cdf0e10cSrcweir {"hyperLink",HYPERLINK},
191cdf0e10cSrcweir #line 14 "keyword_list"
192cdf0e10cSrcweir {"drawSoftMaskedImage",DRAWSOFTMASKEDIMAGE},
193cdf0e10cSrcweir #line 37 "keyword_list"
194cdf0e10cSrcweir {"setTextRenderMode",SETTEXTRENDERMODE},
195cdf0e10cSrcweir #line 13 "keyword_list"
196cdf0e10cSrcweir {"drawMaskedImage",DRAWMASKEDIMAGE},
197cdf0e10cSrcweir #line 40 "keyword_list"
198cdf0e10cSrcweir {"strokePath",STROKEPATH},
199cdf0e10cSrcweir #line 34 "keyword_list"
200cdf0e10cSrcweir {"setMiterLimit",SETMITERLIMIT},
201cdf0e10cSrcweir #line 18 "keyword_list"
202cdf0e10cSrcweir {"eoFillPath",EOFILLPATH},
203cdf0e10cSrcweir #line 10 "keyword_list"
204cdf0e10cSrcweir {"drawImage",DRAWIMAGE},
205cdf0e10cSrcweir #line 9 "keyword_list"
206cdf0e10cSrcweir {"drawChar",DRAWCHAR},
207cdf0e10cSrcweir #line 38 "keyword_list"
208cdf0e10cSrcweir {"setTransformation",SETTRANSFORMATION},
209cdf0e10cSrcweir #line 27 "keyword_list"
210cdf0e10cSrcweir {"setBlendMode",SETBLENDMODE},
211cdf0e10cSrcweir #line 12 "keyword_list"
212cdf0e10cSrcweir {"drawMask",DRAWMASK},
213cdf0e10cSrcweir {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
214cdf0e10cSrcweir {""}, {""}, {""},
215cdf0e10cSrcweir #line 35 "keyword_list"
216cdf0e10cSrcweir {"setPageNum",SETPAGENUM},
217cdf0e10cSrcweir #line 11 "keyword_list"
218cdf0e10cSrcweir {"drawLink",DRAWLINK }
219cdf0e10cSrcweir };
220cdf0e10cSrcweir
221cdf0e10cSrcweir if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
222cdf0e10cSrcweir {
223cdf0e10cSrcweir register int key = hash (str, len);
224cdf0e10cSrcweir
225cdf0e10cSrcweir if (key <= MAX_HASH_VALUE && key >= 0)
226cdf0e10cSrcweir if (len == lengthtable[key])
227cdf0e10cSrcweir {
228cdf0e10cSrcweir register const char *s = wordlist[key].name;
229cdf0e10cSrcweir
230cdf0e10cSrcweir if (*str == *s && !memcmp (str + 1, s + 1, len - 1))
231cdf0e10cSrcweir return &wordlist[key];
232cdf0e10cSrcweir }
233cdf0e10cSrcweir }
234cdf0e10cSrcweir return 0;
235cdf0e10cSrcweir }
236