kconfig/zconf.hash.c
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon May 25 17:22:54 2009 +0000 (2009-05-25)
branchgcc-4.4
changeset 1382 b3b1369752ba
parent 878 aa3be56634c1
child 2448 a103abae1560
permissions -rw-r--r--
/devel/gcc-4.4:
- TODO: add new item

-------- diffstat follows --------
/devel/gcc-4.4/TODO | 1 1 0 0 +
1 file changed, 1 insertion(+)
yann@943
     1
/* ANSI-C code produced by gperf version 3.0.3 */
yann@1
     2
/* Command-line: gperf  */
yann@1
     3
/* Computed positions: -k'1,3' */
yann@1
     4
yann@1
     5
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
yann@1
     6
      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
yann@1
     7
      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
yann@1
     8
      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
yann@1
     9
      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
yann@1
    10
      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
yann@1
    11
      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
yann@1
    12
      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
yann@1
    13
      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
yann@1
    14
      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
yann@1
    15
      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
yann@1
    16
      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
yann@1
    17
      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
yann@1
    18
      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
yann@1
    19
      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
yann@1
    20
      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
yann@1
    21
      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
yann@1
    22
      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
yann@1
    23
      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
yann@1
    24
      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
yann@1
    25
      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
yann@1
    26
      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
yann@1
    27
      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
yann@1
    28
/* The character set is not based on ISO-646.  */
yann@1
    29
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
yann@1
    30
#endif
yann@1
    31
yann@1
    32
struct kconf_id;
yann@943
    33
/* maximum key range = 47, duplicates = 0 */
yann@1
    34
yann@1
    35
#ifdef __GNUC__
yann@1
    36
__inline
yann@1
    37
#else
yann@1
    38
#ifdef __cplusplus
yann@1
    39
inline
yann@1
    40
#endif
yann@1
    41
#endif
yann@1
    42
static unsigned int
yann@1
    43
kconf_id_hash (register const char *str, register unsigned int len)
yann@1
    44
{
yann@1
    45
  static unsigned char asso_values[] =
yann@1
    46
    {
yann@943
    47
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    48
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    49
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    50
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    51
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    52
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    53
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    54
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    55
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    56
      49, 49, 49, 49, 49, 49, 49, 49, 11,  5,
yann@943
    57
       0,  0,  5, 49,  5, 20, 49, 49,  5, 20,
yann@943
    58
       5,  0, 30, 49,  0, 15,  0, 10,  0, 49,
yann@943
    59
      25, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    60
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    61
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    62
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    63
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    64
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    65
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    66
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    67
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    68
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    69
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    70
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    71
      49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
yann@943
    72
      49, 49, 49, 49, 49, 49
yann@1
    73
    };
yann@1
    74
  register int hval = len;
yann@1
    75
yann@1
    76
  switch (hval)
yann@1
    77
    {
yann@1
    78
      default:
yann@1
    79
        hval += asso_values[(unsigned char)str[2]];
yann@1
    80
      /*FALLTHROUGH*/
yann@1
    81
      case 2:
yann@1
    82
      case 1:
yann@1
    83
        hval += asso_values[(unsigned char)str[0]];
yann@1
    84
        break;
yann@1
    85
    }
yann@1
    86
  return hval;
yann@1
    87
}
yann@1
    88
yann@1
    89
