Imported Upstream version 3.7.1
[platform/upstream/ccache.git] / src / envtoconfitems_lookup.c
1 /* ANSI-C code produced by gperf version 3.1 */
2 /* Command-line: gperf  */
3 /* Computed positions: -k'4-5' */
4
5 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
6       && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
7       && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
8       && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
9       && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
10       && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
11       && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
12       && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
13       && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
14       && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
15       && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
16       && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
17       && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
18       && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
19       && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
20       && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
21       && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
22       && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
23       && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
24       && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
25       && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
26       && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
27       && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
28 /* The character set is not based on ISO-646.  */
29 #warning "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
30 #endif
31
32 #include "envtoconfitems.h"
33 struct env_to_conf_item;
34 /* maximum key range = 52, duplicates = 0 */
35
36 #ifdef __GNUC__
37 __inline
38 #else
39 #ifdef __cplusplus
40 inline
41 #endif
42 #endif
43 static unsigned int
44 envtoconfitems_hash (register const char *str, register size_t len)
45 {
46   static const unsigned char asso_values[] =
47     {
48       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
49       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
50       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
51       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
52       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
53        0, 54, 54, 54, 54, 54, 54, 54, 54, 54,
54       54, 54, 54, 54, 54, 25, 10,  0,  0,  5,
55       10,  0, 15,  0, 54, 10, 35, 25, 10, 25,
56        0, 54, 15, 20,  0,  0, 25, 54, 54, 15,
57       54, 54, 54, 54, 54,  0, 54, 54, 54, 54,
58       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
59       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
60       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
61       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
62       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
63       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
64       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
65       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
66       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
67       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
68       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
69       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
70       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
71       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
72       54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
73       54, 54, 54, 54, 54, 54
74     };
75   register unsigned int hval = len;
76
77   switch (hval)
78     {
79       default:
80         hval += asso_values[(unsigned char)str[4]];
81       /*FALLTHROUGH*/
82       case 4:
83         hval += asso_values[(unsigned char)str[3]];
84       /*FALLTHROUGH*/
85       case 3:
86       case 2:
87         break;
88     }
89   return hval;
90 }
91
92 const struct env_to_conf_item *
93 envtoconfitems_get (register const char *str, register size_t len)
94 {
95   enum
96     {
97       TOTAL_KEYWORDS = 35,
98       MIN_WORD_LENGTH = 2,
99       MAX_WORD_LENGTH = 15,
100       MIN_HASH_VALUE = 2,
101       MAX_HASH_VALUE = 53
102     };
103
104   static const struct env_to_conf_item wordlist[] =
105     {
106       {"",""}, {"",""},
107       {"CC", "compiler"},
108       {"DIR", "cache_dir"},
109       {"CPP2", "run_second_cpp"},
110       {"DEBUG", "debug"},
111       {"",""},
112       {"TEMPDIR", "temporary_dir"},
113       {"COMPILER", "compiler"},
114       {"",""},
115       {"SLOPPINESS", "sloppiness"},
116       {"DIRECT", "direct_mode"},
117       {"BASEDIR", "base_dir"},
118       {"COMPILERCHECK", "compiler_check"},
119       {"LIMIT_MULTIPLE", "limit_multiple"},
120       {"PCH_EXTSUM", "pch_external_checksum"},
121       {"PREFIX", "prefix_command"},
122       {"LOGFILE", "log_file"},
123       {"MAXFILES", "max_files"},
124       {"PATH", "path"},
125       {"PREFIX_CPP", "prefix_command_cpp"},
126       {"DEPEND", "depend_mode"},
127       {"HASHDIR", "hash_dir"},
128       {"COMPRESS", "compression"},
129       {"EXTENSION", "cpp_extension"},
130       {"STATS", "stats"},
131       {"",""},
132       {"MAXSIZE", "max_size"},
133       {"COMPRESSLEVEL", "compression_level"},
134       {"",""},
135       {"UNIFY", "unify"},
136       {"",""},
137       {"RECACHE", "recache"},
138       {"READONLY", "read_only"},
139       {"",""},
140       {"UMASK", "umask"},
141       {"",""},
142       {"NLEVELS", "cache_dir_levels"},
143       {"COMMENTS", "keep_comments_cpp"},
144       {"",""},
145       {"READONLY_DIRECT", "read_only_direct"},
146       {"",""},
147       {"DISABLE", "disable"},
148       {"HARDLINK", "hard_link"},
149       {"",""}, {"",""}, {"",""}, {"",""}, {"",""}, {"",""},
150       {"EXTRAFILES", "extra_files_to_hash"},
151       {"",""}, {"",""},
152       {"IGNOREHEADERS", "ignore_headers_in_manifest"}
153     };
154
155   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
156     {
157       register unsigned int key = envtoconfitems_hash (str, len);
158
159       if (key <= MAX_HASH_VALUE)
160         {
161           register const char *s = wordlist[key].env_name;
162
163           if (*str == *s && !strcmp (str + 1, s + 1))
164             return &wordlist[key];
165         }
166     }
167   return 0;
168 }
169 size_t envtoconfitems_count(void) { return 35; }