summaryrefslogtreecommitdiffstats
path: root/src/interfaces/ecpg/preproc/ecpg_kwlist_d.h
blob: a88febd6e407b51745223a4e64b38b843ca53d69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*-------------------------------------------------------------------------
 *
 * ecpg_kwlist_d.h
 *    List of keywords represented as a ScanKeywordList.
 *
 * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * NOTES
 *  ******************************
 *  *** DO NOT EDIT THIS FILE! ***
 *  ******************************
 *
 *  It has been GENERATED by src/tools/gen_keywordlist.pl
 *
 *-------------------------------------------------------------------------
 */

#ifndef ECPG_KWLIST_D_H
#define ECPG_KWLIST_D_H

#include "common/kwlookup.h"

static const char ScanECPGKeywords_kw_string[] =
	"allocate\0"
	"autocommit\0"
	"bool\0"
	"break\0"
	"cardinality\0"
	"connect\0"
	"count\0"
	"datetime_interval_code\0"
	"datetime_interval_precision\0"
	"describe\0"
	"descriptor\0"
	"disconnect\0"
	"found\0"
	"free\0"
	"get\0"
	"go\0"
	"goto\0"
	"identified\0"
	"indicator\0"
	"key_member\0"
	"length\0"
	"long\0"
	"nullable\0"
	"octet_length\0"
	"open\0"
	"output\0"
	"reference\0"
	"returned_length\0"
	"returned_octet_length\0"
	"scale\0"
	"section\0"
	"short\0"
	"signed\0"
	"sqlerror\0"
	"sqlprint\0"
	"sqlwarning\0"
	"stop\0"
	"struct\0"
	"unsigned\0"
	"var\0"
	"whenever";

static const uint16 ScanECPGKeywords_kw_offsets[] = {
	0,
	9,
	20,
	25,
	31,
	43,
	51,
	57,
	80,
	108,
	117,
	128,
	139,
	145,
	150,
	154,
	157,
	162,
	173,
	183,
	194,
	201,
	206,
	215,
	228,
	233,
	240,
	250,
	266,
	288,
	294,
	302,
	308,
	315,
	324,
	333,
	344,
	349,
	356,
	365,
	369,
};

#define SCANECPGKEYWORDS_NUM_KEYWORDS 41

static int
ScanECPGKeywords_hash_func(const void *key, size_t keylen)
{
	static const int8 h[83] = {
		0,     24,    127,   127,   3,     13,    -21,   127,
		0,     20,    2,     18,    24,    32,    127,   0,
		127,   127,   22,    127,   127,   127,   -23,   127,
		127,   0,     127,   127,   127,   -8,    22,    1,
		0,     7,     0,     6,     16,    34,    127,   127,
		16,    0,     44,    127,   127,   127,   -12,   127,
		21,    18,    0,     127,   -9,    28,    7,     4,
		127,   26,    127,   14,    127,   -8,    127,   29,
		127,   0,     0,     38,    127,   9,     25,    0,
		0,     127,   15,    20,    127,   7,     -1,    5,
		19,    127,   11
	};

	const unsigned char *k = (const unsigned char *) key;
	uint32		a = 0;
	uint32		b = 0;

	while (keylen--)
	{
		unsigned char c = *k++ | 0x20;

		a = a * 257 + c;
		b = b * 31 + c;
	}
	return h[a % 83] + h[b % 83];
}

static const ScanKeywordList ScanECPGKeywords = {
	ScanECPGKeywords_kw_string,
	ScanECPGKeywords_kw_offsets,
	ScanECPGKeywords_hash_func,
	SCANECPGKEYWORDS_NUM_KEYWORDS,
	27
};

#endif							/* ECPG_KWLIST_D_H */