atoms.c   atoms.c 
skipping to change at line 46 skipping to change at line 46
#ifdef HAVE_VASPRINTF #ifdef HAVE_VASPRINTF
#define _GNU_SOURCE #define _GNU_SOURCE
#include <stdio.h> #include <stdio.h>
#endif #endif
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include "xcb_atom.h" #include "xcb_atom.h"
const xcb_atom_t PRIMARY = 1; #line 25 "atoms.gperf"
const xcb_atom_t SECONDARY = 2;
const xcb_atom_t ARC = 3;
const xcb_atom_t ATOM = 4;
const xcb_atom_t BITMAP = 5;
const xcb_atom_t CARDINAL = 6;
const xcb_atom_t COLORMAP = 7;
const xcb_atom_t CURSOR = 8;
const xcb_atom_t CUT_BUFFER0 = 9;
const xcb_atom_t CUT_BUFFER1 = 10;
const xcb_atom_t CUT_BUFFER2 = 11;
const xcb_atom_t CUT_BUFFER3 = 12;
const xcb_atom_t CUT_BUFFER4 = 13;
const xcb_atom_t CUT_BUFFER5 = 14;
const xcb_atom_t CUT_BUFFER6 = 15;
const xcb_atom_t CUT_BUFFER7 = 16;
const xcb_atom_t DRAWABLE = 17;
const xcb_atom_t FONT = 18;
const xcb_atom_t INTEGER = 19;
const xcb_atom_t PIXMAP = 20;
const xcb_atom_t POINT = 21;
const xcb_atom_t RECTANGLE = 22;
const xcb_atom_t RESOURCE_MANAGER = 23;
const xcb_atom_t RGB_COLOR_MAP = 24;
const xcb_atom_t RGB_BEST_MAP = 25;
const xcb_atom_t RGB_BLUE_MAP = 26;
const xcb_atom_t RGB_DEFAULT_MAP = 27;
const xcb_atom_t RGB_GRAY_MAP = 28;
const xcb_atom_t RGB_GREEN_MAP = 29;
const xcb_atom_t RGB_RED_MAP = 30;
const xcb_atom_t STRING = 31;
const xcb_atom_t VISUALID = 32;
const xcb_atom_t WINDOW = 33;
const xcb_atom_t WM_COMMAND = 34;
const xcb_atom_t WM_HINTS = 35;
const xcb_atom_t WM_CLIENT_MACHINE = 36;
const xcb_atom_t WM_ICON_NAME = 37;
const xcb_atom_t WM_ICON_SIZE = 38;
const xcb_atom_t WM_NAME = 39;
const xcb_atom_t WM_NORMAL_HINTS = 40;
const xcb_atom_t WM_SIZE_HINTS = 41;
const xcb_atom_t WM_ZOOM_HINTS = 42;
const xcb_atom_t MIN_SPACE = 43;
const xcb_atom_t NORM_SPACE = 44;
const xcb_atom_t MAX_SPACE = 45;
const xcb_atom_t END_SPACE = 46;
const xcb_atom_t SUPERSCRIPT_X = 47;
const xcb_atom_t SUPERSCRIPT_Y = 48;
const xcb_atom_t SUBSCRIPT_X = 49;
const xcb_atom_t SUBSCRIPT_Y = 50;
const xcb_atom_t UNDERLINE_POSITION = 51;
const xcb_atom_t UNDERLINE_THICKNESS = 52;
const xcb_atom_t STRIKEOUT_ASCENT = 53;
const xcb_atom_t STRIKEOUT_DESCENT = 54;
const xcb_atom_t ITALIC_ANGLE = 55;
const xcb_atom_t X_HEIGHT = 56;
const xcb_atom_t QUAD_WIDTH = 57;
const xcb_atom_t WEIGHT = 58;
const xcb_atom_t POINT_SIZE = 59;
const xcb_atom_t RESOLUTION = 60;
const xcb_atom_t COPYRIGHT = 61;
const xcb_atom_t NOTICE = 62;
const xcb_atom_t FONT_NAME = 63;
const xcb_atom_t FAMILY_NAME = 64;
const xcb_atom_t FULL_NAME = 65;
const xcb_atom_t CAP_HEIGHT = 66;
const xcb_atom_t WM_CLASS = 67;
const xcb_atom_t WM_TRANSIENT_FOR = 68;
#line 93 "atoms.gperf"
struct atom_map { int name; xcb_atom_t value; }; struct atom_map { int name; xcb_atom_t value; };
#include <string.h> #include <string.h>
/* maximum key range = 146, duplicates = 0 */ /* maximum key range = 146, duplicates = 0 */
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#else #else
#ifdef __cplusplus #ifdef __cplusplus
inline inline
#endif #endif
skipping to change at line 347 skipping to change at line 279
TOTAL_KEYWORDS = 68, TOTAL_KEYWORDS = 68,
MIN_WORD_LENGTH = 3, MIN_WORD_LENGTH = 3,
MAX_WORD_LENGTH = 19, MAX_WORD_LENGTH = 19,
MIN_HASH_VALUE = 4, MIN_HASH_VALUE = 4,
MAX_HASH_VALUE = 149 MAX_HASH_VALUE = 149
}; };
static const struct atom_map wordlist[] = static const struct atom_map wordlist[] =
{ {
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 112 "atoms.gperf" #line 44 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str4,18}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str4,18},
{-1}, {-1},
#line 156 "atoms.gperf" #line 88 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6,62}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str6,62},
{-1}, {-1}, {-1}, {-1},
#line 157 "atoms.gperf" #line 89 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str9,63}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str9,63},
#line 115 "atoms.gperf" #line 47 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10,21}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str10,21},
#line 152 "atoms.gperf" #line 84 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11,58}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str11,58},
{-1}, {-1}, {-1}, {-1},
#line 137 "atoms.gperf" #line 69 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14,43}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str14,43},
#line 160 "atoms.gperf" #line 92 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15,66}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str15,66},
#line 99 "atoms.gperf" #line 31 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16,5}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str16,5},
#line 113 "atoms.gperf" #line 45 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17,19}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str17,19},
{-1}, {-1},
#line 155 "atoms.gperf" #line 87 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19,61}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str19,61},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 159 "atoms.gperf" #line 91 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str24,65}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str24,65},
{-1}, {-1},
#line 147 "atoms.gperf" #line 79 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str26,53}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str26,53},
#line 148 "atoms.gperf" #line 80 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str27,54}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str27,54},
#line 123 "atoms.gperf" #line 55 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str28,29}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str28,29},
#line 140 "atoms.gperf" #line 72 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str29,46}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str29,46},
{-1}, {-1}, {-1}, {-1},
#line 119 "atoms.gperf" #line 51 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str32,25}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str32,25},
#line 100 "atoms.gperf" #line 32 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str33,6}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str33,6},
{-1}, {-1}, {-1}, {-1},
#line 102 "atoms.gperf" #line 34 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str36,8}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str36,8},
#line 130 "atoms.gperf" #line 62 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str37,36}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str37,36},
#line 129 "atoms.gperf" #line 61 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str38,35}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str38,35},
{-1}, {-1}, {-1}, {-1},
#line 110 "atoms.gperf" #line 42 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str41,16}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str41,16},
#line 122 "atoms.gperf" #line 54 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str42,28}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str42,28},
#line 111 "atoms.gperf" #line 43 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str43,17}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str43,17},
{-1}, {-1},
#line 121 "atoms.gperf" #line 53 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str45,27}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str45,27},
#line 127 "atoms.gperf" #line 59 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str46,33}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str46,33},
#line 120 "atoms.gperf" #line 52 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str47,26}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str47,26},
#line 145 "atoms.gperf" #line 77 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str48,51}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str48,51},
{-1}, {-1}, {-1}, {-1},
#line 124 "atoms.gperf" #line 56 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str51,30}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str51,30},
{-1}, {-1},
#line 126 "atoms.gperf" #line 58 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str53,32}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str53,32},
#line 116 "atoms.gperf" #line 48 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str54,22}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str54,22},
{-1}, {-1},
#line 109 "atoms.gperf" #line 41 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str56,15}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str56,15},
#line 133 "atoms.gperf" #line 65 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str57,39}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str57,39},
#line 150 "atoms.gperf" #line 82 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str58,56}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str58,56},
{-1}, {-1}, {-1}, {-1},
#line 144 "atoms.gperf" #line 76 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str61,50}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str61,50},
#line 95 "atoms.gperf" #line 27 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str62,1}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str62,1},
#line 101 "atoms.gperf" #line 33 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str63,7}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str63,7},
#line 146 "atoms.gperf" #line 78 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str64,52}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str64,52},
#line 151 "atoms.gperf" #line 83 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str65,57}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str65,57},
#line 117 "atoms.gperf" #line 49 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str66,23}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str66,23},
#line 131 "atoms.gperf" #line 63 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str67,37}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str67,37},
#line 118 "atoms.gperf" #line 50 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str68,24}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str68,24},
{-1}, {-1},
#line 134 "atoms.gperf" #line 66 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str70,40}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str70,40},
#line 108 "atoms.gperf" #line 40 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str71,14}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str71,14},
{-1}, {-1},
#line 161 "atoms.gperf" #line 93 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str73,67}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str73,67},
{-1}, {-1},
#line 128 "atoms.gperf" #line 60 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str75,34}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str75,34},
#line 107 "atoms.gperf" #line 39 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str76,13}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str76,13},
{-1}, {-1},
#line 142 "atoms.gperf" #line 74 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str78,48}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str78,48},
#line 98 "atoms.gperf" #line 30 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str79,4}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str79,4},
#line 138 "atoms.gperf" #line 70 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str80,44}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str80,44},
#line 162 "atoms.gperf" #line 94 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str81,68}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str81,68},
#line 132 "atoms.gperf" #line 64 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str82,38}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str82,38},
#line 136 "atoms.gperf" #line 68 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str83,42}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str83,42},
#line 139 "atoms.gperf" #line 71 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str84,45}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str84,45},
#line 153 "atoms.gperf" #line 85 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str85,59}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str85,59},
#line 114 "atoms.gperf" #line 46 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str86,20}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str86,20},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 154 "atoms.gperf" #line 86 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str90,60}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str90,60},
#line 143 "atoms.gperf" #line 75 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str91,49}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str91,49},
#line 149 "atoms.gperf" #line 81 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str92,55}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str92,55},
#line 97 "atoms.gperf" #line 29 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str93,3}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str93,3},
{-1}, {-1}, {-1}, {-1},
#line 106 "atoms.gperf" #line 38 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str96,12}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str96,12},
{-1}, {-1},
#line 135 "atoms.gperf" #line 67 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str98,41}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str98,41},
{-1}, {-1}, {-1}, {-1},
#line 105 "atoms.gperf" #line 37 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str101,11}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str101,11},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 104 "atoms.gperf" #line 36 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str106,10}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str106,10},
{-1}, {-1},
#line 141 "atoms.gperf" #line 73 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str108,47}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str108,47},
{-1}, {-1}, {-1}, {-1},
#line 103 "atoms.gperf" #line 35 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str111,9}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str111,9},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 125 "atoms.gperf" #line 57 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str116,31}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str116,31},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 158 "atoms.gperf" #line 90 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str121,64}, {(int)(long)&((struct stringpool_t *)0)->stringpool_str121,64},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 96 "atoms.gperf" #line 28 "atoms.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str149,2} {(int)(long)&((struct stringpool_t *)0)->stringpool_str149,2}
}; };
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{ {
register int key = hash (str, len); register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0) if (key <= MAX_HASH_VALUE && key >= 0)
{ {
register int o = wordlist[key].name; register int o = wordlist[key].name;
skipping to change at line 533 skipping to change at line 465
{ {
register const char *s = o + stringpool; register const char *s = o + stringpool;
if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len ] == '\0') if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len ] == '\0')
return &wordlist[key]; return &wordlist[key];
} }
} }
} }
return 0; return 0;
} }
#line 163 "atoms.gperf" #line 95 "atoms.gperf"
static const char atom_names[] = static const char atom_names[] =
"PRIMARY\0" "PRIMARY\0"
"SECONDARY\0" "SECONDARY\0"
"ARC\0" "ARC\0"
"ATOM\0" "ATOM\0"
"BITMAP\0" "BITMAP\0"
"CARDINAL\0" "CARDINAL\0"
"COLORMAP\0" "COLORMAP\0"
"CURSOR\0" "CURSOR\0"
skipping to change at line 677 skipping to change at line 609
680, 680,
690, 690,
697, 697,
707, 707,
719, 719,
729, 729,
740, 740,
749, 749,
}; };
xcb_atom_t xcb_atom_get(xcb_connection_t *connection, const char *atom_name
)
{
if(atom_name == NULL)
return XCB_NONE;
xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(connection,
xcb_intern_atom(connection, 0, strlen(atom_name), atom_name)
, NULL);
if(!reply)
return XCB_NONE;
xcb_atom_t atom = reply->atom;
free(reply);
return atom;
}
xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name) xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name)
{ {
const struct atom_map *value = in_word_set(name, name_len); const struct atom_map *value = in_word_set(name, name_len);
xcb_atom_t ret = XCB_NONE; xcb_atom_t ret = XCB_NONE;
if(value) if(value)
ret = value->value; ret = value->value;
return ret; return ret;
} }
xcb_atom_fast_cookie_t xcb_atom_get_fast(xcb_connection_t *c, uint8_t only_
if_exists, uint16_t name_len, const char *name)
{
xcb_atom_fast_cookie_t cookie;
if((cookie.u.atom = xcb_atom_get_predefined(name_len, name)) != XCB_
NONE)
{
cookie.tag = TAG_VALUE;
return cookie;
}
cookie.tag = TAG_COOKIE;
cookie.u.cookie = xcb_intern_atom(c, only_if_exists, name_len, name)
;
return cookie;
}
xcb_atom_t xcb_atom_get_fast_reply(xcb_connection_t *c, xcb_atom_fast_cooki
e_t cookie, xcb_generic_error_t **e)
{
switch(cookie.tag)
{
xcb_intern_atom_reply_t *reply;
case TAG_VALUE:
if(e)
*e = 0;
break;
case TAG_COOKIE:
reply = xcb_intern_atom_reply(c, cookie.u.cookie, e);
if(reply)
{
cookie.u.atom = reply->atom;
free(reply);
}
else
cookie.u.atom = XCB_NONE;
break;
}
return cookie.u.atom;
}
const char *xcb_atom_get_name_predefined(xcb_atom_t atom) const char *xcb_atom_get_name_predefined(xcb_atom_t atom)
{ {
if(atom <= 0 || atom > (sizeof(atom_name_offsets) / sizeof(*atom_nam e_offsets))) if(atom <= 0 || atom > (sizeof(atom_name_offsets) / sizeof(*atom_nam e_offsets)))
return 0; return 0;
return atom_names + atom_name_offsets[atom - 1]; return atom_names + atom_name_offsets[atom - 1];
} }
int xcb_atom_get_name(xcb_connection_t *c, xcb_atom_t atom, const char **na
mep, int *lengthp)
{
static char buf[100];
const char *name = xcb_atom_get_name_predefined(atom);
int namelen;
xcb_get_atom_name_cookie_t atomc;
xcb_get_atom_name_reply_t *atomr;
if(name)
{
*namep = name;
*lengthp = strlen(name);
return 1;
}
atomc = xcb_get_atom_name(c, atom);
atomr = xcb_get_atom_name_reply(c, atomc, 0);
if(!atomr)
return 0;
namelen = xcb_get_atom_name_name_length(atomr);
if(namelen > sizeof(buf))
namelen = sizeof(buf);
*lengthp = namelen;
memcpy(buf, xcb_get_atom_name_name(atomr), namelen);
*namep = buf;
free(atomr);
return 1;
}
static char *makename(const char *fmt, ...) static char *makename(const char *fmt, ...)
{ {
char *ret; char *ret;
int n; int n;
va_list ap; va_list ap;
#ifndef HAVE_VASPRINTF #ifndef HAVE_VASPRINTF
char *np; char *np;
int size = 64; int size = 64;
 End of changes. 73 change blocks. 
223 lines changed or deleted 70 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/