/*-------------------------------------------------------------------------
 *
 * ecpg_kwlist_d.h
 *    List of keywords represented as a ScanKeywordList.
 *
 * Portions Copyright (c) 1996-2020, 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 int16 h[83] = {
		     0,     26,    -15,     29,      8,     35,     -6,  32767,
		    11,     20,      0,     25,      4,  32767,     27,      0,
		 32767,  32767,  32767,  32767,      0,  32767,      6,  32767,
		   -87,     43,  32767,      0,  32767,     12,  32767,      7,
		     0,  32767,      0,     30,     38,     23,    -68,      0,
		 32767,      9,  32767,  32767,  32767,      0,     16,    -18,
		    -7,  32767,     19,      0,     68,      0,     96,  32767,
		 32767,     14,      0,    -18,  32767,    -13,  32767,     32,
		     0,     29,     -6,     78,  32767,  32767,     39,     18,
		   -41,  32767,      0,     40,    -63,     22,     31,      0,
		 32767,  32767,  32767,
	};

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

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

		a = a * 31 + c;
		b = b * 127 + 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 */