struct kconf_id_strings_t
yann@1
    90
  {
yann@1
    91
    char kconf_id_strings_str2[sizeof("on")];
yann@943
    92
    char kconf_id_strings_str3[sizeof("env")];
yann@943
    93
    char kconf_id_strings_str5[sizeof("endif")];
yann@943
    94
    char kconf_id_strings_str6[sizeof("option")];
yann@943
    95
    char kconf_id_strings_str7[sizeof("endmenu")];
yann@943
    96
    char kconf_id_strings_str8[sizeof("optional")];
yann@943
    97
    char kconf_id_strings_str9[sizeof("endchoice")];
yann@1
    98
    char kconf_id_strings_str10[sizeof("range")];
yann@943
    99
    char kconf_id_strings_str11[sizeof("choice")];
yann@943
   100
    char kconf_id_strings_str12[sizeof("default")];
yann@943
   101
    char kconf_id_strings_str13[sizeof("def_bool")];
yann@943
   102
    char kconf_id_strings_str14[sizeof("help")];
yann@943
   103
    char kconf_id_strings_str15[sizeof("bool")];
yann@943
   104
    char kconf_id_strings_str16[sizeof("config")];
yann@943
   105
    char kconf_id_strings_str17[sizeof("def_tristate")];
yann@943
   106
    char kconf_id_strings_str18[sizeof("boolean")];
yann@943
   107
    char kconf_id_strings_str19[sizeof("defconfig_list")];
yann@943
   108
    char kconf_id_strings_str21[sizeof("string")];
yann@943
   109
    char kconf_id_strings_str22[sizeof("if")];
yann@943
   110
    char kconf_id_strings_str23[sizeof("int")];
yann@943
   111
    char kconf_id_strings_str26[sizeof("select")];
yann@1
   112
    char kconf_id_strings_str27[sizeof("modules")];
yann@943
   113
    char kconf_id_strings_str28[sizeof("tristate")];
yann@1
   114
    char kconf_id_strings_str29[sizeof("menu")];
yann@943
   115
    char kconf_id_strings_str31[sizeof("source")];
yann@943
   116
    char kconf_id_strings_str32[sizeof("comment")];
yann@943
   117
    char kconf_id_strings_str33[sizeof("hex")];
yann@1
   118
    char kconf_id_strings_str35[sizeof("menuconfig")];
yann@943
   119
    char kconf_id_strings_str36[sizeof("prompt")];
yann@943
   120
    char kconf_id_strings_str37[sizeof("depends")];
yann@943
   121
    char kconf_id_strings_str48[sizeof("mainmenu")];
yann@1
   122
  };
yann@1
   123
static struct kconf_id_strings_t kconf_id_strings_contents =
yann@1
   124
  {
yann@1
   125
    "on",
yann@943
   126
    "env",
yann@943
   127
    "endif",
yann@943
   128
    "option",
yann@943
   129
    "endmenu",
yann@943
   130
    "optional",
yann@943
   131
    "endchoice",
yann@943
   132
    "range",
yann@943
   133
    "choice",
yann@1
   134
    "default",
yann@1
   135
    "def_bool",
yann@943
   136
    "help",
yann@943
   137
    "bool",
yann@943
   138
    "config",
yann@1
   139
    "def_tristate",
yann@943
   140
    "boolean",
yann@943
   141
    "defconfig_list",
yann@943
   142
    "string",
yann@943
   143
    "if",
yann@943
   144
    "int",
yann@943
   145
    "select",
yann@943
   146
    "modules",
yann@943
   147
    "tristate",
yann@943
   148
    "menu",
yann@943
   149
    "source",
yann@943
   150
    "comment",
yann@1
   151
    "hex",
yann@943
   152
    "menuconfig",
yann@1
   153
    "prompt",
yann@1
   154
    "depends",
yann@943
   155
    "mainmenu"
yann@1
   156
  };
yann@1
   157
#define kconf_id_strings ((const char *) &kconf_id_strings_contents)
yann@1
   158
#ifdef __GNUC__
yann@1
   159
__inline
yann@943
   160
#ifdef __GNUC_STDC_INLINE__
yann@943
   161
__attribute__ ((__gnu_inline__))
yann@943
   162
#endif
yann@1
   163
#endif
yann@1
   164
struct kconf_id *
yann@1
   165
