1 /* C code produced by gperf version 3.0.3 */
2 /* Command-line: gperf --output-file atoms.c atoms.gperf */
3 /* Computed positions: -k'3,6,9,$' */
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>."
35 /* Rely on vasprintf (GNU extension) instead of vsnprintf if
47 #line 25 "atoms.gperf"
48 struct atom_map { int name; xcb_atom_t value; };
50 /* maximum key range = 146, duplicates = 0 */
61 register const char *str;
62 register unsigned int len;
64 static const unsigned char asso_values[] =
66 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
67 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
68 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
69 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
70 150, 150, 150, 150, 150, 150, 150, 150, 75, 70,
71 65, 60, 40, 35, 20, 5, 150, 150, 150, 150,
72 150, 150, 150, 150, 150, 35, 0, 45, 15, 0,
73 150, 50, 0, 5, 150, 150, 15, 35, 0, 40,
74 5, 150, 10, 15, 0, 25, 150, 20, 70, 40,
75 55, 150, 150, 150, 150, 15, 150, 150, 150, 150,
76 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
77 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
78 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
79 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
80 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
81 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
82 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
83 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
84 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
85 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
86 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
87 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
88 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
89 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
90 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
91 150, 150, 150, 150, 150, 150
93 register int hval = len;
98 hval += asso_values[(unsigned char)str[8]];
103 hval += asso_values[(unsigned char)str[5]];
108 hval += asso_values[(unsigned char)str[2]];
111 return hval + asso_values[(unsigned char)str[len - 1]];
116 char stringpool_str4[sizeof("FONT")];
117 char stringpool_str6[sizeof("NOTICE")];
118 char stringpool_str9[sizeof("FONT_NAME")];
119 char stringpool_str10[sizeof("POINT")];
120 char stringpool_str11[sizeof("WEIGHT")];
121 char stringpool_str14[sizeof("MIN_SPACE")];
122 char stringpool_str15[sizeof("CAP_HEIGHT")];
123 char stringpool_str16[sizeof("BITMAP")];
124 char stringpool_str17[sizeof("INTEGER")];
125 char stringpool_str19[sizeof("COPYRIGHT")];
126 char stringpool_str24[sizeof("FULL_NAME")];
127 char stringpool_str26[sizeof("STRIKEOUT_ASCENT")];
128 char stringpool_str27[sizeof("STRIKEOUT_DESCENT")];
129 char stringpool_str28[sizeof("RGB_GREEN_MAP")];
130 char stringpool_str29[sizeof("END_SPACE")];
131 char stringpool_str32[sizeof("RGB_BEST_MAP")];
132 char stringpool_str33[sizeof("CARDINAL")];
133 char stringpool_str36[sizeof("CURSOR")];
134 char stringpool_str37[sizeof("WM_CLIENT_MACHINE")];
135 char stringpool_str38[sizeof("WM_HINTS")];
136 char stringpool_str41[sizeof("CUT_BUFFER7")];
137 char stringpool_str42[sizeof("RGB_GRAY_MAP")];
138 char stringpool_str43[sizeof("DRAWABLE")];
139 char stringpool_str45[sizeof("RGB_DEFAULT_MAP")];
140 char stringpool_str46[sizeof("WINDOW")];
141 char stringpool_str47[sizeof("RGB_BLUE_MAP")];
142 char stringpool_str48[sizeof("UNDERLINE_POSITION")];
143 char stringpool_str51[sizeof("RGB_RED_MAP")];
144 char stringpool_str53[sizeof("VISUALID")];
145 char stringpool_str54[sizeof("RECTANGLE")];
146 char stringpool_str56[sizeof("CUT_BUFFER6")];
147 char stringpool_str57[sizeof("WM_NAME")];
148 char stringpool_str58[sizeof("X_HEIGHT")];
149 char stringpool_str61[sizeof("SUBSCRIPT_Y")];
150 char stringpool_str62[sizeof("PRIMARY")];
151 char stringpool_str63[sizeof("COLORMAP")];
152 char stringpool_str64[sizeof("UNDERLINE_THICKNESS")];
153 char stringpool_str65[sizeof("QUAD_WIDTH")];
154 char stringpool_str66[sizeof("RESOURCE_MANAGER")];
155 char stringpool_str67[sizeof("WM_ICON_NAME")];
156 char stringpool_str68[sizeof("RGB_COLOR_MAP")];
157 char stringpool_str70[sizeof("WM_NORMAL_HINTS")];
158 char stringpool_str71[sizeof("CUT_BUFFER5")];
159 char stringpool_str73[sizeof("WM_CLASS")];
160 char stringpool_str75[sizeof("WM_COMMAND")];
161 char stringpool_str76[sizeof("CUT_BUFFER4")];
162 char stringpool_str78[sizeof("SUPERSCRIPT_Y")];
163 char stringpool_str79[sizeof("ATOM")];
164 char stringpool_str80[sizeof("NORM_SPACE")];
165 char stringpool_str81[sizeof("WM_TRANSIENT_FOR")];
166 char stringpool_str82[sizeof("WM_ICON_SIZE")];
167 char stringpool_str83[sizeof("WM_ZOOM_HINTS")];
168 char stringpool_str84[sizeof("MAX_SPACE")];
169 char stringpool_str85[sizeof("POINT_SIZE")];
170 char stringpool_str86[sizeof("PIXMAP")];
171 char stringpool_str90[sizeof("RESOLUTION")];
172 char stringpool_str91[sizeof("SUBSCRIPT_X")];
173 char stringpool_str92[sizeof("ITALIC_ANGLE")];
174 char stringpool_str93[sizeof("ARC")];
175 char stringpool_str96[sizeof("CUT_BUFFER3")];
176 char stringpool_str98[sizeof("WM_SIZE_HINTS")];
177 char stringpool_str101[sizeof("CUT_BUFFER2")];
178 char stringpool_str106[sizeof("CUT_BUFFER1")];
179 char stringpool_str108[sizeof("SUPERSCRIPT_X")];
180 char stringpool_str111[sizeof("CUT_BUFFER0")];
181 char stringpool_str116[sizeof("STRING")];
182 char stringpool_str121[sizeof("FAMILY_NAME")];
183 char stringpool_str149[sizeof("SECONDARY")];
185 static const struct stringpool_t stringpool_contents =
213 "UNDERLINE_POSITION",
223 "UNDERLINE_THICKNESS",
256 #define stringpool ((const char *) &stringpool_contents)
259 #ifdef __GNUC_STDC_INLINE__
260 __attribute__ ((__gnu_inline__))
263 const struct atom_map *
264 in_word_set (str, len)
265 register const char *str;
266 register unsigned int len;
272 MAX_WORD_LENGTH = 19,
277 static const struct atom_map wordlist[] =
279 {-1}, {-1}, {-1}, {-1},
280 #line 44 "atoms.gperf"
281 {(int)(long)&((struct stringpool_t *)0)->stringpool_str4,18},
283 #line 88 "atoms.gperf"
284 {(int)(long)&((struct stringpool_t *)0)->stringpool_str6,62},
286 #line 89 "atoms.gperf"
287 {(int)(long)&((struct stringpool_t *)0)->stringpool_str9,63},
288 #line 47 "atoms.gperf"
289 {(int)(long)&((struct stringpool_t *)0)->stringpool_str10,21},
290 #line 84 "atoms.gperf"
291 {(int)(long)&((struct stringpool_t *)0)->stringpool_str11,58},
293 #line 69 "atoms.gperf"
294 {(int)(long)&((struct stringpool_t *)0)->stringpool_str14,43},
295 #line 92 "atoms.gperf"
296 {(int)(long)&((struct stringpool_t *)0)->stringpool_str15,66},
297 #line 31 "atoms.gperf"
298 {(int)(long)&((struct stringpool_t *)0)->stringpool_str16,5},
299 #line 45 "atoms.gperf"
300 {(int)(long)&((struct stringpool_t *)0)->stringpool_str17,19},
302 #line 87 "atoms.gperf"
303 {(int)(long)&((struct stringpool_t *)0)->stringpool_str19,61},
304 {-1}, {-1}, {-1}, {-1},
305 #line 91 "atoms.gperf"
306 {(int)(long)&((struct stringpool_t *)0)->stringpool_str24,65},
308 #line 79 "atoms.gperf"
309 {(int)(long)&((struct stringpool_t *)0)->stringpool_str26,53},
310 #line 80 "atoms.gperf"
311 {(int)(long)&((struct stringpool_t *)0)->stringpool_str27,54},
312 #line 55 "atoms.gperf"
313 {(int)(long)&((struct stringpool_t *)0)->stringpool_str28,29},
314 #line 72 "atoms.gperf"
315 {(int)(long)&((struct stringpool_t *)0)->stringpool_str29,46},
317 #line 51 "atoms.gperf"
318 {(int)(long)&((struct stringpool_t *)0)->stringpool_str32,25},
319 #line 32 "atoms.gperf"
320 {(int)(long)&((struct stringpool_t *)0)->stringpool_str33,6},
322 #line 34 "atoms.gperf"
323 {(int)(long)&((struct stringpool_t *)0)->stringpool_str36,8},
324 #line 62 "atoms.gperf"
325 {(int)(long)&((struct stringpool_t *)0)->stringpool_str37,36},
326 #line 61 "atoms.gperf"
327 {(int)(long)&((struct stringpool_t *)0)->stringpool_str38,35},
329 #line 42 "atoms.gperf"
330 {(int)(long)&((struct stringpool_t *)0)->stringpool_str41,16},
331 #line 54 "atoms.gperf"
332 {(int)(long)&((struct stringpool_t *)0)->stringpool_str42,28},
333 #line 43 "atoms.gperf"
334 {(int)(long)&((struct stringpool_t *)0)->stringpool_str43,17},
336 #line 53 "atoms.gperf"
337 {(int)(long)&((struct stringpool_t *)0)->stringpool_str45,27},
338 #line 59 "atoms.gperf"
339 {(int)(long)&((struct stringpool_t *)0)->stringpool_str46,33},
340 #line 52 "atoms.gperf"
341 {(int)(long)&((struct stringpool_t *)0)->stringpool_str47,26},
342 #line 77 "atoms.gperf"
343 {(int)(long)&((struct stringpool_t *)0)->stringpool_str48,51},
345 #line 56 "atoms.gperf"
346 {(int)(long)&((struct stringpool_t *)0)->stringpool_str51,30},
348 #line 58 "atoms.gperf"
349 {(int)(long)&((struct stringpool_t *)0)->stringpool_str53,32},
350 #line 48 "atoms.gperf"
351 {(int)(long)&((struct stringpool_t *)0)->stringpool_str54,22},
353 #line 41 "atoms.gperf"
354 {(int)(long)&((struct stringpool_t *)0)->stringpool_str56,15},
355 #line 65 "atoms.gperf"
356 {(int)(long)&((struct stringpool_t *)0)->stringpool_str57,39},
357 #line 82 "atoms.gperf"
358 {(int)(long)&((struct stringpool_t *)0)->stringpool_str58,56},
360 #line 76 "atoms.gperf"
361 {(int)(long)&((struct stringpool_t *)0)->stringpool_str61,50},
362 #line 27 "atoms.gperf"
363 {(int)(long)&((struct stringpool_t *)0)->stringpool_str62,1},
364 #line 33 "atoms.gperf"
365 {(int)(long)&((struct stringpool_t *)0)->stringpool_str63,7},
366 #line 78 "atoms.gperf"
367 {(int)(long)&((struct stringpool_t *)0)->stringpool_str64,52},
368 #line 83 "atoms.gperf"
369 {(int)(long)&((struct stringpool_t *)0)->stringpool_str65,57},
370 #line 49 "atoms.gperf"
371 {(int)(long)&((struct stringpool_t *)0)->stringpool_str66,23},
372 #line 63 "atoms.gperf"
373 {(int)(long)&((struct stringpool_t *)0)->stringpool_str67,37},
374 #line 50 "atoms.gperf"
375 {(int)(long)&((struct stringpool_t *)0)->stringpool_str68,24},
377 #line 66 "atoms.gperf"
378 {(int)(long)&((struct stringpool_t *)0)->stringpool_str70,40},
379 #line 40 "atoms.gperf"
380 {(int)(long)&((struct stringpool_t *)0)->stringpool_str71,14},
382 #line 93 "atoms.gperf"
383 {(int)(long)&((struct stringpool_t *)0)->stringpool_str73,67},
385 #line 60 "atoms.gperf"
386 {(int)(long)&((struct stringpool_t *)0)->stringpool_str75,34},
387 #line 39 "atoms.gperf"
388 {(int)(long)&((struct stringpool_t *)0)->stringpool_str76,13},
390 #line 74 "atoms.gperf"
391 {(int)(long)&((struct stringpool_t *)0)->stringpool_str78,48},
392 #line 30 "atoms.gperf"
393 {(int)(long)&((struct stringpool_t *)0)->stringpool_str79,4},
394 #line 70 "atoms.gperf"
395 {(int)(long)&((struct stringpool_t *)0)->stringpool_str80,44},
396 #line 94 "atoms.gperf"
397 {(int)(long)&((struct stringpool_t *)0)->stringpool_str81,68},
398 #line 64 "atoms.gperf"
399 {(int)(long)&((struct stringpool_t *)0)->stringpool_str82,38},
400 #line 68 "atoms.gperf"
401 {(int)(long)&((struct stringpool_t *)0)->stringpool_str83,42},
402 #line 71 "atoms.gperf"
403 {(int)(long)&((struct stringpool_t *)0)->stringpool_str84,45},
404 #line 85 "atoms.gperf"
405 {(int)(long)&((struct stringpool_t *)0)->stringpool_str85,59},
406 #line 46 "atoms.gperf"
407 {(int)(long)&((struct stringpool_t *)0)->stringpool_str86,20},
409 #line 86 "atoms.gperf"
410 {(int)(long)&((struct stringpool_t *)0)->stringpool_str90,60},
411 #line 75 "atoms.gperf"
412 {(int)(long)&((struct stringpool_t *)0)->stringpool_str91,49},
413 #line 81 "atoms.gperf"
414 {(int)(long)&((struct stringpool_t *)0)->stringpool_str92,55},
415 #line 29 "atoms.gperf"
416 {(int)(long)&((struct stringpool_t *)0)->stringpool_str93,3},
418 #line 38 "atoms.gperf"
419 {(int)(long)&((struct stringpool_t *)0)->stringpool_str96,12},
421 #line 67 "atoms.gperf"
422 {(int)(long)&((struct stringpool_t *)0)->stringpool_str98,41},
424 #line 37 "atoms.gperf"
425 {(int)(long)&((struct stringpool_t *)0)->stringpool_str101,11},
426 {-1}, {-1}, {-1}, {-1},
427 #line 36 "atoms.gperf"
428 {(int)(long)&((struct stringpool_t *)0)->stringpool_str106,10},
430 #line 73 "atoms.gperf"
431 {(int)(long)&((struct stringpool_t *)0)->stringpool_str108,47},
433 #line 35 "atoms.gperf"
434 {(int)(long)&((struct stringpool_t *)0)->stringpool_str111,9},
435 {-1}, {-1}, {-1}, {-1},
436 #line 57 "atoms.gperf"
437 {(int)(long)&((struct stringpool_t *)0)->stringpool_str116,31},
438 {-1}, {-1}, {-1}, {-1},
439 #line 90 "atoms.gperf"
440 {(int)(long)&((struct stringpool_t *)0)->stringpool_str121,64},
441 {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
442 {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
443 {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
444 #line 28 "atoms.gperf"
445 {(int)(long)&((struct stringpool_t *)0)->stringpool_str149,2}
448 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
450 register int key = hash (str, len);
452 if (key <= MAX_HASH_VALUE && key >= 0)
454 register int o = wordlist[key].name;
457 register const char *s = o + stringpool;
459 if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
460 return &wordlist[key];
466 #line 95 "atoms.gperf"
469 static const char atom_names[] =
505 "WM_CLIENT_MACHINE\0"
520 "UNDERLINE_POSITION\0"
521 "UNDERLINE_THICKNESS\0"
523 "STRIKEOUT_DESCENT\0"
540 static const uint16_t atom_name_offsets[] = {
611 xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name)
613 const struct atom_map *value = in_word_set(name, name_len);
614 xcb_atom_t ret = XCB_NONE;
620 const char *xcb_atom_get_name_predefined(xcb_atom_t atom)
622 if(atom <= 0 || atom > (sizeof(atom_name_offsets) / sizeof(*atom_name_offsets)))
624 return atom_names + atom_name_offsets[atom - 1];
627 static char *makename(const char *fmt, ...)
633 #ifndef HAVE_VASPRINTF
637 /* First allocate 'size' bytes, should be enough usually */
638 if((ret = malloc(size)) == NULL)
644 n = vsnprintf(ret, size, fmt, ap);
654 if((np = realloc(ret, size)) == NULL)
664 n = vasprintf(&ret, fmt, ap);
674 char *xcb_atom_name_by_screen(const char *base, uint8_t screen)
676 return makename("%s_S%u", base, screen);
679 char *xcb_atom_name_by_resource(const char *base, uint32_t resource)
681 return makename("%s_R%08X", base, resource);
684 char *xcb_atom_name_unique(const char *base, uint32_t id)
687 return makename("%s_U%lu", base, id);
689 return makename("U%lu", id);