1 | /*------------------------------------------------------------------------- |
2 | * |
3 | * ecpg_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 ECPG_KWLIST_D_H |
20 | #define ECPG_KWLIST_D_H |
21 | |
22 | #include "common/kwlookup.h" |
23 | |
24 | static const char ScanECPGKeywords_kw_string[] = |
25 | "allocate\0" |
26 | "autocommit\0" |
27 | "bool\0" |
28 | "break\0" |
29 | "cardinality\0" |
30 | "connect\0" |
31 | "count\0" |
32 | "datetime_interval_code\0" |
33 | "datetime_interval_precision\0" |
34 | "describe\0" |
35 | "descriptor\0" |
36 | "disconnect\0" |
37 | "found\0" |
38 | "free\0" |
39 | "get\0" |
40 | "go\0" |
41 | "goto\0" |
42 | "identified\0" |
43 | "indicator\0" |
44 | "key_member\0" |
45 | "length\0" |
46 | "long\0" |
47 | "nullable\0" |
48 | "octet_length\0" |
49 | "open\0" |
50 | "output\0" |
51 | "reference\0" |
52 | "returned_length\0" |
53 | "returned_octet_length\0" |
54 | "scale\0" |
55 | "section\0" |
56 | "short\0" |
57 | "signed\0" |
58 | "sqlerror\0" |
59 | "sqlprint\0" |
60 | "sqlwarning\0" |
61 | "stop\0" |
62 | "struct\0" |
63 | "unsigned\0" |
64 | "var\0" |
65 | "whenever" ; |
66 | |
67 | static const uint16 ScanECPGKeywords_kw_offsets[] = { |
68 | 0, |
69 | 9, |
70 | 20, |
71 | 25, |
72 | 31, |
73 | 43, |
74 | 51, |
75 | 57, |
76 | 80, |
77 | 108, |
78 | 117, |
79 | 128, |
80 | 139, |
81 | 145, |
82 | 150, |
83 | 154, |
84 | 157, |
85 | 162, |
86 | 173, |
87 | 183, |
88 | 194, |
89 | 201, |
90 | 206, |
91 | 215, |
92 | 228, |
93 | 233, |
94 | 240, |
95 | 250, |
96 | 266, |
97 | 288, |
98 | 294, |
99 | 302, |
100 | 308, |
101 | 315, |
102 | 324, |
103 | 333, |
104 | 344, |
105 | 349, |
106 | 356, |
107 | 365, |
108 | 369, |
109 | }; |
110 | |
111 | #define SCANECPGKEYWORDS_NUM_KEYWORDS 41 |
112 | |
113 | static int |
114 | ScanECPGKeywords_hash_func(const void *key, size_t keylen) |
115 | { |
116 | static const int16 h[83] = { |
117 | 0, 26, -15, 29, 8, 35, -6, 32767, |
118 | 11, 20, 0, 25, 4, 32767, 27, 0, |
119 | 32767, 32767, 32767, 32767, 0, 32767, 6, 32767, |
120 | -87, 43, 32767, 0, 32767, 12, 32767, 7, |
121 | 0, 32767, 0, 30, 38, 23, -68, 0, |
122 | 32767, 9, 32767, 32767, 32767, 0, 16, -18, |
123 | -7, 32767, 19, 0, 68, 0, 96, 32767, |
124 | 32767, 14, 0, -18, 32767, -13, 32767, 32, |
125 | 0, 29, -6, 78, 32767, 32767, 39, 18, |
126 | -41, 32767, 0, 40, -63, 22, 31, 0, |
127 | 32767, 32767, 32767, |
128 | }; |
129 | |
130 | const unsigned char *k = (const unsigned char *) key; |
131 | uint32 a = 0; |
132 | uint32 b = 3; |
133 | |
134 | while (keylen--) |
135 | { |
136 | unsigned char c = *k++ | 0x20; |
137 | |
138 | a = a * 31 + c; |
139 | b = b * 127 + c; |
140 | } |
141 | return h[a % 83] + h[b % 83]; |
142 | } |
143 | |
144 | static const ScanKeywordList ScanECPGKeywords = { |
145 | ScanECPGKeywords_kw_string, |
146 | ScanECPGKeywords_kw_offsets, |
147 | ScanECPGKeywords_hash_func, |
148 | SCANECPGKEYWORDS_NUM_KEYWORDS, |
149 | 27 |
150 | }; |
151 | |
152 | #endif /* ECPG_KWLIST_D_H */ |
153 | |