1/* ANSI-C code produced by gperf version 3.0.4 */
2/* Command-line: gperf daap_query.gperf  */
3/* Computed positions: -k'10-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/* maximum key range = 51, duplicates = 0 */
33
34#ifdef __GNUC__
35__inline
36#else
37#ifdef __cplusplus
38inline
39#endif
40#endif
41static unsigned int
42daap_query_field_hash (register const char *str, register unsigned int len)
43{
44  static const unsigned char asso_values[] =
45    {
46      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
47      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
48      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
49      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
50      62, 62, 62, 62, 62, 62, 25, 62, 62, 62,
51      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
52      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
53      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
54      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
55      62, 62, 62, 62, 62, 62, 62,  5,  0, 10,
56       0,  5,  5, 10, 62,  0, 62, 62, 20, 62,
57      20, 10, 62, 62,  0,  0, 15, 62, 62, 62,
58      62, 15, 62, 62, 62, 62, 62, 62, 62, 62,
59      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
60      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
61      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
63      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
64      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
65      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
66      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
67      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
68      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
69      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
70      62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
71      62, 62, 62, 62, 62, 62
72    };
73  return len + asso_values[(unsigned char)str[10]] + asso_values[(unsigned char)str[9]];
74}
75
76#ifdef __GNUC__
77__inline
78#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
79__attribute__ ((__gnu_inline__))
80#endif
81#endif
82const struct dmap_query_field_map *
83daap_query_field_lookup (register const char *str, register unsigned int len)
84{
85  enum
86    {
87      TOTAL_KEYWORDS = 29,
88      MIN_WORD_LENGTH = 11,
89      MAX_WORD_LENGTH = 36,
90      MIN_HASH_VALUE = 11,
91      MAX_HASH_VALUE = 61
92    };
93
94  static const struct dmap_query_field_map wordlist[] =
95    {
96#line 14 "daap_query.gperf"
97      {"dmap.itemid",                "f.id",               1},
98#line 33 "daap_query.gperf"
99      {"daap.songsize",              "f.file_size",        1},
100#line 19 "daap_query.gperf"
101      {"daap.songbitrate",           "f.bitrate",          1},
102#line 28 "daap_query.gperf"
103      {"daap.songdisccount",         "f.total_discs",      1},
104#line 29 "daap_query.gperf"
105      {"daap.songdiscnumber",        "f.disc",             1},
106#line 17 "daap_query.gperf"
107      {"daap.songartist",            "f.artist",           0},
108#line 24 "daap_query.gperf"
109      {"daap.songdataurl",           "f.url",              0},
110#line 23 "daap_query.gperf"
111      {"daap.songdatakind",          "f.data_kind",        1},
112#line 25 "daap_query.gperf"
113      {"daap.songdateadded",         "f.time_added",       1},
114#line 32 "daap_query.gperf"
115      {"daap.songsamplerate",        "f.samplerate",       1},
116#line 27 "daap_query.gperf"
117      {"daap.songdescription",       "f.description",      0},
118#line 26 "daap_query.gperf"
119      {"daap.songdatemodified",      "f.time_modified",    1},
120#line 35 "daap_query.gperf"
121      {"daap.songtime",              "f.song_length",      1},
122#line 31 "daap_query.gperf"
123      {"daap.songgenre",             "f.genre",            0},
124#line 30 "daap_query.gperf"
125      {"daap.songformat",            "f.type",             0},
126#line 34 "daap_query.gperf"
127      {"daap.songstoptime",          "f.song_length",      1},
128#line 38 "daap_query.gperf"
129      {"daap.songyear",              "f.year",             1},
130#line 36 "daap_query.gperf"
131      {"daap.songtrackcount",        "f.total_tracks",     1},
132#line 37 "daap_query.gperf"
133      {"daap.songtracknumber",       "f.track",            1},
134#line 20 "daap_query.gperf"
135      {"daap.songcomment",           "f.comment",          0},
136#line 22 "daap_query.gperf"
137      {"daap.songcomposer",          "f.composer",         0},
138#line 13 "daap_query.gperf"
139      {"dmap.itemname",              "f.title",            0},
140#line 15 "daap_query.gperf"
141      {"daap.songalbum",             "f.album",            0},
142#line 21 "daap_query.gperf"
143      {"daap.songcompilation",       "f.compilation",      1},
144#line 16 "daap_query.gperf"
145      {"daap.songalbumid",           "f.songalbumid",      1},
146#line 18 "daap_query.gperf"
147      {"daap.songalbumartist",       "f.album_artist",     0},
148#line 41 "daap_query.gperf"
149      {"com.apple.itunes.extended", "f.media_kind",       1},
150#line 39 "daap_query.gperf"
151      {"com.apple.itunes.mediakind", "f.media_kind",       1},
152#line 40 "daap_query.gperf"
153      {"com.apple.itunes.extended-media-kind", "f.media_kind",       1}
154    };
155
156  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
157    {
158      register int key = daap_query_field_hash (str, len);
159
160      if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
161        {
162          register const struct dmap_query_field_map *resword;
163
164          switch (key - 11)
165            {
166              case 0:
167                if (len == 11)
168                  {
169                    resword = &wordlist[0];
170                    goto compare;
171                  }
172                break;
173              case 2:
174                if (len == 13)
175                  {
176                    resword = &wordlist[1];
177                    goto compare;
178                  }
179                break;
180              case 5:
181                if (len == 16)
182                  {
183                    resword = &wordlist[2];
184                    goto compare;
185                  }
186                break;
187              case 7:
188                if (len == 18)
189                  {
190                    resword = &wordlist[3];
191                    goto compare;
192                  }
193                break;
194              case 8:
195                if (len == 19)
196                  {
197                    resword = &wordlist[4];
198                    goto compare;
199                  }
200                break;
201              case 9:
202                if (len == 15)
203                  {
204                    resword = &wordlist[5];
205                    goto compare;
206                  }
207                break;
208              case 10:
209                if (len == 16)
210                  {
211                    resword = &wordlist[6];
212                    goto compare;
213                  }
214                break;
215              case 11:
216                if (len == 17)
217                  {
218                    resword = &wordlist[7];
219                    goto compare;
220                  }
221                break;
222              case 12:
223                if (len == 18)
224                  {
225                    resword = &wordlist[8];
226                    goto compare;
227                  }
228                break;
229              case 13:
230                if (len == 19)
231                  {
232                    resword = &wordlist[9];
233                    goto compare;
234                  }
235                break;
236              case 14:
237                if (len == 20)
238                  {
239                    resword = &wordlist[10];
240                    goto compare;
241                  }
242                break;
243              case 15:
244                if (len == 21)
245                  {
246                    resword = &wordlist[11];
247                    goto compare;
248                  }
249                break;
250              case 17:
251                if (len == 13)
252                  {
253                    resword = &wordlist[12];
254                    goto compare;
255                  }
256                break;
257              case 18:
258                if (len == 14)
259                  {
260                    resword = &wordlist[13];
261                    goto compare;
262                  }
263                break;
264              case 19:
265                if (len == 15)
266                  {
267                    resword = &wordlist[14];
268                    goto compare;
269                  }
270                break;
271              case 21:
272                if (len == 17)
273                  {
274                    resword = &wordlist[15];
275                    goto compare;
276                  }
277                break;
278              case 22:
279                if (len == 13)
280                  {
281                    resword = &wordlist[16];
282                    goto compare;
283                  }
284                break;
285              case 23:
286                if (len == 19)
287                  {
288                    resword = &wordlist[17];
289                    goto compare;
290                  }
291                break;
292              case 24:
293                if (len == 20)
294                  {
295                    resword = &wordlist[18];
296                    goto compare;
297                  }
298                break;
299              case 25:
300                if (len == 16)
301                  {
302                    resword = &wordlist[19];
303                    goto compare;
304                  }
305                break;
306              case 26:
307                if (len == 17)
308                  {
309                    resword = &wordlist[20];
310                    goto compare;
311                  }
312                break;
313              case 27:
314                if (len == 13)
315                  {
316                    resword = &wordlist[21];
317                    goto compare;
318                  }
319                break;
320              case 28:
321                if (len == 14)
322                  {
323                    resword = &wordlist[22];
324                    goto compare;
325                  }
326                break;
327              case 29:
328                if (len == 20)
329                  {
330                    resword = &wordlist[23];
331                    goto compare;
332                  }
333                break;
334              case 30:
335                if (len == 16)
336                  {
337                    resword = &wordlist[24];
338                    goto compare;
339                  }
340                break;
341              case 34:
342                if (len == 20)
343                  {
344                    resword = &wordlist[25];
345                    goto compare;
346                  }
347                break;
348              case 39:
349                if (len == 25)
350                  {
351                    resword = &wordlist[26];
352                    goto compare;
353                  }
354                break;
355              case 40:
356                if (len == 26)
357                  {
358                    resword = &wordlist[27];
359                    goto compare;
360                  }
361                break;
362              case 50:
363                if (len == 36)
364                  {
365                    resword = &wordlist[28];
366                    goto compare;
367                  }
368                break;
369            }
370          return 0;
371        compare:
372          {
373            register const char *s = resword->dmap_field;
374
375            if (*str == *s && !memcmp (str + 1, s + 1, len - 1))
376              return resword;
377          }
378        }
379    }
380  return 0;
381}
382