/* C code produced by gperf version 2.1 (K&R C version) */ /* Command-line: gperf -aptCT -N in_word_set_boollist bool.list */ #include "config.h" #ifdef HAVE_STRING_H #include #endif /* HAVE_STRING_H */ #include "common.h" #include "bool.h" #define MIN_WORD_LENGTH 1 #define MAX_WORD_LENGTH 7 #define MIN_HASH_VALUE 1 #define MAX_HASH_VALUE 11 /* 6 keywords 11 is the maximum key range */ static int hash (register const char *str, register int len) { static const unsigned char hash_table[] = { 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 5, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, }; return len + hash_table[str[len - 1]] + hash_table[str[0]]; } const BOOLLIST* in_word_set_boollist (register const char *str, register int len) { static const BOOLLIST wordlist[] = { {"",}, {"1", TRUE}, {"",}, {"",}, {"true", TRUE}, {"false", FALSE}, {"enable", TRUE}, {"disable", FALSE}, {"",}, {"",}, {"",}, {"0", FALSE}, }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = hash (str, len); if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) { register const char *s = wordlist[key].name; if (*s == *str && !strcmp (str + 1, s + 1)) return &wordlist[key]; } } return 0; }