kconf_id_lookup (register const char *str, register unsigned int len)
yann@1
   166
{
yann@1
   167
  enum
yann@1
   168
    {
yann@943
   169
      TOTAL_KEYWORDS = 31,
yann@1
   170
      MIN_WORD_LENGTH = 2,
yann@1
   171
      MAX_WORD_LENGTH = 14,
yann@1
   172
      MIN_HASH_VALUE = 2,
yann@943
   173
      MAX_HASH_VALUE = 48
yann@1
   174
    };
yann@1
   175
yann@1
   176
  static struct kconf_id wordlist[] =
yann@1
   177
    {
yann@1
   178
      {-1}, {-1},
yann@1
   179
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2,		T_ON,		TF_PARAM},
yann@943
   180
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3,		T_OPT_ENV,	TF_OPTION},
yann@1
   181
      {-1},
yann@943
   182
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5,		T_ENDIF,	TF_COMMAND},
yann@943
   183
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6,		T_OPTION,	TF_COMMAND},
yann@943
   184
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7,	T_ENDMENU,	TF_COMMAND},
yann@943
   185
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8,	T_OPTIONAL,	TF_COMMAND},
yann@943
   186
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9,	T_ENDCHOICE,	TF_COMMAND},
yann@1
   187
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10,		T_RANGE,	TF_COMMAND},
yann@943
   188
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11,		T_CHOICE,	TF_COMMAND},
yann@943
   189
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12,	T_DEFAULT,	TF_COMMAND, S_UNKNOWN},
yann@943
   190
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13,	T_DEFAULT,	TF_COMMAND, S_BOOLEAN},
yann@943
   191
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14,		T_HELP,		TF_COMMAND},
yann@943
   192
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str15,		T_TYPE,		TF_COMMAND, S_BOOLEAN},
yann@943
   193
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16,		T_CONFIG,	TF_COMMAND},
yann@943
   194
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17,	T_DEFAULT,	TF_COMMAND, S_TRISTATE},
yann@943
   195
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18,	T_TYPE,		TF_COMMAND, S_BOOLEAN},
yann@943
   196
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str19,	T_OPT_DEFCONFIG_LIST,TF_OPTION},
yann@1
   197
      {-1},
yann@943
   198
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21,		T_TYPE,		TF_COMMAND, S_STRING},
yann@943
   199
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22,		T_IF,		TF_COMMAND|TF_PARAM},
yann@943
   200
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23,		T_TYPE,		TF_COMMAND, S_INT},
yann@943
   201
      {-1}, {-1},
yann@943
   202
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26,		T_SELECT,	TF_COMMAND},
yann@1
   203
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27,	T_OPT_MODULES,	TF_OPTION},
yann@943
   204
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28,	T_TYPE,		TF_COMMAND, S_TRISTATE},
yann@1
   205
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29,		T_MENU,		TF_COMMAND},
yann@1
   206
      {-1},
yann@943
   207
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31,		T_SOURCE,	TF_COMMAND},
yann@943
   208
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32,	T_COMMENT,	TF_COMMAND},
yann@943
   209
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33,		T_TYPE,		TF_COMMAND, S_HEX},
yann@943
   210
      {-1},
yann@1
   211
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35,	T_MENUCONFIG,	TF_COMMAND},
yann@943
   212
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36,		T_PROMPT,	TF_COMMAND},
yann@943
   213
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37,	T_DEPENDS,	TF_COMMAND},
yann@943
   214
      {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
yann@1
   215
      {-1},
yann@943
   216
      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str48,	T_MAINMENU,	TF_COMMAND}
yann@1
   217
    };
yann@1
   218
yann@1
   219
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
yann@1
   220
    {
yann@1
   221
      register int key = kconf_id_hash (str, len);
yann@1
   222
yann@1
   223
      if (key <= MAX_HASH_VALUE && key >= 0)
yann@1
   224
        {
yann@1
   225
          register int o = wordlist[key].name;
yann@1
   226
          if (o >= 0)
yann@1
   227
            {
yann@1
   228
              register const char *s = o + kconf_id_strings;
yann@1
   229
yann@1
   230
              if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
yann@1
   231
                return &wordlist[key];
yann@1
   232
            }
yann@1
   233
        }
yann@1
   234
    }
yann@1
   235
  return 0;
yann@1
   236
}
yann@1
   237