1 /*-------------------------------------------------------------------------
4 * lexical token lookup for reserved words in postgres embedded SQL
6 *-------------------------------------------------------------------------
8 #include "postgres_fe.h"
16 * List of (keyword-name, keyword-token-value) pairs.
18 * !!WARNING!!: This list must be sorted, because binary
19 * search is used to locate entries.
21 static ScanKeyword ScanKeywords[] = {
36 {"register", S_REGISTER},
39 {"signed", SQL_SIGNED},
41 {"struct", SQL_STRUCT},
43 {"typedef", S_TYPEDEF},
45 {"unsigned", SQL_UNSIGNED},
47 {"volatile", S_VOLATILE},
52 ScanCKeywordLookup(char *text)
54 ScanKeyword *low = &ScanKeywords[0];
55 ScanKeyword *high = endof(ScanKeywords) - 1;
61 middle = low + (high - low) / 2;
62 difference = strcmp(middle->name, text);
65 else if (difference < 0)