Cleanup ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE, all platforms support it so far as I can...
[ACE_TAO.git] / ACE / apps / gperf / tests / test-2.exp
blobc911e2791ec93b4a99dfd04a141098d73e465fd4
1 /* C code produced by gperf version 2.8 (ACE version) */
2 /* Command-line: ../src/gperf -n -k1-8 -l */
3 #include <string.h>
5 #define TOTAL_KEYWORDS 40
6 #define MIN_WORD_LENGTH 2
7 #define MAX_WORD_LENGTH 14
8 #define MIN_HASH_VALUE 1
9 #define MAX_HASH_VALUE 256
10 #define HASH_VALUE_RANGE 256
11 #define DUPLICATES 0
12 #define WORDLIST_SIZE 41
14 static unsigned int
15 hash (str, len)
16 char *str;
17 unsigned int len;
19 static unsigned short asso_values[] =
21 #if defined (ACE_MVS)
22 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
23 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
24 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
25 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
26 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
27 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
28 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
29 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
30 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
31 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
32 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
33 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
34 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
35 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
36 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
37 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
38 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
39 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
40 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
41 257, 257, 257, 25, 30, 35, 21, 0, 30, 15,
42 30, 45, 257, 257, 257, 257, 257, 257, 257, 257,
43 257, 0, 5, 45, 0, 10, 0, 1, 257, 257,
44 257, 257, 257, 257, 257, 257, 20, 25, 15, 30,
45 40, 15, 5, 257, 257, 257, 257, 257, 257, 257,
46 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
47 257, 257, 257, 257, 257, 257,
48 #else
49 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
50 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
51 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
52 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
53 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
54 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
55 257, 257, 257, 257, 257, 25, 30, 35, 21, 0,
56 30, 15, 30, 45, 257, 257, 0, 5, 45, 0,
57 10, 0, 1, 20, 25, 15, 30, 40, 15, 5,
58 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
59 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
60 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
61 257, 257, 257, 257, 257, 257, 257, 257,
62 #endif /* ACE_MVS */
64 unsigned int hval = 0;
66 switch (len)
68 default:
69 case 8:
70 hval += asso_values[(int) str[7]];
71 case 7:
72 hval += asso_values[(int) str[6]];
73 case 6:
74 hval += asso_values[(int) str[5]];
75 case 5:
76 hval += asso_values[(int) str[4]];
77 case 4:
78 hval += asso_values[(int) str[3]];
79 case 3:
80 hval += asso_values[(int) str[2]];
81 case 2:
82 hval += asso_values[(int) str[1]];
83 case 1:
84 hval += asso_values[(int) str[0]];
86 return hval;
89 const char *
90 in_word_set (str, len)
91 char *str;
92 unsigned int len;
95 static unsigned char lengthtable[] =
97 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
98 0, 0, 0, 0, 0, 0, 4, 2, 0, 0, 0, 2, 3, 0,
99 0, 0, 2, 3, 0, 0, 0, 2, 4, 0, 0, 0, 4, 6,
100 0, 0, 0, 3, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0,
101 3, 5, 6, 0, 0, 6, 0, 0, 0, 0, 3, 0, 0, 0,
102 3, 0, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 9,
103 0, 4, 6, 6, 0, 0, 2, 3, 0, 0, 0, 5, 3, 0,
104 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0,
105 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
106 7, 0, 0, 0, 5, 0, 0, 0, 0, 5, 0, 0, 0, 0,
107 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
108 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
110 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
113 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
114 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
115 0, 0, 0, 0, 10,
117 static const char *wordlist[] =
120 "OR",
121 "","","","","","","","",
122 "LOOP",
123 "","","","","","","","","",
124 "ELSE",
125 "DO",
126 "","","",
127 "TO",
128 "MOD",
129 "","","",
130 "OF",
131 "FOR",
132 "","","",
133 "BY",
134 "FROM",
135 "","","",
136 "TYPE",
137 "MODULE",
138 "","","",
139 "SET",
140 "","","","","",
141 "EXPORT",
142 "","","","",
143 "VAR",
144 "ARRAY",
145 "RECORD",
146 "","",
147 "REPEAT",
148 "","","","",
149 "END",
150 "","","",
151 "NOT",
152 "","","","",
153 "IF",
154 "","","","",
155 "CASE",
156 "","",
157 "PROCEDURE",
159 "EXIT",
160 "IMPORT",
161 "RETURN",
162 "","",
163 "IN",
164 "AND",
165 "","","",
166 "ELSIF",
167 "DIV",
168 "","","",
169 "THEN",
170 "","","","","","","","","",
171 "IMPLEMENTATION",
172 "","","","",
173 "WHILE",
174 "","","","","","","","","",
175 "CONST",
176 "POINTER",
177 "","","",
178 "UNTIL",
179 "","","","",
180 "BEGIN",
181 "","","","",
182 "WITH",
183 "","","","","","","","","",
184 "","","","","","","","","",
185 "","QUALIFIED",
186 "","","","","","","","","",
187 "","","","","","","","","",
188 "","","","","","","","","",
189 "","","","","","","","","",
190 "","","","","","","","","",
191 "","","","","","","","","",
192 "","","","","","","","","",
193 "","","","","","","","","",
194 "","","","","","","","","",
195 "","","","","","","","","",
196 "","","","","",
197 "DEFINITION",
200 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
202 unsigned int key = hash (str, len);
204 if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
206 const char *s = wordlist[key];
208 if (len == lengthtable[key]
209 && *str == *s && !strcmp (str + 1, s + 1))
210 return s;
213 return 0;