• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* C code produced by gperf version 3.0.1 */
2 /* Command-line: gperf -G -C gperf/csp13inttags.gperf  */
3 /* Computed positions: -k'1,11' */
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 error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
30 #endif
31 
32 #line 1 "gperf/csp13inttags.gperf"
33 
34 /*
35  * Copyright (C) 2007 Esmertec AG.
36  * Copyright (C) 2007 The Android Open Source Project
37  *
38  * Licensed under the Apache License, Version 2.0 (the "License");
39  * you may not use this file except in compliance with the License.
40  * You may obtain a copy of the License at
41  *
42  *     http://www.apache.org/licenses/LICENSE-2.0
43  *
44  * Unless required by applicable law or agreed to in writing, software
45  * distributed under the License is distributed on an "AS IS" BASIS,
46  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47  * See the License for the specific language governing permissions and
48  * limitations under the License.
49  */
50 
51 #include <string.h>
52 #include "csp13_hash.h"
53 
54 
55 #define TOTAL_KEYWORDS 34
56 #define MIN_WORD_LENGTH 4
57 #define MAX_WORD_LENGTH 25
58 #define MIN_HASH_VALUE 4
59 #define MAX_HASH_VALUE 45
60 /* maximum key range = 42, duplicates = 0 */
61 
62 #ifdef __GNUC__
63 __inline
64 #else
65 #ifdef __cplusplus
66 inline
67 #endif
68 #endif
69 static unsigned int
hash(str,len)70 hash (str, len)
71      register const char *str;
72      register unsigned int len;
73 {
74   static const unsigned char asso_values[] =
75     {
76       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
77       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
78       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
79       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
80       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
81       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
82       46, 46, 46, 46, 46,  5, 46,  0, 46, 46,
83       46, 25, 25, 46, 46, 20, 15,  0, 46, 46,
84        5, 46, 46,  5, 20, 15,  0, 25, 46, 46,
85       46, 46, 46, 46, 46, 46, 46, 15, 46, 15,
86       46,  5, 46, 46, 20,  5, 46, 46, 10,  5,
87        0,  0, 46, 46, 46,  5, 20, 46, 46, 46,
88        5, 46, 46, 46, 46, 46, 46, 46, 46, 46,
89       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
90       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
91       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
92       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
93       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
94       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
95       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
96       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
97       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
98       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
99       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
100       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
101       46, 46, 46, 46, 46, 46
102     };
103   register int hval = len;
104 
105   switch (hval)
106     {
107       default:
108         hval += asso_values[(unsigned char)str[10]];
109       /*FALLTHROUGH*/
110       case 10:
111       case 9:
112       case 8:
113       case 7:
114       case 6:
115       case 5:
116       case 4:
117       case 3:
118       case 2:
119       case 1:
120         hval += asso_values[(unsigned char)str[0]];
121         break;
122     }
123   return hval;
124 }
125 
126 static const char * const wordlist[] =
127   {
128     "", "", "", "",
129     "Code",
130     "", "", "",
131     "Validity",
132     "",
133     "MultiTrans",
134     "PairID",
135     "MessageCount",
136     "",
137     "ChosenOptionID",
138     "ParserSize",
139     "ContentSize",
140     "SegmentCount",
141     "ServerPollMin",
142     "AnswerOptionID",
143     "SessionPriority",
144     "SearchIndex",
145     "UDPPort",
146     "ContentPolicyLimit",
147     "SearchFindings",
148     "MultiTransPerMessage",
149     "SegmentReference",
150     "TCPPort",
151     "AcceptedPushLength",
152     "MaxWatcherList",
153     "TimeToLive",
154     "UserSessionLimit",
155     "MessageTotalCount",
156     "AcceptedPullLength",
157     "",
158     "AcceptedTextContentLength",
159     "SearchLimit",
160     "WatcherCount",
161     "KeepAliveTime",
162     "",
163     "TryAgainTimeout",
164     "PlainTextCharSet",
165     "GroupContentLimit",
166     "HistoryPeriod",
167     "",
168     "AcceptedRichContentLength"
169   };
170 
171 #ifdef __GNUC__
172 __inline
173 #endif
174 const char *
in_word_set(str,len)175 in_word_set (str, len)
176      register const char *str;
177      register unsigned int len;
178 {
179   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
180     {
181       register int key = hash (str, len);
182 
183       if (key <= MAX_HASH_VALUE && key >= 0)
184         {
185           register const char *s = wordlist[key];
186 
187           if (*str == *s && !strcmp (str + 1, s + 1))
188             return s;
189         }
190     }
191   return 0;
192 }
193 #line 58 "gperf/csp13inttags.gperf"
194 
195 
csp13IsIntegerTag(const char * str)196 int csp13IsIntegerTag(const char * str)
197 {
198     const char * s = in_word_set(str, strlen(str));
199     return s ? 1 : 0;
200 }
201 
202