#include "postgres_fe.h"
#include <ctype.h>
#include "extern.h"
#include "preproc.h"
Go to the source code of this file.
Functions | |
const ScanKeyword * | ScanCKeywordLookup (const char *text) |
Variables | |
static const ScanKeyword | ScanCKeywords [] |
const ScanKeyword* ScanCKeywordLookup | ( | const char * | text | ) |
Definition at line 64 of file c_keywords.c.
References lengthof, and ScanKeyword::name.
{ const ScanKeyword *low = &ScanCKeywords[0]; const ScanKeyword *high = &ScanCKeywords[lengthof(ScanCKeywords) - 1]; while (low <= high) { const ScanKeyword *middle; int difference; middle = low + (high - low) / 2; difference = strcmp(middle->name, text); if (difference == 0) return middle; else if (difference < 0) low = middle + 1; else high = middle - 1; } return NULL; }
const ScanKeyword ScanCKeywords[] [static] |
Definition at line 23 of file c_keywords.c.