Debian Codegraph @

src/id3_compat.c

raw symbols SCIP
1 /* C code produced by gperf version 3.0.4 */
2 /* Command-line: gperf -tCcTonDE -K id -N _id3_compat_lookup -s -3 -k '*' id3_compat.gperf */
3
4 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
5 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
6 && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
7 && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
8 && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
9 && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
10 && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
11 && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
12 && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
13 && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
14 && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
15 && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
16 && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
17 && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
18 && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
19 && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
20 && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
21 && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
22 && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
23 && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
24 && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
25 && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
26 && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
27 /* The character set is not based on ISO-646. */
28 error "gperf generated tables don't work with this execution character set. Please report a bug to <[email protected]>."
29 #endif
30
31 #line 1 "id3_compat.gperf"
32
33 /*
34 * This program is free software; you can redistribute it and/or modify
35 * it under the terms of the GNU General Public License as published by
36 * the Free Software Foundation; either version 2 of the License, or
37 * (at your option) any later version.
38 *
39 * This program is distributed in the hope that it will be useful,
40 * but WITHOUT ANY WARRANTY; without even the implied warranty of
41 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 * GNU General Public License for more details.
43 *
44 * You should have received a copy of the GNU General Public License
45 * along with this program; if not, write to the Free Software
46 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
47 *
48 * $Id$
49 */
50
51 #define EQ(id) #id
52 #define OBSOLETE 0
53 #define TX(id) #id
54
55 /* maximum key range = 130, duplicates = 0 */
56
57 #ifdef __GNUC__
58 __inline
59 #else
60 #ifdef __cplusplus
61 inline
62 #endif
63 #endif
64 static unsigned int
65 compat_hash (str, len)
66 register const char *str;
67 register unsigned int len;
68 {
69 static const unsigned char asso_values[] =
70 {
71 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
72 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
73 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
74 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
75 131, 131, 131, 131, 131, 131, 131, 131, 131, 89,
76 54, 64, 94, 131, 131, 131, 131, 131, 131, 131,
77 131, 131, 131, 131, 131, 3, 58, 9, 18, 18,
78 57, 1, 4, 21, 59, 52, 11, 0, 47, 26,
79 10, 10, 25, 20, 5, 12, 32, 0, 25, 15,
80 25, 131, 37, 37, 131, 131, 131, 131, 131, 131,
81 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
82 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
83 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
84 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
85 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
86 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
87 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
88 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
89 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
90 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
91 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
92 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
93 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
94 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
95 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
96 131, 131, 131, 131, 131, 131, 131, 131, 131, 131
97 };
98 register int hval = 0;
99
100 switch (len)
101 {
102 default:
103 hval += asso_values[(unsigned char)str[3]];
104 /*FALLTHROUGH*/
105 case 3:
106 hval += asso_values[(unsigned char)str[2]];
107 /*FALLTHROUGH*/
108 case 2:
109 hval += asso_values[(unsigned char)str[1]+4];
110 /*FALLTHROUGH*/
111 case 1:
112 hval += asso_values[(unsigned char)str[0]];
113 break;
114 }
115 return hval;
116 }
117
118 #ifdef __GNUC__
119 __inline
120 #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
121 __attribute__ ((__gnu_inline__))
122 #endif
123 #endif
124 const id3_compat *
125 _id3_compat_lookup (str, len)
126 register const char *str;
127 register unsigned int len;
128 {
129 enum
130 {
131 TOTAL_KEYWORDS = 79,
132 MIN_WORD_LENGTH = 3,
133 MAX_WORD_LENGTH = 4,
134 MIN_HASH_VALUE = 1,
135 MAX_HASH_VALUE = 130
136 };
137
138 static const id3_compat wordlist[] =
139 {
140 #line 107 "id3_compat.gperf"
141 {"WCM", EQ(WCOM) /* Commercial information */},
142 #line 70 "id3_compat.gperf"
143 {"TIM", EQ(TIME) /* Time [obsolete] */},
144 #line 61 "id3_compat.gperf"
145 {"TCM", EQ(TCOM) /* Composer */},
146 #line 113 "id3_compat.gperf"
147 {"TSA", EQ(TSOA) /* non-standard iTunes album sort */},
148 #line 112 "id3_compat.gperf"
149 {"TST", EQ(TSOT) /* non-standard iTunes track sort */},
150 #line 108 "id3_compat.gperf"
151 {"WCP", EQ(WCOP) /* Copyright/legal information */},
152 #line 65 "id3_compat.gperf"
153 {"TDA", EQ(TDAT) /* Date [obsolete] */},
154 #line 86 "id3_compat.gperf"
155 {"TPA", EQ(TPOS) /* Part of a set */},
156 #line 116 "id3_compat.gperf"
157 {"TSC", EQ(TSOC), /* non-standard iTunes composer sort */},
158 #line 114 "id3_compat.gperf"
159 {"TSP", EQ(TSOP) /* non-standard iTunes artist sort */},
160 #line 111 "id3_compat.gperf"
161 {"TCP", EQ(TCMP) /* non-standard iTunes compilation flag */},
162 #line 66 "id3_compat.gperf"
163 {"TDAT", OBSOLETE /* Date [obsolete] */},
164 #line 73 "id3_compat.gperf"
165 {"TLA", EQ(TLAN) /* Language(s) */},
166 #line 52 "id3_compat.gperf"
167 {"PIC", TX(APIC) /* Attached picture */},
168 #line 75 "id3_compat.gperf"
169 {"TMT", EQ(TMED) /* Media type */},
170 #line 51 "id3_compat.gperf"
171 {"MLL", EQ(MLLT) /* MPEG location lookup table */},
172 #line 50 "id3_compat.gperf"
173 {"MCI", EQ(MCDI) /* Music CD identifier */},
174 #line 71 "id3_compat.gperf"
175 {"TIME", OBSOLETE /* Time [obsolete] */},
176 #line 67 "id3_compat.gperf"
177 {"TDY", EQ(TDLY) /* Playlist delay */},
178 #line 94 "id3_compat.gperf"
179 {"TSS", EQ(TSSE) /* Software/hardware and settings used for encoding */},
180 #line 92 "id3_compat.gperf"
181 {"TSI", OBSOLETE /* Size [obsolete] */},
182 #line 103 "id3_compat.gperf"
183 {"ULT", EQ(USLT) /* Unsynchronised lyric/text transcription */},
184 #line 76 "id3_compat.gperf"
185 {"TOA", EQ(TOPE) /* Original artist(s)/performer(s) */},
186 #line 40 "id3_compat.gperf"
187 {"COM", EQ(COMM) /* Comments */},
188 #line 81 "id3_compat.gperf"
189 {"TOT", EQ(TOAL) /* Original album/movie/show title */},
190 #line 64 "id3_compat.gperf"
191 {"TCR", EQ(TCOP) /* Copyright message */},
192 #line 62 "id3_compat.gperf"
193 {"TCO", TX(TCON) /* Content type */},
194 #line 74 "id3_compat.gperf"
195 {"TLE", EQ(TLEN) /* Length */},
196 #line 59 "id3_compat.gperf"
197 {"TAL", EQ(TALB) /* Album/movie/show title */},
198 #line 57 "id3_compat.gperf"
199 {"SLT", EQ(SYLT) /* Synchronised lyric/text */},
200 #line 78 "id3_compat.gperf"
201 {"TOL", EQ(TOLY) /* Original lyricist(s)/text writer(s) */},
202 #line 47 "id3_compat.gperf"
203 {"IPL", EQ(TIPL) /* Involved people list */},
204 #line 106 "id3_compat.gperf"
205 {"WAS", EQ(WOAS) /* Official audio source webpage */},
206 #line 39 "id3_compat.gperf"
207 {"CNT", EQ(PCNT) /* Play counter */},
208 #line 53 "id3_compat.gperf"
209 {"POP", EQ(POPM) /* Popularimeter */},
210 #line 42 "id3_compat.gperf"
211 {"CRM", OBSOLETE /* Encrypted meta frame [obsolete] */},
212 #line 43 "id3_compat.gperf"
213 {"EQU", OBSOLETE /* Equalization [obsolete] */},
214 #line 105 "id3_compat.gperf"
215 {"WAR", EQ(WOAR) /* Official artist/performer webpage */},
216 #line 41 "id3_compat.gperf"
217 {"CRA", EQ(AENC) /* Audio encryption */},
218 #line 44 "id3_compat.gperf"
219 {"EQUA", OBSOLETE /* Equalization [obsolete] */},
220 #line 88 "id3_compat.gperf"
221 {"TRC", EQ(TSRC) /* ISRC (international standard recording code) */},
222 #line 98 "id3_compat.gperf"
223 {"TXT", EQ(TEXT) /* Lyricist/text writer */},
224 #line 46 "id3_compat.gperf"
225 {"GEO", EQ(GEOB) /* General encapsulated object */},
226 #line 72 "id3_compat.gperf"
227 {"TKE", EQ(TKEY) /* Initial key */},
228 #line 79 "id3_compat.gperf"
229 {"TOR", EQ(TDOR) /* Original release year [obsolete] */},
230 #line 93 "id3_compat.gperf"
231 {"TSIZ", OBSOLETE /* Size [obsolete] */},
232 #line 45 "id3_compat.gperf"
233 {"ETC", EQ(ETCO) /* Event timing codes */},
234 #line 55 "id3_compat.gperf"
235 {"RVA", EQ(RVAD) /* Relative volume adjustment [obsolete] */},
236 #line 58 "id3_compat.gperf"
237 {"STC", EQ(SYTC) /* Synchronised tempo codes */},
238 #line 89 "id3_compat.gperf"
239 {"TRD", OBSOLETE /* Recording dates [obsolete] */},
240 #line 48 "id3_compat.gperf"
241 {"IPLS", EQ(TIPL) /* Involved people list */},
242 #line 90 "id3_compat.gperf"
243 {"TRDA", OBSOLETE /* Recording dates [obsolete] */},
244 #line 115 "id3_compat.gperf"
245 {"TS2", EQ(TSO2), /* non-standard iTunes album artist sort */},
246 #line 100 "id3_compat.gperf"
247 {"TYE", EQ(TYER) /* Year [obsolete] */},
248 #line 110 "id3_compat.gperf"
249 {"WXX", EQ(WXXX) /* User defined URL link frame */},
250 #line 109 "id3_compat.gperf"
251 {"WPB", EQ(WPUB) /* Publishers official webpage */},
252 #line 83 "id3_compat.gperf"
253 {"TP2", EQ(TPE2) /* Band/orchestra/accompaniment */},
254 #line 80 "id3_compat.gperf"
255 {"TORY", EQ(TDOR) /* Original release year [obsolete] */},
256 #line 99 "id3_compat.gperf"
257 {"TXX", EQ(TXXX) /* User defined text information frame */},
258 #line 87 "id3_compat.gperf"
259 {"TPB", EQ(TPUB) /* Publisher */},
260 #line 69 "id3_compat.gperf"
261 {"TFT", EQ(TFLT) /* File type */},
262 #line 56 "id3_compat.gperf"
263 {"RVAD", OBSOLETE /* Relative volume adjustment [obsolete] */},
264 #line 60 "id3_compat.gperf"
265 {"TBP", EQ(TBPM) /* BPM (beats per minute) */},
266 #line 68 "id3_compat.gperf"
267 {"TEN", EQ(TENC) /* Encoded by */},
268 #line 84 "id3_compat.gperf"
269 {"TP3", EQ(TPE3) /* Conductor/performer refinement */},
270 #line 104 "id3_compat.gperf"
271 {"WAF", EQ(WOAF) /* Official audio file webpage */},
272 #line 54 "id3_compat.gperf"
273 {"REV", EQ(RVRB) /* Reverb */},
274 #line 63 "id3_compat.gperf"
275 {"TCON", TX(TCON) /* Content type */},
276 #line 77 "id3_compat.gperf"
277 {"TOF", EQ(TOFN) /* Original filename */},
278 #line 96 "id3_compat.gperf"
279 {"TT2", EQ(TIT2) /* Title/songname/content description */},
280 #line 101 "id3_compat.gperf"
281 {"TYER", OBSOLETE /* Year [obsolete] */},
282 #line 49 "id3_compat.gperf"
283 {"LNK", EQ(LINK) /* Linked information */},
284 #line 91 "id3_compat.gperf"
285 {"TRK", EQ(TRCK) /* Track number/position in set */},
286 #line 102 "id3_compat.gperf"
287 {"UFI", EQ(UFID) /* Unique file identifier */},
288 #line 97 "id3_compat.gperf"
289 {"TT3", EQ(TIT3) /* Subtitle/description refinement */},
290 #line 82 "id3_compat.gperf"
291 {"TP1", EQ(TPE1) /* Lead performer(s)/soloist(s) */},
292 #line 85 "id3_compat.gperf"
293 {"TP4", EQ(TPE4) /* Interpreted, remixed, or otherwise modified by */},
294 #line 95 "id3_compat.gperf"
295 {"TT1", EQ(TIT1) /* Content group description */},
296 #line 38 "id3_compat.gperf"
297 {"BUF", EQ(RBUF) /* Recommended buffer size */}
298 };
299
300 static const short lookup[] =
301 {
302 -1, 0, -1, -1, -1, 1, 2, -1, 3, -1, 4, 5, 6, 7,
303 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
304 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
305 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
306 -1, 50, 51, 52, 53, -1, 54, 55, 56, 57, -1, 58, 59, 60,
307 -1, 61, 62, 63, 64, 65, -1, -1, 66, 67, -1, -1, 68, -1,
308 69, 70, -1, -1, 71, 72, -1, -1, 73, -1, 74, -1, -1, -1,
309 -1, 75, -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, -1, -1,
310 -1, -1, -1, -1, -1, -1, -1, 77, -1, -1, -1, -1, -1, -1,
311 -1, -1, -1, -1, 78
312 };
313
314 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
315 {
316 register int key = compat_hash (str, len);
317
318 if (key <= MAX_HASH_VALUE && key >= 0)
319 {
320 register int index = lookup[key];
321
322 if (index >= 0)
323 {
324 register const char *s = wordlist[index].id;
325
326 if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
327 return &wordlist[index];
328 }
329 }
330 }
331 return 0;
332 }
333 #line 117 "id3_compat.gperf"
334