1 | /*------------------------------------------------------------------------- |
2 | * |
3 | * c_kwlist_d.h |
4 | * List of keywords represented as a ScanKeywordList. |
5 | * |
6 | * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group |
7 | * Portions Copyright (c) 1994, Regents of the University of California |
8 | * |
9 | * NOTES |
10 | * ****************************** |
11 | * *** DO NOT EDIT THIS FILE! *** |
12 | * ****************************** |
13 | * |
14 | * It has been GENERATED by src/tools/gen_keywordlist.pl |
15 | * |
16 | *------------------------------------------------------------------------- |
17 | */ |
18 | |
19 | #ifndef C_KWLIST_D_H |
20 | #define C_KWLIST_D_H |
21 | |
22 | #include "common/kwlookup.h" |
23 | |
24 | static const char ScanCKeywords_kw_string[] = |
25 | "VARCHAR\0" |
26 | "auto\0" |
27 | "bool\0" |
28 | "char\0" |
29 | "const\0" |
30 | "enum\0" |
31 | "extern\0" |
32 | "float\0" |
33 | "hour\0" |
34 | "int\0" |
35 | "long\0" |
36 | "minute\0" |
37 | "month\0" |
38 | "register\0" |
39 | "second\0" |
40 | "short\0" |
41 | "signed\0" |
42 | "static\0" |
43 | "struct\0" |
44 | "to\0" |
45 | "typedef\0" |
46 | "union\0" |
47 | "unsigned\0" |
48 | "varchar\0" |
49 | "volatile\0" |
50 | "year" ; |
51 | |
52 | static const uint16 ScanCKeywords_kw_offsets[] = { |
53 | 0, |
54 | 8, |
55 | 13, |
56 | 18, |
57 | 23, |
58 | 29, |
59 | 34, |
60 | 41, |
61 | 47, |
62 | 52, |
63 | 56, |
64 | 61, |
65 | 68, |
66 | 74, |
67 | 83, |
68 | 90, |
69 | 96, |
70 | 103, |
71 | 110, |
72 | 117, |
73 | 120, |
74 | 128, |
75 | 134, |
76 | 143, |
77 | 151, |
78 | 160, |
79 | }; |
80 | |
81 | #define SCANCKEYWORDS_NUM_KEYWORDS 26 |
82 | |
83 | static int |
84 | ScanCKeywords_hash_func(const void *key, size_t keylen) |
85 | { |
86 | static const int8 h[53] = { |
87 | 24, 14, 0, 10, 19, 2, 11, 3, |
88 | 6, 127, 127, 127, 127, 2, 0, 127, |
89 | 0, 9, 127, 127, 127, 127, 17, 127, |
90 | 0, 1, 5, 0, 0, -12, 21, 13, |
91 | 127, 127, 0, 127, 127, 0, 127, 7, |
92 | 127, 16, 2, 0, 10, 0, 0, 3, |
93 | 0, 4, 0, 18, 20, |
94 | }; |
95 | |
96 | const unsigned char *k = (const unsigned char *) key; |
97 | uint32 a = 1; |
98 | uint32 b = 2; |
99 | |
100 | while (keylen--) |
101 | { |
102 | unsigned char c = *k++; |
103 | |
104 | a = a * 31 + c; |
105 | b = b * 127 + c; |
106 | } |
107 | return h[a % 53] + h[b % 53]; |
108 | } |
109 | |
110 | static const ScanKeywordList ScanCKeywords = { |
111 | ScanCKeywords_kw_string, |
112 | ScanCKeywords_kw_offsets, |
113 | ScanCKeywords_hash_func, |
114 | SCANCKEYWORDS_NUM_KEYWORDS, |
115 | 8 |
116 | }; |
117 | |
118 | #endif /* C_KWLIST_D_H */ |
119 | |