Home | History | Annotate | Line # | Download | only in files
xkb.c revision 1.3.4.1
      1 /*
      2  * This file generated automatically from xkb.xml by c_client.py.
      3  * Edit at your peril.
      4  */
      5 
      6 #ifdef HAVE_CONFIG_H
      7 #include "config.h"
      8 #endif
      9 #include <stdlib.h>
     10 #include <string.h>
     11 #include <assert.h>
     12 #include <stddef.h>  /* for offsetof() */
     13 #include "xcbext.h"
     14 #include "xkb.h"
     15 
     16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
     17 #include "xproto.h"
     18 
     19 xcb_extension_t xcb_xkb_id = { "XKEYBOARD", 0 };
     20 
     21 void
     22 xcb_xkb_device_spec_next (xcb_xkb_device_spec_iterator_t *i)
     23 {
     24     --i->rem;
     25     ++i->data;
     26     i->index += sizeof(xcb_xkb_device_spec_t);
     27 }
     28 
     29 xcb_generic_iterator_t
     30 xcb_xkb_device_spec_end (xcb_xkb_device_spec_iterator_t i)
     31 {
     32     xcb_generic_iterator_t ret;
     33     ret.data = i.data + i.rem;
     34     ret.index = i.index + ((char *) ret.data - (char *) i.data);
     35     ret.rem = 0;
     36     return ret;
     37 }
     38 
     39 void
     40 xcb_xkb_led_class_spec_next (xcb_xkb_led_class_spec_iterator_t *i)
     41 {
     42     --i->rem;
     43     ++i->data;
     44     i->index += sizeof(xcb_xkb_led_class_spec_t);
     45 }
     46 
     47 xcb_generic_iterator_t
     48 xcb_xkb_led_class_spec_end (xcb_xkb_led_class_spec_iterator_t i)
     49 {
     50     xcb_generic_iterator_t ret;
     51     ret.data = i.data + i.rem;
     52     ret.index = i.index + ((char *) ret.data - (char *) i.data);
     53     ret.rem = 0;
     54     return ret;
     55 }
     56 
     57 void
     58 xcb_xkb_bell_class_spec_next (xcb_xkb_bell_class_spec_iterator_t *i)
     59 {
     60     --i->rem;
     61     ++i->data;
     62     i->index += sizeof(xcb_xkb_bell_class_spec_t);
     63 }
     64 
     65 xcb_generic_iterator_t
     66 xcb_xkb_bell_class_spec_end (xcb_xkb_bell_class_spec_iterator_t i)
     67 {
     68     xcb_generic_iterator_t ret;
     69     ret.data = i.data + i.rem;
     70     ret.index = i.index + ((char *) ret.data - (char *) i.data);
     71     ret.rem = 0;
     72     return ret;
     73 }
     74 
     75 void
     76 xcb_xkb_id_spec_next (xcb_xkb_id_spec_iterator_t *i)
     77 {
     78     --i->rem;
     79     ++i->data;
     80     i->index += sizeof(xcb_xkb_id_spec_t);
     81 }
     82 
     83 xcb_generic_iterator_t
     84 xcb_xkb_id_spec_end (xcb_xkb_id_spec_iterator_t i)
     85 {
     86     xcb_generic_iterator_t ret;
     87     ret.data = i.data + i.rem;
     88     ret.index = i.index + ((char *) ret.data - (char *) i.data);
     89     ret.rem = 0;
     90     return ret;
     91 }
     92 
     93 void
     94 xcb_xkb_indicator_map_next (xcb_xkb_indicator_map_iterator_t *i)
     95 {
     96     --i->rem;
     97     ++i->data;
     98     i->index += sizeof(xcb_xkb_indicator_map_t);
     99 }
    100 
    101 xcb_generic_iterator_t
    102 xcb_xkb_indicator_map_end (xcb_xkb_indicator_map_iterator_t i)
    103 {
    104     xcb_generic_iterator_t ret;
    105     ret.data = i.data + i.rem;
    106     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    107     ret.rem = 0;
    108     return ret;
    109 }
    110 
    111 void
    112 xcb_xkb_mod_def_next (xcb_xkb_mod_def_iterator_t *i)
    113 {
    114     --i->rem;
    115     ++i->data;
    116     i->index += sizeof(xcb_xkb_mod_def_t);
    117 }
    118 
    119 xcb_generic_iterator_t
    120 xcb_xkb_mod_def_end (xcb_xkb_mod_def_iterator_t i)
    121 {
    122     xcb_generic_iterator_t ret;
    123     ret.data = i.data + i.rem;
    124     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    125     ret.rem = 0;
    126     return ret;
    127 }
    128 
    129 void
    130 xcb_xkb_key_name_next (xcb_xkb_key_name_iterator_t *i)
    131 {
    132     --i->rem;
    133     ++i->data;
    134     i->index += sizeof(xcb_xkb_key_name_t);
    135 }
    136 
    137 xcb_generic_iterator_t
    138 xcb_xkb_key_name_end (xcb_xkb_key_name_iterator_t i)
    139 {
    140     xcb_generic_iterator_t ret;
    141     ret.data = i.data + i.rem;
    142     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    143     ret.rem = 0;
    144     return ret;
    145 }
    146 
    147 void
    148 xcb_xkb_key_alias_next (xcb_xkb_key_alias_iterator_t *i)
    149 {
    150     --i->rem;
    151     ++i->data;
    152     i->index += sizeof(xcb_xkb_key_alias_t);
    153 }
    154 
    155 xcb_generic_iterator_t
    156 xcb_xkb_key_alias_end (xcb_xkb_key_alias_iterator_t i)
    157 {
    158     xcb_generic_iterator_t ret;
    159     ret.data = i.data + i.rem;
    160     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    161     ret.rem = 0;
    162     return ret;
    163 }
    164 
    165 int
    166 xcb_xkb_counted_string_16_sizeof (const void  *_buffer)
    167 {
    168     char *xcb_tmp = (char *)_buffer;
    169     const xcb_xkb_counted_string_16_t *_aux = (xcb_xkb_counted_string_16_t *)_buffer;
    170     unsigned int xcb_buffer_len = 0;
    171     unsigned int xcb_block_len = 0;
    172     unsigned int xcb_pad = 0;
    173     unsigned int xcb_align_to = 0;
    174 
    175 
    176     xcb_block_len += sizeof(xcb_xkb_counted_string_16_t);
    177     xcb_tmp += xcb_block_len;
    178     xcb_buffer_len += xcb_block_len;
    179     xcb_block_len = 0;
    180     /* string */
    181     xcb_block_len += _aux->length * sizeof(char);
    182     xcb_tmp += xcb_block_len;
    183     xcb_align_to = ALIGNOF(char);
    184     /* insert padding */
    185     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    186     xcb_buffer_len += xcb_block_len + xcb_pad;
    187     if (0 != xcb_pad) {
    188         xcb_tmp += xcb_pad;
    189         xcb_pad = 0;
    190     }
    191     xcb_block_len = 0;
    192     /* alignment_pad */
    193     xcb_block_len += (((_aux->length + 5) & (~3)) - (_aux->length + 2)) * sizeof(char);
    194     xcb_tmp += xcb_block_len;
    195     xcb_align_to = ALIGNOF(char);
    196     /* insert padding */
    197     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    198     xcb_buffer_len += xcb_block_len + xcb_pad;
    199     if (0 != xcb_pad) {
    200         xcb_tmp += xcb_pad;
    201         xcb_pad = 0;
    202     }
    203     xcb_block_len = 0;
    204 
    205     return xcb_buffer_len;
    206 }
    207 
    208 char *
    209 xcb_xkb_counted_string_16_string (const xcb_xkb_counted_string_16_t *R)
    210 {
    211     return (char *) (R + 1);
    212 }
    213 
    214 int
    215 xcb_xkb_counted_string_16_string_length (const xcb_xkb_counted_string_16_t *R)
    216 {
    217     return R->length;
    218 }
    219 
    220 xcb_generic_iterator_t
    221 xcb_xkb_counted_string_16_string_end (const xcb_xkb_counted_string_16_t *R)
    222 {
    223     xcb_generic_iterator_t i;
    224     i.data = ((char *) (R + 1)) + (R->length);
    225     i.rem = 0;
    226     i.index = (char *) i.data - (char *) R;
    227     return i;
    228 }
    229 
    230 void *
    231 xcb_xkb_counted_string_16_alignment_pad (const xcb_xkb_counted_string_16_t *R)
    232 {
    233     xcb_generic_iterator_t prev = xcb_xkb_counted_string_16_string_end(R);
    234     return (void *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
    235 }
    236 
    237 int
    238 xcb_xkb_counted_string_16_alignment_pad_length (const xcb_xkb_counted_string_16_t *R)
    239 {
    240     return (((R->length + 5) & (~3)) - (R->length + 2));
    241 }
    242 
    243 xcb_generic_iterator_t
    244 xcb_xkb_counted_string_16_alignment_pad_end (const xcb_xkb_counted_string_16_t *R)
    245 {
    246     xcb_generic_iterator_t i;
    247     xcb_generic_iterator_t prev = xcb_xkb_counted_string_16_string_end(R);
    248     i.data = ((char *) ((char*) prev.data + XCB_TYPE_PAD(char, prev.index))) + ((((R->length + 5) & (~3)) - (R->length + 2)));
    249     i.rem = 0;
    250     i.index = (char *) i.data - (char *) R;
    251     return i;
    252 }
    253 
    254 void
    255 xcb_xkb_counted_string_16_next (xcb_xkb_counted_string_16_iterator_t *i)
    256 {
    257     xcb_xkb_counted_string_16_t *R = i->data;
    258     xcb_generic_iterator_t child;
    259     child.data = (xcb_xkb_counted_string_16_t *)(((char *)R) + xcb_xkb_counted_string_16_sizeof(R));
    260     i->index = (char *) child.data - (char *) i->data;
    261     --i->rem;
    262     i->data = (xcb_xkb_counted_string_16_t *) child.data;
    263 }
    264 
    265 xcb_generic_iterator_t
    266 xcb_xkb_counted_string_16_end (xcb_xkb_counted_string_16_iterator_t i)
    267 {
    268     xcb_generic_iterator_t ret;
    269     while(i.rem > 0)
    270         xcb_xkb_counted_string_16_next(&i);
    271     ret.data = i.data;
    272     ret.rem = i.rem;
    273     ret.index = i.index;
    274     return ret;
    275 }
    276 
    277 void
    278 xcb_xkb_kt_map_entry_next (xcb_xkb_kt_map_entry_iterator_t *i)
    279 {
    280     --i->rem;
    281     ++i->data;
    282     i->index += sizeof(xcb_xkb_kt_map_entry_t);
    283 }
    284 
    285 xcb_generic_iterator_t
    286 xcb_xkb_kt_map_entry_end (xcb_xkb_kt_map_entry_iterator_t i)
    287 {
    288     xcb_generic_iterator_t ret;
    289     ret.data = i.data + i.rem;
    290     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    291     ret.rem = 0;
    292     return ret;
    293 }
    294 
    295 int
    296 xcb_xkb_key_type_sizeof (const void  *_buffer)
    297 {
    298     char *xcb_tmp = (char *)_buffer;
    299     const xcb_xkb_key_type_t *_aux = (xcb_xkb_key_type_t *)_buffer;
    300     unsigned int xcb_buffer_len = 0;
    301     unsigned int xcb_block_len = 0;
    302     unsigned int xcb_pad = 0;
    303     unsigned int xcb_align_to = 0;
    304 
    305 
    306     xcb_block_len += sizeof(xcb_xkb_key_type_t);
    307     xcb_tmp += xcb_block_len;
    308     xcb_buffer_len += xcb_block_len;
    309     xcb_block_len = 0;
    310     /* map */
    311     xcb_block_len += _aux->nMapEntries * sizeof(xcb_xkb_kt_map_entry_t);
    312     xcb_tmp += xcb_block_len;
    313     xcb_align_to = ALIGNOF(xcb_xkb_kt_map_entry_t);
    314     /* insert padding */
    315     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    316     xcb_buffer_len += xcb_block_len + xcb_pad;
    317     if (0 != xcb_pad) {
    318         xcb_tmp += xcb_pad;
    319         xcb_pad = 0;
    320     }
    321     xcb_block_len = 0;
    322     /* preserve */
    323     xcb_block_len += (_aux->hasPreserve * _aux->nMapEntries) * sizeof(xcb_xkb_mod_def_t);
    324     xcb_tmp += xcb_block_len;
    325     xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t);
    326     /* insert padding */
    327     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    328     xcb_buffer_len += xcb_block_len + xcb_pad;
    329     if (0 != xcb_pad) {
    330         xcb_tmp += xcb_pad;
    331         xcb_pad = 0;
    332     }
    333     xcb_block_len = 0;
    334 
    335     return xcb_buffer_len;
    336 }
    337 
    338 xcb_xkb_kt_map_entry_t *
    339 xcb_xkb_key_type_map (const xcb_xkb_key_type_t *R)
    340 {
    341     return (xcb_xkb_kt_map_entry_t *) (R + 1);
    342 }
    343 
    344 int
    345 xcb_xkb_key_type_map_length (const xcb_xkb_key_type_t *R)
    346 {
    347     return R->nMapEntries;
    348 }
    349 
    350 xcb_xkb_kt_map_entry_iterator_t
    351 xcb_xkb_key_type_map_iterator (const xcb_xkb_key_type_t *R)
    352 {
    353     xcb_xkb_kt_map_entry_iterator_t i;
    354     i.data = (xcb_xkb_kt_map_entry_t *) (R + 1);
    355     i.rem = R->nMapEntries;
    356     i.index = (char *) i.data - (char *) R;
    357     return i;
    358 }
    359 
    360 xcb_xkb_mod_def_t *
    361 xcb_xkb_key_type_preserve (const xcb_xkb_key_type_t *R)
    362 {
    363     xcb_generic_iterator_t prev = xcb_xkb_kt_map_entry_end(xcb_xkb_key_type_map_iterator(R));
    364     return (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index) + 0);
    365 }
    366 
    367 int
    368 xcb_xkb_key_type_preserve_length (const xcb_xkb_key_type_t *R)
    369 {
    370     return (R->hasPreserve * R->nMapEntries);
    371 }
    372 
    373 xcb_xkb_mod_def_iterator_t
    374 xcb_xkb_key_type_preserve_iterator (const xcb_xkb_key_type_t *R)
    375 {
    376     xcb_xkb_mod_def_iterator_t i;
    377     xcb_generic_iterator_t prev = xcb_xkb_kt_map_entry_end(xcb_xkb_key_type_map_iterator(R));
    378     i.data = (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index));
    379     i.rem = (R->hasPreserve * R->nMapEntries);
    380     i.index = (char *) i.data - (char *) R;
    381     return i;
    382 }
    383 
    384 void
    385 xcb_xkb_key_type_next (xcb_xkb_key_type_iterator_t *i)
    386 {
    387     xcb_xkb_key_type_t *R = i->data;
    388     xcb_generic_iterator_t child;
    389     child.data = (xcb_xkb_key_type_t *)(((char *)R) + xcb_xkb_key_type_sizeof(R));
    390     i->index = (char *) child.data - (char *) i->data;
    391     --i->rem;
    392     i->data = (xcb_xkb_key_type_t *) child.data;
    393 }
    394 
    395 xcb_generic_iterator_t
    396 xcb_xkb_key_type_end (xcb_xkb_key_type_iterator_t i)
    397 {
    398     xcb_generic_iterator_t ret;
    399     while(i.rem > 0)
    400         xcb_xkb_key_type_next(&i);
    401     ret.data = i.data;
    402     ret.rem = i.rem;
    403     ret.index = i.index;
    404     return ret;
    405 }
    406 
    407 int
    408 xcb_xkb_key_sym_map_sizeof (const void  *_buffer)
    409 {
    410     char *xcb_tmp = (char *)_buffer;
    411     const xcb_xkb_key_sym_map_t *_aux = (xcb_xkb_key_sym_map_t *)_buffer;
    412     unsigned int xcb_buffer_len = 0;
    413     unsigned int xcb_block_len = 0;
    414     unsigned int xcb_pad = 0;
    415     unsigned int xcb_align_to = 0;
    416 
    417 
    418     xcb_block_len += sizeof(xcb_xkb_key_sym_map_t);
    419     xcb_tmp += xcb_block_len;
    420     xcb_buffer_len += xcb_block_len;
    421     xcb_block_len = 0;
    422     /* syms */
    423     xcb_block_len += _aux->nSyms * sizeof(xcb_keysym_t);
    424     xcb_tmp += xcb_block_len;
    425     xcb_align_to = ALIGNOF(xcb_keysym_t);
    426     /* insert padding */
    427     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    428     xcb_buffer_len += xcb_block_len + xcb_pad;
    429     if (0 != xcb_pad) {
    430         xcb_tmp += xcb_pad;
    431         xcb_pad = 0;
    432     }
    433     xcb_block_len = 0;
    434 
    435     return xcb_buffer_len;
    436 }
    437 
    438 xcb_keysym_t *
    439 xcb_xkb_key_sym_map_syms (const xcb_xkb_key_sym_map_t *R)
    440 {
    441     return (xcb_keysym_t *) (R + 1);
    442 }
    443 
    444 int
    445 xcb_xkb_key_sym_map_syms_length (const xcb_xkb_key_sym_map_t *R)
    446 {
    447     return R->nSyms;
    448 }
    449 
    450 xcb_generic_iterator_t
    451 xcb_xkb_key_sym_map_syms_end (const xcb_xkb_key_sym_map_t *R)
    452 {
    453     xcb_generic_iterator_t i;
    454     i.data = ((xcb_keysym_t *) (R + 1)) + (R->nSyms);
    455     i.rem = 0;
    456     i.index = (char *) i.data - (char *) R;
    457     return i;
    458 }
    459 
    460 void
    461 xcb_xkb_key_sym_map_next (xcb_xkb_key_sym_map_iterator_t *i)
    462 {
    463     xcb_xkb_key_sym_map_t *R = i->data;
    464     xcb_generic_iterator_t child;
    465     child.data = (xcb_xkb_key_sym_map_t *)(((char *)R) + xcb_xkb_key_sym_map_sizeof(R));
    466     i->index = (char *) child.data - (char *) i->data;
    467     --i->rem;
    468     i->data = (xcb_xkb_key_sym_map_t *) child.data;
    469 }
    470 
    471 xcb_generic_iterator_t
    472 xcb_xkb_key_sym_map_end (xcb_xkb_key_sym_map_iterator_t i)
    473 {
    474     xcb_generic_iterator_t ret;
    475     while(i.rem > 0)
    476         xcb_xkb_key_sym_map_next(&i);
    477     ret.data = i.data;
    478     ret.rem = i.rem;
    479     ret.index = i.index;
    480     return ret;
    481 }
    482 
    483 void
    484 xcb_xkb_common_behavior_next (xcb_xkb_common_behavior_iterator_t *i)
    485 {
    486     --i->rem;
    487     ++i->data;
    488     i->index += sizeof(xcb_xkb_common_behavior_t);
    489 }
    490 
    491 xcb_generic_iterator_t
    492 xcb_xkb_common_behavior_end (xcb_xkb_common_behavior_iterator_t i)
    493 {
    494     xcb_generic_iterator_t ret;
    495     ret.data = i.data + i.rem;
    496     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    497     ret.rem = 0;
    498     return ret;
    499 }
    500 
    501 void
    502 xcb_xkb_default_behavior_next (xcb_xkb_default_behavior_iterator_t *i)
    503 {
    504     --i->rem;
    505     ++i->data;
    506     i->index += sizeof(xcb_xkb_default_behavior_t);
    507 }
    508 
    509 xcb_generic_iterator_t
    510 xcb_xkb_default_behavior_end (xcb_xkb_default_behavior_iterator_t i)
    511 {
    512     xcb_generic_iterator_t ret;
    513     ret.data = i.data + i.rem;
    514     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    515     ret.rem = 0;
    516     return ret;
    517 }
    518 
    519 void
    520 xcb_xkb_lock_behavior_next (xcb_xkb_lock_behavior_iterator_t *i)
    521 {
    522     --i->rem;
    523     ++i->data;
    524     i->index += sizeof(xcb_xkb_lock_behavior_t);
    525 }
    526 
    527 xcb_generic_iterator_t
    528 xcb_xkb_lock_behavior_end (xcb_xkb_lock_behavior_iterator_t i)
    529 {
    530     xcb_generic_iterator_t ret;
    531     ret.data = i.data + i.rem;
    532     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    533     ret.rem = 0;
    534     return ret;
    535 }
    536 
    537 void
    538 xcb_xkb_radio_group_behavior_next (xcb_xkb_radio_group_behavior_iterator_t *i)
    539 {
    540     --i->rem;
    541     ++i->data;
    542     i->index += sizeof(xcb_xkb_radio_group_behavior_t);
    543 }
    544 
    545 xcb_generic_iterator_t
    546 xcb_xkb_radio_group_behavior_end (xcb_xkb_radio_group_behavior_iterator_t i)
    547 {
    548     xcb_generic_iterator_t ret;
    549     ret.data = i.data + i.rem;
    550     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    551     ret.rem = 0;
    552     return ret;
    553 }
    554 
    555 void
    556 xcb_xkb_overlay_behavior_next (xcb_xkb_overlay_behavior_iterator_t *i)
    557 {
    558     --i->rem;
    559     ++i->data;
    560     i->index += sizeof(xcb_xkb_overlay_behavior_t);
    561 }
    562 
    563 xcb_generic_iterator_t
    564 xcb_xkb_overlay_behavior_end (xcb_xkb_overlay_behavior_iterator_t i)
    565 {
    566     xcb_generic_iterator_t ret;
    567     ret.data = i.data + i.rem;
    568     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    569     ret.rem = 0;
    570     return ret;
    571 }
    572 
    573 void
    574 xcb_xkb_permament_lock_behavior_next (xcb_xkb_permament_lock_behavior_iterator_t *i)
    575 {
    576     --i->rem;
    577     ++i->data;
    578     i->index += sizeof(xcb_xkb_permament_lock_behavior_t);
    579 }
    580 
    581 xcb_generic_iterator_t
    582 xcb_xkb_permament_lock_behavior_end (xcb_xkb_permament_lock_behavior_iterator_t i)
    583 {
    584     xcb_generic_iterator_t ret;
    585     ret.data = i.data + i.rem;
    586     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    587     ret.rem = 0;
    588     return ret;
    589 }
    590 
    591 void
    592 xcb_xkb_permament_radio_group_behavior_next (xcb_xkb_permament_radio_group_behavior_iterator_t *i)
    593 {
    594     --i->rem;
    595     ++i->data;
    596     i->index += sizeof(xcb_xkb_permament_radio_group_behavior_t);
    597 }
    598 
    599 xcb_generic_iterator_t
    600 xcb_xkb_permament_radio_group_behavior_end (xcb_xkb_permament_radio_group_behavior_iterator_t i)
    601 {
    602     xcb_generic_iterator_t ret;
    603     ret.data = i.data + i.rem;
    604     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    605     ret.rem = 0;
    606     return ret;
    607 }
    608 
    609 void
    610 xcb_xkb_permament_overlay_behavior_next (xcb_xkb_permament_overlay_behavior_iterator_t *i)
    611 {
    612     --i->rem;
    613     ++i->data;
    614     i->index += sizeof(xcb_xkb_permament_overlay_behavior_t);
    615 }
    616 
    617 xcb_generic_iterator_t
    618 xcb_xkb_permament_overlay_behavior_end (xcb_xkb_permament_overlay_behavior_iterator_t i)
    619 {
    620     xcb_generic_iterator_t ret;
    621     ret.data = i.data + i.rem;
    622     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    623     ret.rem = 0;
    624     return ret;
    625 }
    626 
    627 void
    628 xcb_xkb_behavior_next (xcb_xkb_behavior_iterator_t *i)
    629 {
    630     --i->rem;
    631     ++i->data;
    632     i->index += sizeof(xcb_xkb_behavior_t);
    633 }
    634 
    635 xcb_generic_iterator_t
    636 xcb_xkb_behavior_end (xcb_xkb_behavior_iterator_t i)
    637 {
    638     xcb_generic_iterator_t ret;
    639     ret.data = i.data + i.rem;
    640     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    641     ret.rem = 0;
    642     return ret;
    643 }
    644 
    645 void
    646 xcb_xkb_set_behavior_next (xcb_xkb_set_behavior_iterator_t *i)
    647 {
    648     --i->rem;
    649     ++i->data;
    650     i->index += sizeof(xcb_xkb_set_behavior_t);
    651 }
    652 
    653 xcb_generic_iterator_t
    654 xcb_xkb_set_behavior_end (xcb_xkb_set_behavior_iterator_t i)
    655 {
    656     xcb_generic_iterator_t ret;
    657     ret.data = i.data + i.rem;
    658     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    659     ret.rem = 0;
    660     return ret;
    661 }
    662 
    663 void
    664 xcb_xkb_set_explicit_next (xcb_xkb_set_explicit_iterator_t *i)
    665 {
    666     --i->rem;
    667     ++i->data;
    668     i->index += sizeof(xcb_xkb_set_explicit_t);
    669 }
    670 
    671 xcb_generic_iterator_t
    672 xcb_xkb_set_explicit_end (xcb_xkb_set_explicit_iterator_t i)
    673 {
    674     xcb_generic_iterator_t ret;
    675     ret.data = i.data + i.rem;
    676     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    677     ret.rem = 0;
    678     return ret;
    679 }
    680 
    681 void
    682 xcb_xkb_key_mod_map_next (xcb_xkb_key_mod_map_iterator_t *i)
    683 {
    684     --i->rem;
    685     ++i->data;
    686     i->index += sizeof(xcb_xkb_key_mod_map_t);
    687 }
    688 
    689 xcb_generic_iterator_t
    690 xcb_xkb_key_mod_map_end (xcb_xkb_key_mod_map_iterator_t i)
    691 {
    692     xcb_generic_iterator_t ret;
    693     ret.data = i.data + i.rem;
    694     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    695     ret.rem = 0;
    696     return ret;
    697 }
    698 
    699 void
    700 xcb_xkb_key_v_mod_map_next (xcb_xkb_key_v_mod_map_iterator_t *i)
    701 {
    702     --i->rem;
    703     ++i->data;
    704     i->index += sizeof(xcb_xkb_key_v_mod_map_t);
    705 }
    706 
    707 xcb_generic_iterator_t
    708 xcb_xkb_key_v_mod_map_end (xcb_xkb_key_v_mod_map_iterator_t i)
    709 {
    710     xcb_generic_iterator_t ret;
    711     ret.data = i.data + i.rem;
    712     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    713     ret.rem = 0;
    714     return ret;
    715 }
    716 
    717 void
    718 xcb_xkb_kt_set_map_entry_next (xcb_xkb_kt_set_map_entry_iterator_t *i)
    719 {
    720     --i->rem;
    721     ++i->data;
    722     i->index += sizeof(xcb_xkb_kt_set_map_entry_t);
    723 }
    724 
    725 xcb_generic_iterator_t
    726 xcb_xkb_kt_set_map_entry_end (xcb_xkb_kt_set_map_entry_iterator_t i)
    727 {
    728     xcb_generic_iterator_t ret;
    729     ret.data = i.data + i.rem;
    730     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    731     ret.rem = 0;
    732     return ret;
    733 }
    734 
    735 int
    736 xcb_xkb_set_key_type_sizeof (const void  *_buffer)
    737 {
    738     char *xcb_tmp = (char *)_buffer;
    739     const xcb_xkb_set_key_type_t *_aux = (xcb_xkb_set_key_type_t *)_buffer;
    740     unsigned int xcb_buffer_len = 0;
    741     unsigned int xcb_block_len = 0;
    742     unsigned int xcb_pad = 0;
    743     unsigned int xcb_align_to = 0;
    744 
    745 
    746     xcb_block_len += sizeof(xcb_xkb_set_key_type_t);
    747     xcb_tmp += xcb_block_len;
    748     xcb_buffer_len += xcb_block_len;
    749     xcb_block_len = 0;
    750     /* entries */
    751     xcb_block_len += _aux->nMapEntries * sizeof(xcb_xkb_kt_set_map_entry_t);
    752     xcb_tmp += xcb_block_len;
    753     xcb_align_to = ALIGNOF(xcb_xkb_kt_set_map_entry_t);
    754     /* insert padding */
    755     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    756     xcb_buffer_len += xcb_block_len + xcb_pad;
    757     if (0 != xcb_pad) {
    758         xcb_tmp += xcb_pad;
    759         xcb_pad = 0;
    760     }
    761     xcb_block_len = 0;
    762     /* preserve_entries */
    763     xcb_block_len += (_aux->preserve * _aux->nMapEntries) * sizeof(xcb_xkb_kt_set_map_entry_t);
    764     xcb_tmp += xcb_block_len;
    765     xcb_align_to = ALIGNOF(xcb_xkb_kt_set_map_entry_t);
    766     /* insert padding */
    767     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    768     xcb_buffer_len += xcb_block_len + xcb_pad;
    769     if (0 != xcb_pad) {
    770         xcb_tmp += xcb_pad;
    771         xcb_pad = 0;
    772     }
    773     xcb_block_len = 0;
    774 
    775     return xcb_buffer_len;
    776 }
    777 
    778 xcb_xkb_kt_set_map_entry_t *
    779 xcb_xkb_set_key_type_entries (const xcb_xkb_set_key_type_t *R)
    780 {
    781     return (xcb_xkb_kt_set_map_entry_t *) (R + 1);
    782 }
    783 
    784 int
    785 xcb_xkb_set_key_type_entries_length (const xcb_xkb_set_key_type_t *R)
    786 {
    787     return R->nMapEntries;
    788 }
    789 
    790 xcb_xkb_kt_set_map_entry_iterator_t
    791 xcb_xkb_set_key_type_entries_iterator (const xcb_xkb_set_key_type_t *R)
    792 {
    793     xcb_xkb_kt_set_map_entry_iterator_t i;
    794     i.data = (xcb_xkb_kt_set_map_entry_t *) (R + 1);
    795     i.rem = R->nMapEntries;
    796     i.index = (char *) i.data - (char *) R;
    797     return i;
    798 }
    799 
    800 xcb_xkb_kt_set_map_entry_t *
    801 xcb_xkb_set_key_type_preserve_entries (const xcb_xkb_set_key_type_t *R)
    802 {
    803     xcb_generic_iterator_t prev = xcb_xkb_kt_set_map_entry_end(xcb_xkb_set_key_type_entries_iterator(R));
    804     return (xcb_xkb_kt_set_map_entry_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_kt_set_map_entry_t, prev.index) + 0);
    805 }
    806 
    807 int
    808 xcb_xkb_set_key_type_preserve_entries_length (const xcb_xkb_set_key_type_t *R)
    809 {
    810     return (R->preserve * R->nMapEntries);
    811 }
    812 
    813 xcb_xkb_kt_set_map_entry_iterator_t
    814 xcb_xkb_set_key_type_preserve_entries_iterator (const xcb_xkb_set_key_type_t *R)
    815 {
    816     xcb_xkb_kt_set_map_entry_iterator_t i;
    817     xcb_generic_iterator_t prev = xcb_xkb_kt_set_map_entry_end(xcb_xkb_set_key_type_entries_iterator(R));
    818     i.data = (xcb_xkb_kt_set_map_entry_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_kt_set_map_entry_t, prev.index));
    819     i.rem = (R->preserve * R->nMapEntries);
    820     i.index = (char *) i.data - (char *) R;
    821     return i;
    822 }
    823 
    824 void
    825 xcb_xkb_set_key_type_next (xcb_xkb_set_key_type_iterator_t *i)
    826 {
    827     xcb_xkb_set_key_type_t *R = i->data;
    828     xcb_generic_iterator_t child;
    829     child.data = (xcb_xkb_set_key_type_t *)(((char *)R) + xcb_xkb_set_key_type_sizeof(R));
    830     i->index = (char *) child.data - (char *) i->data;
    831     --i->rem;
    832     i->data = (xcb_xkb_set_key_type_t *) child.data;
    833 }
    834 
    835 xcb_generic_iterator_t
    836 xcb_xkb_set_key_type_end (xcb_xkb_set_key_type_iterator_t i)
    837 {
    838     xcb_generic_iterator_t ret;
    839     while(i.rem > 0)
    840         xcb_xkb_set_key_type_next(&i);
    841     ret.data = i.data;
    842     ret.rem = i.rem;
    843     ret.index = i.index;
    844     return ret;
    845 }
    846 
    847 void
    848 xcb_xkb_string8_next (xcb_xkb_string8_iterator_t *i)
    849 {
    850     --i->rem;
    851     ++i->data;
    852     i->index += sizeof(xcb_xkb_string8_t);
    853 }
    854 
    855 xcb_generic_iterator_t
    856 xcb_xkb_string8_end (xcb_xkb_string8_iterator_t i)
    857 {
    858     xcb_generic_iterator_t ret;
    859     ret.data = i.data + i.rem;
    860     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    861     ret.rem = 0;
    862     return ret;
    863 }
    864 
    865 int
    866 xcb_xkb_outline_sizeof (const void  *_buffer)
    867 {
    868     char *xcb_tmp = (char *)_buffer;
    869     const xcb_xkb_outline_t *_aux = (xcb_xkb_outline_t *)_buffer;
    870     unsigned int xcb_buffer_len = 0;
    871     unsigned int xcb_block_len = 0;
    872     unsigned int xcb_pad = 0;
    873     unsigned int xcb_align_to = 0;
    874 
    875 
    876     xcb_block_len += sizeof(xcb_xkb_outline_t);
    877     xcb_tmp += xcb_block_len;
    878     xcb_buffer_len += xcb_block_len;
    879     xcb_block_len = 0;
    880     /* points */
    881     xcb_block_len += _aux->nPoints * sizeof(xcb_point_t);
    882     xcb_tmp += xcb_block_len;
    883     xcb_align_to = ALIGNOF(xcb_point_t);
    884     /* insert padding */
    885     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    886     xcb_buffer_len += xcb_block_len + xcb_pad;
    887     if (0 != xcb_pad) {
    888         xcb_tmp += xcb_pad;
    889         xcb_pad = 0;
    890     }
    891     xcb_block_len = 0;
    892 
    893     return xcb_buffer_len;
    894 }
    895 
    896 xcb_point_t *
    897 xcb_xkb_outline_points (const xcb_xkb_outline_t *R)
    898 {
    899     return (xcb_point_t *) (R + 1);
    900 }
    901 
    902 int
    903 xcb_xkb_outline_points_length (const xcb_xkb_outline_t *R)
    904 {
    905     return R->nPoints;
    906 }
    907 
    908 xcb_point_iterator_t
    909 xcb_xkb_outline_points_iterator (const xcb_xkb_outline_t *R)
    910 {
    911     xcb_point_iterator_t i;
    912     i.data = (xcb_point_t *) (R + 1);
    913     i.rem = R->nPoints;
    914     i.index = (char *) i.data - (char *) R;
    915     return i;
    916 }
    917 
    918 void
    919 xcb_xkb_outline_next (xcb_xkb_outline_iterator_t *i)
    920 {
    921     xcb_xkb_outline_t *R = i->data;
    922     xcb_generic_iterator_t child;
    923     child.data = (xcb_xkb_outline_t *)(((char *)R) + xcb_xkb_outline_sizeof(R));
    924     i->index = (char *) child.data - (char *) i->data;
    925     --i->rem;
    926     i->data = (xcb_xkb_outline_t *) child.data;
    927 }
    928 
    929 xcb_generic_iterator_t
    930 xcb_xkb_outline_end (xcb_xkb_outline_iterator_t i)
    931 {
    932     xcb_generic_iterator_t ret;
    933     while(i.rem > 0)
    934         xcb_xkb_outline_next(&i);
    935     ret.data = i.data;
    936     ret.rem = i.rem;
    937     ret.index = i.index;
    938     return ret;
    939 }
    940 
    941 int
    942 xcb_xkb_shape_sizeof (const void  *_buffer)
    943 {
    944     char *xcb_tmp = (char *)_buffer;
    945     const xcb_xkb_shape_t *_aux = (xcb_xkb_shape_t *)_buffer;
    946     unsigned int xcb_buffer_len = 0;
    947     unsigned int xcb_block_len = 0;
    948     unsigned int xcb_pad = 0;
    949     unsigned int xcb_align_to = 0;
    950 
    951     unsigned int i;
    952     unsigned int xcb_tmp_len;
    953 
    954     xcb_block_len += sizeof(xcb_xkb_shape_t);
    955     xcb_tmp += xcb_block_len;
    956     xcb_buffer_len += xcb_block_len;
    957     xcb_block_len = 0;
    958     /* outlines */
    959     for(i=0; i<_aux->nOutlines; i++) {
    960         xcb_tmp_len = xcb_xkb_outline_sizeof(xcb_tmp);
    961         xcb_block_len += xcb_tmp_len;
    962         xcb_tmp += xcb_tmp_len;
    963     }
    964     xcb_align_to = ALIGNOF(xcb_xkb_outline_t);
    965     /* insert padding */
    966     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    967     xcb_buffer_len += xcb_block_len + xcb_pad;
    968     if (0 != xcb_pad) {
    969         xcb_tmp += xcb_pad;
    970         xcb_pad = 0;
    971     }
    972     xcb_block_len = 0;
    973 
    974     return xcb_buffer_len;
    975 }
    976 
    977 int
    978 xcb_xkb_shape_outlines_length (const xcb_xkb_shape_t *R)
    979 {
    980     return R->nOutlines;
    981 }
    982 
    983 xcb_xkb_outline_iterator_t
    984 xcb_xkb_shape_outlines_iterator (const xcb_xkb_shape_t *R)
    985 {
    986     xcb_xkb_outline_iterator_t i;
    987     i.data = (xcb_xkb_outline_t *) (R + 1);
    988     i.rem = R->nOutlines;
    989     i.index = (char *) i.data - (char *) R;
    990     return i;
    991 }
    992 
    993 void
    994 xcb_xkb_shape_next (xcb_xkb_shape_iterator_t *i)
    995 {
    996     xcb_xkb_shape_t *R = i->data;
    997     xcb_generic_iterator_t child;
    998     child.data = (xcb_xkb_shape_t *)(((char *)R) + xcb_xkb_shape_sizeof(R));
    999     i->index = (char *) child.data - (char *) i->data;
   1000     --i->rem;
   1001     i->data = (xcb_xkb_shape_t *) child.data;
   1002 }
   1003 
   1004 xcb_generic_iterator_t
   1005 xcb_xkb_shape_end (xcb_xkb_shape_iterator_t i)
   1006 {
   1007     xcb_generic_iterator_t ret;
   1008     while(i.rem > 0)
   1009         xcb_xkb_shape_next(&i);
   1010     ret.data = i.data;
   1011     ret.rem = i.rem;
   1012     ret.index = i.index;
   1013     return ret;
   1014 }
   1015 
   1016 void
   1017 xcb_xkb_key_next (xcb_xkb_key_iterator_t *i)
   1018 {
   1019     --i->rem;
   1020     ++i->data;
   1021     i->index += sizeof(xcb_xkb_key_t);
   1022 }
   1023 
   1024 xcb_generic_iterator_t
   1025 xcb_xkb_key_end (xcb_xkb_key_iterator_t i)
   1026 {
   1027     xcb_generic_iterator_t ret;
   1028     ret.data = i.data + i.rem;
   1029     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1030     ret.rem = 0;
   1031     return ret;
   1032 }
   1033 
   1034 void
   1035 xcb_xkb_overlay_key_next (xcb_xkb_overlay_key_iterator_t *i)
   1036 {
   1037     --i->rem;
   1038     ++i->data;
   1039     i->index += sizeof(xcb_xkb_overlay_key_t);
   1040 }
   1041 
   1042 xcb_generic_iterator_t
   1043 xcb_xkb_overlay_key_end (xcb_xkb_overlay_key_iterator_t i)
   1044 {
   1045     xcb_generic_iterator_t ret;
   1046     ret.data = i.data + i.rem;
   1047     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1048     ret.rem = 0;
   1049     return ret;
   1050 }
   1051 
   1052 int
   1053 xcb_xkb_overlay_row_sizeof (const void  *_buffer)
   1054 {
   1055     char *xcb_tmp = (char *)_buffer;
   1056     const xcb_xkb_overlay_row_t *_aux = (xcb_xkb_overlay_row_t *)_buffer;
   1057     unsigned int xcb_buffer_len = 0;
   1058     unsigned int xcb_block_len = 0;
   1059     unsigned int xcb_pad = 0;
   1060     unsigned int xcb_align_to = 0;
   1061 
   1062 
   1063     xcb_block_len += sizeof(xcb_xkb_overlay_row_t);
   1064     xcb_tmp += xcb_block_len;
   1065     xcb_buffer_len += xcb_block_len;
   1066     xcb_block_len = 0;
   1067     /* keys */
   1068     xcb_block_len += _aux->nKeys * sizeof(xcb_xkb_overlay_key_t);
   1069     xcb_tmp += xcb_block_len;
   1070     xcb_align_to = ALIGNOF(xcb_xkb_overlay_key_t);
   1071     /* insert padding */
   1072     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1073     xcb_buffer_len += xcb_block_len + xcb_pad;
   1074     if (0 != xcb_pad) {
   1075         xcb_tmp += xcb_pad;
   1076         xcb_pad = 0;
   1077     }
   1078     xcb_block_len = 0;
   1079 
   1080     return xcb_buffer_len;
   1081 }
   1082 
   1083 xcb_xkb_overlay_key_t *
   1084 xcb_xkb_overlay_row_keys (const xcb_xkb_overlay_row_t *R)
   1085 {
   1086     return (xcb_xkb_overlay_key_t *) (R + 1);
   1087 }
   1088 
   1089 int
   1090 xcb_xkb_overlay_row_keys_length (const xcb_xkb_overlay_row_t *R)
   1091 {
   1092     return R->nKeys;
   1093 }
   1094 
   1095 xcb_xkb_overlay_key_iterator_t
   1096 xcb_xkb_overlay_row_keys_iterator (const xcb_xkb_overlay_row_t *R)
   1097 {
   1098     xcb_xkb_overlay_key_iterator_t i;
   1099     i.data = (xcb_xkb_overlay_key_t *) (R + 1);
   1100     i.rem = R->nKeys;
   1101     i.index = (char *) i.data - (char *) R;
   1102     return i;
   1103 }
   1104 
   1105 void
   1106 xcb_xkb_overlay_row_next (xcb_xkb_overlay_row_iterator_t *i)
   1107 {
   1108     xcb_xkb_overlay_row_t *R = i->data;
   1109     xcb_generic_iterator_t child;
   1110     child.data = (xcb_xkb_overlay_row_t *)(((char *)R) + xcb_xkb_overlay_row_sizeof(R));
   1111     i->index = (char *) child.data - (char *) i->data;
   1112     --i->rem;
   1113     i->data = (xcb_xkb_overlay_row_t *) child.data;
   1114 }
   1115 
   1116 xcb_generic_iterator_t
   1117 xcb_xkb_overlay_row_end (xcb_xkb_overlay_row_iterator_t i)
   1118 {
   1119     xcb_generic_iterator_t ret;
   1120     while(i.rem > 0)
   1121         xcb_xkb_overlay_row_next(&i);
   1122     ret.data = i.data;
   1123     ret.rem = i.rem;
   1124     ret.index = i.index;
   1125     return ret;
   1126 }
   1127 
   1128 int
   1129 xcb_xkb_overlay_sizeof (const void  *_buffer)
   1130 {
   1131     char *xcb_tmp = (char *)_buffer;
   1132     const xcb_xkb_overlay_t *_aux = (xcb_xkb_overlay_t *)_buffer;
   1133     unsigned int xcb_buffer_len = 0;
   1134     unsigned int xcb_block_len = 0;
   1135     unsigned int xcb_pad = 0;
   1136     unsigned int xcb_align_to = 0;
   1137 
   1138     unsigned int i;
   1139     unsigned int xcb_tmp_len;
   1140 
   1141     xcb_block_len += sizeof(xcb_xkb_overlay_t);
   1142     xcb_tmp += xcb_block_len;
   1143     xcb_buffer_len += xcb_block_len;
   1144     xcb_block_len = 0;
   1145     /* rows */
   1146     for(i=0; i<_aux->nRows; i++) {
   1147         xcb_tmp_len = xcb_xkb_overlay_row_sizeof(xcb_tmp);
   1148         xcb_block_len += xcb_tmp_len;
   1149         xcb_tmp += xcb_tmp_len;
   1150     }
   1151     xcb_align_to = ALIGNOF(xcb_xkb_overlay_row_t);
   1152     /* insert padding */
   1153     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1154     xcb_buffer_len += xcb_block_len + xcb_pad;
   1155     if (0 != xcb_pad) {
   1156         xcb_tmp += xcb_pad;
   1157         xcb_pad = 0;
   1158     }
   1159     xcb_block_len = 0;
   1160 
   1161     return xcb_buffer_len;
   1162 }
   1163 
   1164 int
   1165 xcb_xkb_overlay_rows_length (const xcb_xkb_overlay_t *R)
   1166 {
   1167     return R->nRows;
   1168 }
   1169 
   1170 xcb_xkb_overlay_row_iterator_t
   1171 xcb_xkb_overlay_rows_iterator (const xcb_xkb_overlay_t *R)
   1172 {
   1173     xcb_xkb_overlay_row_iterator_t i;
   1174     i.data = (xcb_xkb_overlay_row_t *) (R + 1);
   1175     i.rem = R->nRows;
   1176     i.index = (char *) i.data - (char *) R;
   1177     return i;
   1178 }
   1179 
   1180 void
   1181 xcb_xkb_overlay_next (xcb_xkb_overlay_iterator_t *i)
   1182 {
   1183     xcb_xkb_overlay_t *R = i->data;
   1184     xcb_generic_iterator_t child;
   1185     child.data = (xcb_xkb_overlay_t *)(((char *)R) + xcb_xkb_overlay_sizeof(R));
   1186     i->index = (char *) child.data - (char *) i->data;
   1187     --i->rem;
   1188     i->data = (xcb_xkb_overlay_t *) child.data;
   1189 }
   1190 
   1191 xcb_generic_iterator_t
   1192 xcb_xkb_overlay_end (xcb_xkb_overlay_iterator_t i)
   1193 {
   1194     xcb_generic_iterator_t ret;
   1195     while(i.rem > 0)
   1196         xcb_xkb_overlay_next(&i);
   1197     ret.data = i.data;
   1198     ret.rem = i.rem;
   1199     ret.index = i.index;
   1200     return ret;
   1201 }
   1202 
   1203 int
   1204 xcb_xkb_row_sizeof (const void  *_buffer)
   1205 {
   1206     char *xcb_tmp = (char *)_buffer;
   1207     const xcb_xkb_row_t *_aux = (xcb_xkb_row_t *)_buffer;
   1208     unsigned int xcb_buffer_len = 0;
   1209     unsigned int xcb_block_len = 0;
   1210     unsigned int xcb_pad = 0;
   1211     unsigned int xcb_align_to = 0;
   1212 
   1213 
   1214     xcb_block_len += sizeof(xcb_xkb_row_t);
   1215     xcb_tmp += xcb_block_len;
   1216     xcb_buffer_len += xcb_block_len;
   1217     xcb_block_len = 0;
   1218     /* keys */
   1219     xcb_block_len += _aux->nKeys * sizeof(xcb_xkb_key_t);
   1220     xcb_tmp += xcb_block_len;
   1221     xcb_align_to = ALIGNOF(xcb_xkb_key_t);
   1222     /* insert padding */
   1223     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1224     xcb_buffer_len += xcb_block_len + xcb_pad;
   1225     if (0 != xcb_pad) {
   1226         xcb_tmp += xcb_pad;
   1227         xcb_pad = 0;
   1228     }
   1229     xcb_block_len = 0;
   1230 
   1231     return xcb_buffer_len;
   1232 }
   1233 
   1234 xcb_xkb_key_t *
   1235 xcb_xkb_row_keys (const xcb_xkb_row_t *R)
   1236 {
   1237     return (xcb_xkb_key_t *) (R + 1);
   1238 }
   1239 
   1240 int
   1241 xcb_xkb_row_keys_length (const xcb_xkb_row_t *R)
   1242 {
   1243     return R->nKeys;
   1244 }
   1245 
   1246 xcb_xkb_key_iterator_t
   1247 xcb_xkb_row_keys_iterator (const xcb_xkb_row_t *R)
   1248 {
   1249     xcb_xkb_key_iterator_t i;
   1250     i.data = (xcb_xkb_key_t *) (R + 1);
   1251     i.rem = R->nKeys;
   1252     i.index = (char *) i.data - (char *) R;
   1253     return i;
   1254 }
   1255 
   1256 void
   1257 xcb_xkb_row_next (xcb_xkb_row_iterator_t *i)
   1258 {
   1259     xcb_xkb_row_t *R = i->data;
   1260     xcb_generic_iterator_t child;
   1261     child.data = (xcb_xkb_row_t *)(((char *)R) + xcb_xkb_row_sizeof(R));
   1262     i->index = (char *) child.data - (char *) i->data;
   1263     --i->rem;
   1264     i->data = (xcb_xkb_row_t *) child.data;
   1265 }
   1266 
   1267 xcb_generic_iterator_t
   1268 xcb_xkb_row_end (xcb_xkb_row_iterator_t i)
   1269 {
   1270     xcb_generic_iterator_t ret;
   1271     while(i.rem > 0)
   1272         xcb_xkb_row_next(&i);
   1273     ret.data = i.data;
   1274     ret.rem = i.rem;
   1275     ret.index = i.index;
   1276     return ret;
   1277 }
   1278 
   1279 int
   1280 xcb_xkb_listing_sizeof (const void  *_buffer)
   1281 {
   1282     char *xcb_tmp = (char *)_buffer;
   1283     const xcb_xkb_listing_t *_aux = (xcb_xkb_listing_t *)_buffer;
   1284     unsigned int xcb_buffer_len = 0;
   1285     unsigned int xcb_block_len = 0;
   1286     unsigned int xcb_pad = 0;
   1287     unsigned int xcb_align_to = 0;
   1288 
   1289 
   1290     xcb_block_len += sizeof(xcb_xkb_listing_t);
   1291     xcb_tmp += xcb_block_len;
   1292     xcb_buffer_len += xcb_block_len;
   1293     xcb_block_len = 0;
   1294     /* string */
   1295     xcb_block_len += _aux->length * sizeof(xcb_xkb_string8_t);
   1296     xcb_tmp += xcb_block_len;
   1297     xcb_align_to = ALIGNOF(xcb_xkb_string8_t);
   1298     xcb_align_to = 2;
   1299     /* insert padding */
   1300     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1301     xcb_buffer_len += xcb_block_len + xcb_pad;
   1302     if (0 != xcb_pad) {
   1303         xcb_tmp += xcb_pad;
   1304         xcb_pad = 0;
   1305     }
   1306     xcb_block_len = 0;
   1307     /* insert padding */
   1308     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1309     xcb_buffer_len += xcb_block_len + xcb_pad;
   1310     if (0 != xcb_pad) {
   1311         xcb_tmp += xcb_pad;
   1312         xcb_pad = 0;
   1313     }
   1314     xcb_block_len = 0;
   1315 
   1316     return xcb_buffer_len;
   1317 }
   1318 
   1319 xcb_xkb_string8_t *
   1320 xcb_xkb_listing_string (const xcb_xkb_listing_t *R)
   1321 {
   1322     return (xcb_xkb_string8_t *) (R + 1);
   1323 }
   1324 
   1325 int
   1326 xcb_xkb_listing_string_length (const xcb_xkb_listing_t *R)
   1327 {
   1328     return R->length;
   1329 }
   1330 
   1331 xcb_generic_iterator_t
   1332 xcb_xkb_listing_string_end (const xcb_xkb_listing_t *R)
   1333 {
   1334     xcb_generic_iterator_t i;
   1335     i.data = ((xcb_xkb_string8_t *) (R + 1)) + (R->length);
   1336     i.rem = 0;
   1337     i.index = (char *) i.data - (char *) R;
   1338     return i;
   1339 }
   1340 
   1341 void
   1342 xcb_xkb_listing_next (xcb_xkb_listing_iterator_t *i)
   1343 {
   1344     xcb_xkb_listing_t *R = i->data;
   1345     xcb_generic_iterator_t child;
   1346     child.data = (xcb_xkb_listing_t *)(((char *)R) + xcb_xkb_listing_sizeof(R));
   1347     i->index = (char *) child.data - (char *) i->data;
   1348     --i->rem;
   1349     i->data = (xcb_xkb_listing_t *) child.data;
   1350 }
   1351 
   1352 xcb_generic_iterator_t
   1353 xcb_xkb_listing_end (xcb_xkb_listing_iterator_t i)
   1354 {
   1355     xcb_generic_iterator_t ret;
   1356     while(i.rem > 0)
   1357         xcb_xkb_listing_next(&i);
   1358     ret.data = i.data;
   1359     ret.rem = i.rem;
   1360     ret.index = i.index;
   1361     return ret;
   1362 }
   1363 
   1364 int
   1365 xcb_xkb_device_led_info_sizeof (const void  *_buffer)
   1366 {
   1367     char *xcb_tmp = (char *)_buffer;
   1368     const xcb_xkb_device_led_info_t *_aux = (xcb_xkb_device_led_info_t *)_buffer;
   1369     unsigned int xcb_buffer_len = 0;
   1370     unsigned int xcb_block_len = 0;
   1371     unsigned int xcb_pad = 0;
   1372     unsigned int xcb_align_to = 0;
   1373 
   1374 
   1375     xcb_block_len += sizeof(xcb_xkb_device_led_info_t);
   1376     xcb_tmp += xcb_block_len;
   1377     xcb_buffer_len += xcb_block_len;
   1378     xcb_block_len = 0;
   1379     /* names */
   1380     xcb_block_len += xcb_popcount(_aux->namesPresent) * sizeof(uint32_t);
   1381     xcb_tmp += xcb_block_len;
   1382     xcb_align_to = ALIGNOF(xcb_atom_t);
   1383     /* insert padding */
   1384     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1385     xcb_buffer_len += xcb_block_len + xcb_pad;
   1386     if (0 != xcb_pad) {
   1387         xcb_tmp += xcb_pad;
   1388         xcb_pad = 0;
   1389     }
   1390     xcb_block_len = 0;
   1391     /* maps */
   1392     xcb_block_len += xcb_popcount(_aux->mapsPresent) * sizeof(xcb_xkb_indicator_map_t);
   1393     xcb_tmp += xcb_block_len;
   1394     xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
   1395     /* insert padding */
   1396     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1397     xcb_buffer_len += xcb_block_len + xcb_pad;
   1398     if (0 != xcb_pad) {
   1399         xcb_tmp += xcb_pad;
   1400         xcb_pad = 0;
   1401     }
   1402     xcb_block_len = 0;
   1403 
   1404     return xcb_buffer_len;
   1405 }
   1406 
   1407 xcb_atom_t *
   1408 xcb_xkb_device_led_info_names (const xcb_xkb_device_led_info_t *R)
   1409 {
   1410     return (xcb_atom_t *) (R + 1);
   1411 }
   1412 
   1413 int
   1414 xcb_xkb_device_led_info_names_length (const xcb_xkb_device_led_info_t *R)
   1415 {
   1416     return xcb_popcount(R->namesPresent);
   1417 }
   1418 
   1419 xcb_generic_iterator_t
   1420 xcb_xkb_device_led_info_names_end (const xcb_xkb_device_led_info_t *R)
   1421 {
   1422     xcb_generic_iterator_t i;
   1423     i.data = ((xcb_atom_t *) (R + 1)) + (xcb_popcount(R->namesPresent));
   1424     i.rem = 0;
   1425     i.index = (char *) i.data - (char *) R;
   1426     return i;
   1427 }
   1428 
   1429 xcb_xkb_indicator_map_t *
   1430 xcb_xkb_device_led_info_maps (const xcb_xkb_device_led_info_t *R)
   1431 {
   1432     xcb_generic_iterator_t prev = xcb_xkb_device_led_info_names_end(R);
   1433     return (xcb_xkb_indicator_map_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_indicator_map_t, prev.index) + 0);
   1434 }
   1435 
   1436 int
   1437 xcb_xkb_device_led_info_maps_length (const xcb_xkb_device_led_info_t *R)
   1438 {
   1439     return xcb_popcount(R->mapsPresent);
   1440 }
   1441 
   1442 xcb_xkb_indicator_map_iterator_t
   1443 xcb_xkb_device_led_info_maps_iterator (const xcb_xkb_device_led_info_t *R)
   1444 {
   1445     xcb_xkb_indicator_map_iterator_t i;
   1446     xcb_generic_iterator_t prev = xcb_xkb_device_led_info_names_end(R);
   1447     i.data = (xcb_xkb_indicator_map_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_indicator_map_t, prev.index));
   1448     i.rem = xcb_popcount(R->mapsPresent);
   1449     i.index = (char *) i.data - (char *) R;
   1450     return i;
   1451 }
   1452 
   1453 void
   1454 xcb_xkb_device_led_info_next (xcb_xkb_device_led_info_iterator_t *i)
   1455 {
   1456     xcb_xkb_device_led_info_t *R = i->data;
   1457     xcb_generic_iterator_t child;
   1458     child.data = (xcb_xkb_device_led_info_t *)(((char *)R) + xcb_xkb_device_led_info_sizeof(R));
   1459     i->index = (char *) child.data - (char *) i->data;
   1460     --i->rem;
   1461     i->data = (xcb_xkb_device_led_info_t *) child.data;
   1462 }
   1463 
   1464 xcb_generic_iterator_t
   1465 xcb_xkb_device_led_info_end (xcb_xkb_device_led_info_iterator_t i)
   1466 {
   1467     xcb_generic_iterator_t ret;
   1468     while(i.rem > 0)
   1469         xcb_xkb_device_led_info_next(&i);
   1470     ret.data = i.data;
   1471     ret.rem = i.rem;
   1472     ret.index = i.index;
   1473     return ret;
   1474 }
   1475 
   1476 void
   1477 xcb_xkb_sa_no_action_next (xcb_xkb_sa_no_action_iterator_t *i)
   1478 {
   1479     --i->rem;
   1480     ++i->data;
   1481     i->index += sizeof(xcb_xkb_sa_no_action_t);
   1482 }
   1483 
   1484 xcb_generic_iterator_t
   1485 xcb_xkb_sa_no_action_end (xcb_xkb_sa_no_action_iterator_t i)
   1486 {
   1487     xcb_generic_iterator_t ret;
   1488     ret.data = i.data + i.rem;
   1489     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1490     ret.rem = 0;
   1491     return ret;
   1492 }
   1493 
   1494 void
   1495 xcb_xkb_sa_set_mods_next (xcb_xkb_sa_set_mods_iterator_t *i)
   1496 {
   1497     --i->rem;
   1498     ++i->data;
   1499     i->index += sizeof(xcb_xkb_sa_set_mods_t);
   1500 }
   1501 
   1502 xcb_generic_iterator_t
   1503 xcb_xkb_sa_set_mods_end (xcb_xkb_sa_set_mods_iterator_t i)
   1504 {
   1505     xcb_generic_iterator_t ret;
   1506     ret.data = i.data + i.rem;
   1507     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1508     ret.rem = 0;
   1509     return ret;
   1510 }
   1511 
   1512 void
   1513 xcb_xkb_sa_latch_mods_next (xcb_xkb_sa_latch_mods_iterator_t *i)
   1514 {
   1515     --i->rem;
   1516     ++i->data;
   1517     i->index += sizeof(xcb_xkb_sa_latch_mods_t);
   1518 }
   1519 
   1520 xcb_generic_iterator_t
   1521 xcb_xkb_sa_latch_mods_end (xcb_xkb_sa_latch_mods_iterator_t i)
   1522 {
   1523     xcb_generic_iterator_t ret;
   1524     ret.data = i.data + i.rem;
   1525     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1526     ret.rem = 0;
   1527     return ret;
   1528 }
   1529 
   1530 void
   1531 xcb_xkb_sa_lock_mods_next (xcb_xkb_sa_lock_mods_iterator_t *i)
   1532 {
   1533     --i->rem;
   1534     ++i->data;
   1535     i->index += sizeof(xcb_xkb_sa_lock_mods_t);
   1536 }
   1537 
   1538 xcb_generic_iterator_t
   1539 xcb_xkb_sa_lock_mods_end (xcb_xkb_sa_lock_mods_iterator_t i)
   1540 {
   1541     xcb_generic_iterator_t ret;
   1542     ret.data = i.data + i.rem;
   1543     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1544     ret.rem = 0;
   1545     return ret;
   1546 }
   1547 
   1548 void
   1549 xcb_xkb_sa_set_group_next (xcb_xkb_sa_set_group_iterator_t *i)
   1550 {
   1551     --i->rem;
   1552     ++i->data;
   1553     i->index += sizeof(xcb_xkb_sa_set_group_t);
   1554 }
   1555 
   1556 xcb_generic_iterator_t
   1557 xcb_xkb_sa_set_group_end (xcb_xkb_sa_set_group_iterator_t i)
   1558 {
   1559     xcb_generic_iterator_t ret;
   1560     ret.data = i.data + i.rem;
   1561     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1562     ret.rem = 0;
   1563     return ret;
   1564 }
   1565 
   1566 void
   1567 xcb_xkb_sa_latch_group_next (xcb_xkb_sa_latch_group_iterator_t *i)
   1568 {
   1569     --i->rem;
   1570     ++i->data;
   1571     i->index += sizeof(xcb_xkb_sa_latch_group_t);
   1572 }
   1573 
   1574 xcb_generic_iterator_t
   1575 xcb_xkb_sa_latch_group_end (xcb_xkb_sa_latch_group_iterator_t i)
   1576 {
   1577     xcb_generic_iterator_t ret;
   1578     ret.data = i.data + i.rem;
   1579     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1580     ret.rem = 0;
   1581     return ret;
   1582 }
   1583 
   1584 void
   1585 xcb_xkb_sa_lock_group_next (xcb_xkb_sa_lock_group_iterator_t *i)
   1586 {
   1587     --i->rem;
   1588     ++i->data;
   1589     i->index += sizeof(xcb_xkb_sa_lock_group_t);
   1590 }
   1591 
   1592 xcb_generic_iterator_t
   1593 xcb_xkb_sa_lock_group_end (xcb_xkb_sa_lock_group_iterator_t i)
   1594 {
   1595     xcb_generic_iterator_t ret;
   1596     ret.data = i.data + i.rem;
   1597     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1598     ret.rem = 0;
   1599     return ret;
   1600 }
   1601 
   1602 void
   1603 xcb_xkb_sa_move_ptr_next (xcb_xkb_sa_move_ptr_iterator_t *i)
   1604 {
   1605     --i->rem;
   1606     ++i->data;
   1607     i->index += sizeof(xcb_xkb_sa_move_ptr_t);
   1608 }
   1609 
   1610 xcb_generic_iterator_t
   1611 xcb_xkb_sa_move_ptr_end (xcb_xkb_sa_move_ptr_iterator_t i)
   1612 {
   1613     xcb_generic_iterator_t ret;
   1614     ret.data = i.data + i.rem;
   1615     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1616     ret.rem = 0;
   1617     return ret;
   1618 }
   1619 
   1620 void
   1621 xcb_xkb_sa_ptr_btn_next (xcb_xkb_sa_ptr_btn_iterator_t *i)
   1622 {
   1623     --i->rem;
   1624     ++i->data;
   1625     i->index += sizeof(xcb_xkb_sa_ptr_btn_t);
   1626 }
   1627 
   1628 xcb_generic_iterator_t
   1629 xcb_xkb_sa_ptr_btn_end (xcb_xkb_sa_ptr_btn_iterator_t i)
   1630 {
   1631     xcb_generic_iterator_t ret;
   1632     ret.data = i.data + i.rem;
   1633     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1634     ret.rem = 0;
   1635     return ret;
   1636 }
   1637 
   1638 void
   1639 xcb_xkb_sa_lock_ptr_btn_next (xcb_xkb_sa_lock_ptr_btn_iterator_t *i)
   1640 {
   1641     --i->rem;
   1642     ++i->data;
   1643     i->index += sizeof(xcb_xkb_sa_lock_ptr_btn_t);
   1644 }
   1645 
   1646 xcb_generic_iterator_t
   1647 xcb_xkb_sa_lock_ptr_btn_end (xcb_xkb_sa_lock_ptr_btn_iterator_t i)
   1648 {
   1649     xcb_generic_iterator_t ret;
   1650     ret.data = i.data + i.rem;
   1651     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1652     ret.rem = 0;
   1653     return ret;
   1654 }
   1655 
   1656 void
   1657 xcb_xkb_sa_set_ptr_dflt_next (xcb_xkb_sa_set_ptr_dflt_iterator_t *i)
   1658 {
   1659     --i->rem;
   1660     ++i->data;
   1661     i->index += sizeof(xcb_xkb_sa_set_ptr_dflt_t);
   1662 }
   1663 
   1664 xcb_generic_iterator_t
   1665 xcb_xkb_sa_set_ptr_dflt_end (xcb_xkb_sa_set_ptr_dflt_iterator_t i)
   1666 {
   1667     xcb_generic_iterator_t ret;
   1668     ret.data = i.data + i.rem;
   1669     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1670     ret.rem = 0;
   1671     return ret;
   1672 }
   1673 
   1674 void
   1675 xcb_xkb_sa_iso_lock_next (xcb_xkb_sa_iso_lock_iterator_t *i)
   1676 {
   1677     --i->rem;
   1678     ++i->data;
   1679     i->index += sizeof(xcb_xkb_sa_iso_lock_t);
   1680 }
   1681 
   1682 xcb_generic_iterator_t
   1683 xcb_xkb_sa_iso_lock_end (xcb_xkb_sa_iso_lock_iterator_t i)
   1684 {
   1685     xcb_generic_iterator_t ret;
   1686     ret.data = i.data + i.rem;
   1687     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1688     ret.rem = 0;
   1689     return ret;
   1690 }
   1691 
   1692 void
   1693 xcb_xkb_sa_terminate_next (xcb_xkb_sa_terminate_iterator_t *i)
   1694 {
   1695     --i->rem;
   1696     ++i->data;
   1697     i->index += sizeof(xcb_xkb_sa_terminate_t);
   1698 }
   1699 
   1700 xcb_generic_iterator_t
   1701 xcb_xkb_sa_terminate_end (xcb_xkb_sa_terminate_iterator_t i)
   1702 {
   1703     xcb_generic_iterator_t ret;
   1704     ret.data = i.data + i.rem;
   1705     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1706     ret.rem = 0;
   1707     return ret;
   1708 }
   1709 
   1710 void
   1711 xcb_xkb_sa_switch_screen_next (xcb_xkb_sa_switch_screen_iterator_t *i)
   1712 {
   1713     --i->rem;
   1714     ++i->data;
   1715     i->index += sizeof(xcb_xkb_sa_switch_screen_t);
   1716 }
   1717 
   1718 xcb_generic_iterator_t
   1719 xcb_xkb_sa_switch_screen_end (xcb_xkb_sa_switch_screen_iterator_t i)
   1720 {
   1721     xcb_generic_iterator_t ret;
   1722     ret.data = i.data + i.rem;
   1723     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1724     ret.rem = 0;
   1725     return ret;
   1726 }
   1727 
   1728 void
   1729 xcb_xkb_sa_set_controls_next (xcb_xkb_sa_set_controls_iterator_t *i)
   1730 {
   1731     --i->rem;
   1732     ++i->data;
   1733     i->index += sizeof(xcb_xkb_sa_set_controls_t);
   1734 }
   1735 
   1736 xcb_generic_iterator_t
   1737 xcb_xkb_sa_set_controls_end (xcb_xkb_sa_set_controls_iterator_t i)
   1738 {
   1739     xcb_generic_iterator_t ret;
   1740     ret.data = i.data + i.rem;
   1741     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1742     ret.rem = 0;
   1743     return ret;
   1744 }
   1745 
   1746 void
   1747 xcb_xkb_sa_lock_controls_next (xcb_xkb_sa_lock_controls_iterator_t *i)
   1748 {
   1749     --i->rem;
   1750     ++i->data;
   1751     i->index += sizeof(xcb_xkb_sa_lock_controls_t);
   1752 }
   1753 
   1754 xcb_generic_iterator_t
   1755 xcb_xkb_sa_lock_controls_end (xcb_xkb_sa_lock_controls_iterator_t i)
   1756 {
   1757     xcb_generic_iterator_t ret;
   1758     ret.data = i.data + i.rem;
   1759     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1760     ret.rem = 0;
   1761     return ret;
   1762 }
   1763 
   1764 void
   1765 xcb_xkb_sa_action_message_next (xcb_xkb_sa_action_message_iterator_t *i)
   1766 {
   1767     --i->rem;
   1768     ++i->data;
   1769     i->index += sizeof(xcb_xkb_sa_action_message_t);
   1770 }
   1771 
   1772 xcb_generic_iterator_t
   1773 xcb_xkb_sa_action_message_end (xcb_xkb_sa_action_message_iterator_t i)
   1774 {
   1775     xcb_generic_iterator_t ret;
   1776     ret.data = i.data + i.rem;
   1777     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1778     ret.rem = 0;
   1779     return ret;
   1780 }
   1781 
   1782 void
   1783 xcb_xkb_sa_redirect_key_next (xcb_xkb_sa_redirect_key_iterator_t *i)
   1784 {
   1785     --i->rem;
   1786     ++i->data;
   1787     i->index += sizeof(xcb_xkb_sa_redirect_key_t);
   1788 }
   1789 
   1790 xcb_generic_iterator_t
   1791 xcb_xkb_sa_redirect_key_end (xcb_xkb_sa_redirect_key_iterator_t i)
   1792 {
   1793     xcb_generic_iterator_t ret;
   1794     ret.data = i.data + i.rem;
   1795     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1796     ret.rem = 0;
   1797     return ret;
   1798 }
   1799 
   1800 void
   1801 xcb_xkb_sa_device_btn_next (xcb_xkb_sa_device_btn_iterator_t *i)
   1802 {
   1803     --i->rem;
   1804     ++i->data;
   1805     i->index += sizeof(xcb_xkb_sa_device_btn_t);
   1806 }
   1807 
   1808 xcb_generic_iterator_t
   1809 xcb_xkb_sa_device_btn_end (xcb_xkb_sa_device_btn_iterator_t i)
   1810 {
   1811     xcb_generic_iterator_t ret;
   1812     ret.data = i.data + i.rem;
   1813     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1814     ret.rem = 0;
   1815     return ret;
   1816 }
   1817 
   1818 void
   1819 xcb_xkb_sa_lock_device_btn_next (xcb_xkb_sa_lock_device_btn_iterator_t *i)
   1820 {
   1821     --i->rem;
   1822     ++i->data;
   1823     i->index += sizeof(xcb_xkb_sa_lock_device_btn_t);
   1824 }
   1825 
   1826 xcb_generic_iterator_t
   1827 xcb_xkb_sa_lock_device_btn_end (xcb_xkb_sa_lock_device_btn_iterator_t i)
   1828 {
   1829     xcb_generic_iterator_t ret;
   1830     ret.data = i.data + i.rem;
   1831     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1832     ret.rem = 0;
   1833     return ret;
   1834 }
   1835 
   1836 void
   1837 xcb_xkb_sa_device_valuator_next (xcb_xkb_sa_device_valuator_iterator_t *i)
   1838 {
   1839     --i->rem;
   1840     ++i->data;
   1841     i->index += sizeof(xcb_xkb_sa_device_valuator_t);
   1842 }
   1843 
   1844 xcb_generic_iterator_t
   1845 xcb_xkb_sa_device_valuator_end (xcb_xkb_sa_device_valuator_iterator_t i)
   1846 {
   1847     xcb_generic_iterator_t ret;
   1848     ret.data = i.data + i.rem;
   1849     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1850     ret.rem = 0;
   1851     return ret;
   1852 }
   1853 
   1854 void
   1855 xcb_xkb_si_action_next (xcb_xkb_si_action_iterator_t *i)
   1856 {
   1857     --i->rem;
   1858     ++i->data;
   1859     i->index += sizeof(xcb_xkb_si_action_t);
   1860 }
   1861 
   1862 xcb_generic_iterator_t
   1863 xcb_xkb_si_action_end (xcb_xkb_si_action_iterator_t i)
   1864 {
   1865     xcb_generic_iterator_t ret;
   1866     ret.data = i.data + i.rem;
   1867     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1868     ret.rem = 0;
   1869     return ret;
   1870 }
   1871 
   1872 void
   1873 xcb_xkb_sym_interpret_next (xcb_xkb_sym_interpret_iterator_t *i)
   1874 {
   1875     --i->rem;
   1876     ++i->data;
   1877     i->index += sizeof(xcb_xkb_sym_interpret_t);
   1878 }
   1879 
   1880 xcb_generic_iterator_t
   1881 xcb_xkb_sym_interpret_end (xcb_xkb_sym_interpret_iterator_t i)
   1882 {
   1883     xcb_generic_iterator_t ret;
   1884     ret.data = i.data + i.rem;
   1885     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1886     ret.rem = 0;
   1887     return ret;
   1888 }
   1889 
   1890 void
   1891 xcb_xkb_action_next (xcb_xkb_action_iterator_t *i)
   1892 {
   1893     --i->rem;
   1894     ++i->data;
   1895     i->index += sizeof(xcb_xkb_action_t);
   1896 }
   1897 
   1898 xcb_generic_iterator_t
   1899 xcb_xkb_action_end (xcb_xkb_action_iterator_t i)
   1900 {
   1901     xcb_generic_iterator_t ret;
   1902     ret.data = i.data + i.rem;
   1903     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   1904     ret.rem = 0;
   1905     return ret;
   1906 }
   1907 
   1908 xcb_xkb_use_extension_cookie_t
   1909 xcb_xkb_use_extension (xcb_connection_t *c,
   1910                        uint16_t          wantedMajor,
   1911                        uint16_t          wantedMinor)
   1912 {
   1913     static const xcb_protocol_request_t xcb_req = {
   1914         .count = 2,
   1915         .ext = &xcb_xkb_id,
   1916         .opcode = XCB_XKB_USE_EXTENSION,
   1917         .isvoid = 0
   1918     };
   1919 
   1920     struct iovec xcb_parts[4];
   1921     xcb_xkb_use_extension_cookie_t xcb_ret;
   1922     xcb_xkb_use_extension_request_t xcb_out;
   1923 
   1924     xcb_out.wantedMajor = wantedMajor;
   1925     xcb_out.wantedMinor = wantedMinor;
   1926 
   1927     xcb_parts[2].iov_base = (char *) &xcb_out;
   1928     xcb_parts[2].iov_len = sizeof(xcb_out);
   1929     xcb_parts[3].iov_base = 0;
   1930     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1931 
   1932     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1933     return xcb_ret;
   1934 }
   1935 
   1936 xcb_xkb_use_extension_cookie_t
   1937 xcb_xkb_use_extension_unchecked (xcb_connection_t *c,
   1938                                  uint16_t          wantedMajor,
   1939                                  uint16_t          wantedMinor)
   1940 {
   1941     static const xcb_protocol_request_t xcb_req = {
   1942         .count = 2,
   1943         .ext = &xcb_xkb_id,
   1944         .opcode = XCB_XKB_USE_EXTENSION,
   1945         .isvoid = 0
   1946     };
   1947 
   1948     struct iovec xcb_parts[4];
   1949     xcb_xkb_use_extension_cookie_t xcb_ret;
   1950     xcb_xkb_use_extension_request_t xcb_out;
   1951 
   1952     xcb_out.wantedMajor = wantedMajor;
   1953     xcb_out.wantedMinor = wantedMinor;
   1954 
   1955     xcb_parts[2].iov_base = (char *) &xcb_out;
   1956     xcb_parts[2].iov_len = sizeof(xcb_out);
   1957     xcb_parts[3].iov_base = 0;
   1958     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1959 
   1960     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1961     return xcb_ret;
   1962 }
   1963 
   1964 xcb_xkb_use_extension_reply_t *
   1965 xcb_xkb_use_extension_reply (xcb_connection_t                *c,
   1966                              xcb_xkb_use_extension_cookie_t   cookie  /**< */,
   1967                              xcb_generic_error_t            **e)
   1968 {
   1969     return (xcb_xkb_use_extension_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   1970 }
   1971 
   1972 int
   1973 xcb_xkb_select_events_details_serialize (void                                  **_buffer,
   1974                                          uint16_t                                affectWhich,
   1975                                          uint16_t                                clear,
   1976                                          uint16_t                                selectAll,
   1977                                          const xcb_xkb_select_events_details_t  *_aux)
   1978 {
   1979     char *xcb_out = *_buffer;
   1980     unsigned int xcb_buffer_len = 0;
   1981     unsigned int xcb_align_to = 0;
   1982     unsigned int xcb_padding_offset = 0;
   1983 
   1984     unsigned int xcb_pad = 0;
   1985     char xcb_pad0[3] = {0, 0, 0};
   1986     struct iovec xcb_parts[23];
   1987     unsigned int xcb_parts_idx = 0;
   1988     unsigned int xcb_block_len = 0;
   1989     unsigned int i;
   1990     char *xcb_tmp;
   1991 
   1992     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NEW_KEYBOARD_NOTIFY) {
   1993         /* xcb_xkb_select_events_details_t.affectNewKeyboard */
   1994         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectNewKeyboard;
   1995         xcb_block_len += sizeof(uint16_t);
   1996         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   1997         xcb_parts_idx++;
   1998         xcb_align_to = ALIGNOF(uint16_t);
   1999         /* xcb_xkb_select_events_details_t.newKeyboardDetails */
   2000         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->newKeyboardDetails;
   2001         xcb_block_len += sizeof(uint16_t);
   2002         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   2003         xcb_parts_idx++;
   2004         xcb_align_to = ALIGNOF(uint16_t);
   2005     }
   2006     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_STATE_NOTIFY) {
   2007         /* xcb_xkb_select_events_details_t.affectState */
   2008         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectState;
   2009         xcb_block_len += sizeof(uint16_t);
   2010         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   2011         xcb_parts_idx++;
   2012         xcb_align_to = ALIGNOF(uint16_t);
   2013         /* xcb_xkb_select_events_details_t.stateDetails */
   2014         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->stateDetails;
   2015         xcb_block_len += sizeof(uint16_t);
   2016         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   2017         xcb_parts_idx++;
   2018         xcb_align_to = ALIGNOF(uint16_t);
   2019     }
   2020     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_CONTROLS_NOTIFY) {
   2021         /* xcb_xkb_select_events_details_t.affectCtrls */
   2022         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectCtrls;
   2023         xcb_block_len += sizeof(uint32_t);
   2024         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   2025         xcb_parts_idx++;
   2026         xcb_align_to = ALIGNOF(uint32_t);
   2027         /* xcb_xkb_select_events_details_t.ctrlDetails */
   2028         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->ctrlDetails;
   2029         xcb_block_len += sizeof(uint32_t);
   2030         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   2031         xcb_parts_idx++;
   2032         xcb_align_to = ALIGNOF(uint32_t);
   2033     }
   2034     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_STATE_NOTIFY) {
   2035         /* xcb_xkb_select_events_details_t.affectIndicatorState */
   2036         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectIndicatorState;
   2037         xcb_block_len += sizeof(uint32_t);
   2038         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   2039         xcb_parts_idx++;
   2040         xcb_align_to = ALIGNOF(uint32_t);
   2041         /* xcb_xkb_select_events_details_t.indicatorStateDetails */
   2042         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicatorStateDetails;
   2043         xcb_block_len += sizeof(uint32_t);
   2044         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   2045         xcb_parts_idx++;
   2046         xcb_align_to = ALIGNOF(uint32_t);
   2047     }
   2048     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_MAP_NOTIFY) {
   2049         /* xcb_xkb_select_events_details_t.affectIndicatorMap */
   2050         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectIndicatorMap;
   2051         xcb_block_len += sizeof(uint32_t);
   2052         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   2053         xcb_parts_idx++;
   2054         xcb_align_to = ALIGNOF(uint32_t);
   2055         /* xcb_xkb_select_events_details_t.indicatorMapDetails */
   2056         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicatorMapDetails;
   2057         xcb_block_len += sizeof(uint32_t);
   2058         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   2059         xcb_parts_idx++;
   2060         xcb_align_to = ALIGNOF(uint32_t);
   2061     }
   2062     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NAMES_NOTIFY) {
   2063         /* xcb_xkb_select_events_details_t.affectNames */
   2064         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectNames;
   2065         xcb_block_len += sizeof(uint16_t);
   2066         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   2067         xcb_parts_idx++;
   2068         xcb_align_to = ALIGNOF(uint16_t);
   2069         /* xcb_xkb_select_events_details_t.namesDetails */
   2070         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->namesDetails;
   2071         xcb_block_len += sizeof(uint16_t);
   2072         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   2073         xcb_parts_idx++;
   2074         xcb_align_to = ALIGNOF(uint16_t);
   2075     }
   2076     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_COMPAT_MAP_NOTIFY) {
   2077         /* xcb_xkb_select_events_details_t.affectCompat */
   2078         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectCompat;
   2079         xcb_block_len += sizeof(uint8_t);
   2080         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   2081         xcb_parts_idx++;
   2082         xcb_align_to = ALIGNOF(uint8_t);
   2083         /* xcb_xkb_select_events_details_t.compatDetails */
   2084         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatDetails;
   2085         xcb_block_len += sizeof(uint8_t);
   2086         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   2087         xcb_parts_idx++;
   2088         xcb_align_to = ALIGNOF(uint8_t);
   2089     }
   2090     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_BELL_NOTIFY) {
   2091         /* xcb_xkb_select_events_details_t.affectBell */
   2092         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectBell;
   2093         xcb_block_len += sizeof(uint8_t);
   2094         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   2095         xcb_parts_idx++;
   2096         xcb_align_to = ALIGNOF(uint8_t);
   2097         /* xcb_xkb_select_events_details_t.bellDetails */
   2098         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->bellDetails;
   2099         xcb_block_len += sizeof(uint8_t);
   2100         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   2101         xcb_parts_idx++;
   2102         xcb_align_to = ALIGNOF(uint8_t);
   2103     }
   2104     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACTION_MESSAGE) {
   2105         /* xcb_xkb_select_events_details_t.affectMsgDetails */
   2106         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectMsgDetails;
   2107         xcb_block_len += sizeof(uint8_t);
   2108         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   2109         xcb_parts_idx++;
   2110         xcb_align_to = ALIGNOF(uint8_t);
   2111         /* xcb_xkb_select_events_details_t.msgDetails */
   2112         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->msgDetails;
   2113         xcb_block_len += sizeof(uint8_t);
   2114         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   2115         xcb_parts_idx++;
   2116         xcb_align_to = ALIGNOF(uint8_t);
   2117     }
   2118     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACCESS_X_NOTIFY) {
   2119         /* xcb_xkb_select_events_details_t.affectAccessX */
   2120         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectAccessX;
   2121         xcb_block_len += sizeof(uint16_t);
   2122         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   2123         xcb_parts_idx++;
   2124         xcb_align_to = ALIGNOF(uint16_t);
   2125         /* xcb_xkb_select_events_details_t.accessXDetails */
   2126         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->accessXDetails;
   2127         xcb_block_len += sizeof(uint16_t);
   2128         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   2129         xcb_parts_idx++;
   2130         xcb_align_to = ALIGNOF(uint16_t);
   2131     }
   2132     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_EXTENSION_DEVICE_NOTIFY) {
   2133         /* xcb_xkb_select_events_details_t.affectExtDev */
   2134         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectExtDev;
   2135         xcb_block_len += sizeof(uint16_t);
   2136         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   2137         xcb_parts_idx++;
   2138         xcb_align_to = ALIGNOF(uint16_t);
   2139         /* xcb_xkb_select_events_details_t.extdevDetails */
   2140         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->extdevDetails;
   2141         xcb_block_len += sizeof(uint16_t);
   2142         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   2143         xcb_parts_idx++;
   2144         xcb_align_to = ALIGNOF(uint16_t);
   2145     }
   2146     /* insert padding */
   2147     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   2148     xcb_buffer_len += xcb_block_len + xcb_pad;
   2149     if (0 != xcb_pad) {
   2150         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   2151         xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   2152         xcb_parts_idx++;
   2153         xcb_pad = 0;
   2154     }
   2155     xcb_block_len = 0;
   2156     xcb_padding_offset = 0;
   2157 
   2158     if (NULL == xcb_out) {
   2159         /* allocate memory */
   2160         xcb_out = malloc(xcb_buffer_len);
   2161         *_buffer = xcb_out;
   2162     }
   2163 
   2164     xcb_tmp = xcb_out;
   2165     for(i=0; i<xcb_parts_idx; i++) {
   2166         if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
   2167             memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
   2168         if (0 != xcb_parts[i].iov_len)
   2169             xcb_tmp += xcb_parts[i].iov_len;
   2170     }
   2171 
   2172     return xcb_buffer_len;
   2173 }
   2174 
   2175 int
   2176 xcb_xkb_select_events_details_unpack (const void                       *_buffer,
   2177                                       uint16_t                          affectWhich,
   2178                                       uint16_t                          clear,
   2179                                       uint16_t                          selectAll,
   2180                                       xcb_xkb_select_events_details_t  *_aux)
   2181 {
   2182     char *xcb_tmp = (char *)_buffer;
   2183     unsigned int xcb_buffer_len = 0;
   2184     unsigned int xcb_block_len = 0;
   2185     unsigned int xcb_pad = 0;
   2186     unsigned int xcb_align_to = 0;
   2187     unsigned int xcb_padding_offset = 0;
   2188 
   2189 
   2190     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NEW_KEYBOARD_NOTIFY) {
   2191         /* xcb_xkb_select_events_details_t.affectNewKeyboard */
   2192         _aux->affectNewKeyboard = *(uint16_t *)xcb_tmp;
   2193         xcb_block_len += sizeof(uint16_t);
   2194         xcb_tmp += sizeof(uint16_t);
   2195         xcb_align_to = ALIGNOF(uint16_t);
   2196         /* xcb_xkb_select_events_details_t.newKeyboardDetails */
   2197         _aux->newKeyboardDetails = *(uint16_t *)xcb_tmp;
   2198         xcb_block_len += sizeof(uint16_t);
   2199         xcb_tmp += sizeof(uint16_t);
   2200         xcb_align_to = ALIGNOF(uint16_t);
   2201     }
   2202     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_STATE_NOTIFY) {
   2203         /* xcb_xkb_select_events_details_t.affectState */
   2204         _aux->affectState = *(uint16_t *)xcb_tmp;
   2205         xcb_block_len += sizeof(uint16_t);
   2206         xcb_tmp += sizeof(uint16_t);
   2207         xcb_align_to = ALIGNOF(uint16_t);
   2208         /* xcb_xkb_select_events_details_t.stateDetails */
   2209         _aux->stateDetails = *(uint16_t *)xcb_tmp;
   2210         xcb_block_len += sizeof(uint16_t);
   2211         xcb_tmp += sizeof(uint16_t);
   2212         xcb_align_to = ALIGNOF(uint16_t);
   2213     }
   2214     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_CONTROLS_NOTIFY) {
   2215         /* xcb_xkb_select_events_details_t.affectCtrls */
   2216         _aux->affectCtrls = *(uint32_t *)xcb_tmp;
   2217         xcb_block_len += sizeof(uint32_t);
   2218         xcb_tmp += sizeof(uint32_t);
   2219         xcb_align_to = ALIGNOF(uint32_t);
   2220         /* xcb_xkb_select_events_details_t.ctrlDetails */
   2221         _aux->ctrlDetails = *(uint32_t *)xcb_tmp;
   2222         xcb_block_len += sizeof(uint32_t);
   2223         xcb_tmp += sizeof(uint32_t);
   2224         xcb_align_to = ALIGNOF(uint32_t);
   2225     }
   2226     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_STATE_NOTIFY) {
   2227         /* xcb_xkb_select_events_details_t.affectIndicatorState */
   2228         _aux->affectIndicatorState = *(uint32_t *)xcb_tmp;
   2229         xcb_block_len += sizeof(uint32_t);
   2230         xcb_tmp += sizeof(uint32_t);
   2231         xcb_align_to = ALIGNOF(uint32_t);
   2232         /* xcb_xkb_select_events_details_t.indicatorStateDetails */
   2233         _aux->indicatorStateDetails = *(uint32_t *)xcb_tmp;
   2234         xcb_block_len += sizeof(uint32_t);
   2235         xcb_tmp += sizeof(uint32_t);
   2236         xcb_align_to = ALIGNOF(uint32_t);
   2237     }
   2238     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_MAP_NOTIFY) {
   2239         /* xcb_xkb_select_events_details_t.affectIndicatorMap */
   2240         _aux->affectIndicatorMap = *(uint32_t *)xcb_tmp;
   2241         xcb_block_len += sizeof(uint32_t);
   2242         xcb_tmp += sizeof(uint32_t);
   2243         xcb_align_to = ALIGNOF(uint32_t);
   2244         /* xcb_xkb_select_events_details_t.indicatorMapDetails */
   2245         _aux->indicatorMapDetails = *(uint32_t *)xcb_tmp;
   2246         xcb_block_len += sizeof(uint32_t);
   2247         xcb_tmp += sizeof(uint32_t);
   2248         xcb_align_to = ALIGNOF(uint32_t);
   2249     }
   2250     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NAMES_NOTIFY) {
   2251         /* xcb_xkb_select_events_details_t.affectNames */
   2252         _aux->affectNames = *(uint16_t *)xcb_tmp;
   2253         xcb_block_len += sizeof(uint16_t);
   2254         xcb_tmp += sizeof(uint16_t);
   2255         xcb_align_to = ALIGNOF(uint16_t);
   2256         /* xcb_xkb_select_events_details_t.namesDetails */
   2257         _aux->namesDetails = *(uint16_t *)xcb_tmp;
   2258         xcb_block_len += sizeof(uint16_t);
   2259         xcb_tmp += sizeof(uint16_t);
   2260         xcb_align_to = ALIGNOF(uint16_t);
   2261     }
   2262     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_COMPAT_MAP_NOTIFY) {
   2263         /* xcb_xkb_select_events_details_t.affectCompat */
   2264         _aux->affectCompat = *(uint8_t *)xcb_tmp;
   2265         xcb_block_len += sizeof(uint8_t);
   2266         xcb_tmp += sizeof(uint8_t);
   2267         xcb_align_to = ALIGNOF(uint8_t);
   2268         /* xcb_xkb_select_events_details_t.compatDetails */
   2269         _aux->compatDetails = *(uint8_t *)xcb_tmp;
   2270         xcb_block_len += sizeof(uint8_t);
   2271         xcb_tmp += sizeof(uint8_t);
   2272         xcb_align_to = ALIGNOF(uint8_t);
   2273     }
   2274     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_BELL_NOTIFY) {
   2275         /* xcb_xkb_select_events_details_t.affectBell */
   2276         _aux->affectBell = *(uint8_t *)xcb_tmp;
   2277         xcb_block_len += sizeof(uint8_t);
   2278         xcb_tmp += sizeof(uint8_t);
   2279         xcb_align_to = ALIGNOF(uint8_t);
   2280         /* xcb_xkb_select_events_details_t.bellDetails */
   2281         _aux->bellDetails = *(uint8_t *)xcb_tmp;
   2282         xcb_block_len += sizeof(uint8_t);
   2283         xcb_tmp += sizeof(uint8_t);
   2284         xcb_align_to = ALIGNOF(uint8_t);
   2285     }
   2286     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACTION_MESSAGE) {
   2287         /* xcb_xkb_select_events_details_t.affectMsgDetails */
   2288         _aux->affectMsgDetails = *(uint8_t *)xcb_tmp;
   2289         xcb_block_len += sizeof(uint8_t);
   2290         xcb_tmp += sizeof(uint8_t);
   2291         xcb_align_to = ALIGNOF(uint8_t);
   2292         /* xcb_xkb_select_events_details_t.msgDetails */
   2293         _aux->msgDetails = *(uint8_t *)xcb_tmp;
   2294         xcb_block_len += sizeof(uint8_t);
   2295         xcb_tmp += sizeof(uint8_t);
   2296         xcb_align_to = ALIGNOF(uint8_t);
   2297     }
   2298     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACCESS_X_NOTIFY) {
   2299         /* xcb_xkb_select_events_details_t.affectAccessX */
   2300         _aux->affectAccessX = *(uint16_t *)xcb_tmp;
   2301         xcb_block_len += sizeof(uint16_t);
   2302         xcb_tmp += sizeof(uint16_t);
   2303         xcb_align_to = ALIGNOF(uint16_t);
   2304         /* xcb_xkb_select_events_details_t.accessXDetails */
   2305         _aux->accessXDetails = *(uint16_t *)xcb_tmp;
   2306         xcb_block_len += sizeof(uint16_t);
   2307         xcb_tmp += sizeof(uint16_t);
   2308         xcb_align_to = ALIGNOF(uint16_t);
   2309     }
   2310     if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_EXTENSION_DEVICE_NOTIFY) {
   2311         /* xcb_xkb_select_events_details_t.affectExtDev */
   2312         _aux->affectExtDev = *(uint16_t *)xcb_tmp;
   2313         xcb_block_len += sizeof(uint16_t);
   2314         xcb_tmp += sizeof(uint16_t);
   2315         xcb_align_to = ALIGNOF(uint16_t);
   2316         /* xcb_xkb_select_events_details_t.extdevDetails */
   2317         _aux->extdevDetails = *(uint16_t *)xcb_tmp;
   2318         xcb_block_len += sizeof(uint16_t);
   2319         xcb_tmp += sizeof(uint16_t);
   2320         xcb_align_to = ALIGNOF(uint16_t);
   2321     }
   2322     /* insert padding */
   2323     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   2324     xcb_buffer_len += xcb_block_len + xcb_pad;
   2325     if (0 != xcb_pad) {
   2326         xcb_tmp += xcb_pad;
   2327         xcb_pad = 0;
   2328     }
   2329     xcb_block_len = 0;
   2330     xcb_padding_offset = 0;
   2331 
   2332     return xcb_buffer_len;
   2333 }
   2334 
   2335 int
   2336 xcb_xkb_select_events_details_sizeof (const void  *_buffer,
   2337                                       uint16_t     affectWhich,
   2338                                       uint16_t     clear,
   2339                                       uint16_t     selectAll)
   2340 {
   2341     xcb_xkb_select_events_details_t _aux;
   2342     return xcb_xkb_select_events_details_unpack(_buffer, affectWhich, clear, selectAll, &_aux);
   2343 }
   2344 
   2345 int
   2346 xcb_xkb_select_events_sizeof (const void  *_buffer)
   2347 {
   2348     char *xcb_tmp = (char *)_buffer;
   2349     const xcb_xkb_select_events_request_t *_aux = (xcb_xkb_select_events_request_t *)_buffer;
   2350     unsigned int xcb_buffer_len = 0;
   2351     unsigned int xcb_block_len = 0;
   2352     unsigned int xcb_pad = 0;
   2353     unsigned int xcb_align_to = 0;
   2354 
   2355 
   2356     xcb_block_len += sizeof(xcb_xkb_select_events_request_t);
   2357     xcb_tmp += xcb_block_len;
   2358     xcb_buffer_len += xcb_block_len;
   2359     xcb_block_len = 0;
   2360     /* details */
   2361     xcb_block_len += xcb_xkb_select_events_details_sizeof(xcb_tmp, _aux->affectWhich, _aux->clear, _aux->selectAll);
   2362     xcb_tmp += xcb_block_len;
   2363     xcb_align_to = ALIGNOF(char);
   2364     /* insert padding */
   2365     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   2366     xcb_buffer_len += xcb_block_len + xcb_pad;
   2367     if (0 != xcb_pad) {
   2368         xcb_tmp += xcb_pad;
   2369         xcb_pad = 0;
   2370     }
   2371     xcb_block_len = 0;
   2372 
   2373     return xcb_buffer_len;
   2374 }
   2375 
   2376 xcb_void_cookie_t
   2377 xcb_xkb_select_events_checked (xcb_connection_t      *c,
   2378                                xcb_xkb_device_spec_t  deviceSpec,
   2379                                uint16_t               affectWhich,
   2380                                uint16_t               clear,
   2381                                uint16_t               selectAll,
   2382                                uint16_t               affectMap,
   2383                                uint16_t               map,
   2384                                const void            *details)
   2385 {
   2386     static const xcb_protocol_request_t xcb_req = {
   2387         .count = 3,
   2388         .ext = &xcb_xkb_id,
   2389         .opcode = XCB_XKB_SELECT_EVENTS,
   2390         .isvoid = 1
   2391     };
   2392 
   2393     struct iovec xcb_parts[5];
   2394     xcb_void_cookie_t xcb_ret;
   2395     xcb_xkb_select_events_request_t xcb_out;
   2396 
   2397     xcb_out.deviceSpec = deviceSpec;
   2398     xcb_out.affectWhich = affectWhich;
   2399     xcb_out.clear = clear;
   2400     xcb_out.selectAll = selectAll;
   2401     xcb_out.affectMap = affectMap;
   2402     xcb_out.map = map;
   2403 
   2404     xcb_parts[2].iov_base = (char *) &xcb_out;
   2405     xcb_parts[2].iov_len = sizeof(xcb_out);
   2406     xcb_parts[3].iov_base = 0;
   2407     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2408     /* xcb_xkb_select_events_details_t details */
   2409     xcb_parts[4].iov_base = (char *) details;
   2410     xcb_parts[4].iov_len =
   2411       xcb_xkb_select_events_details_sizeof (details, affectWhich, clear, selectAll);
   2412 
   2413     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2414     return xcb_ret;
   2415 }
   2416 
   2417 xcb_void_cookie_t
   2418 xcb_xkb_select_events (xcb_connection_t      *c,
   2419                        xcb_xkb_device_spec_t  deviceSpec,
   2420                        uint16_t               affectWhich,
   2421                        uint16_t               clear,
   2422                        uint16_t               selectAll,
   2423                        uint16_t               affectMap,
   2424                        uint16_t               map,
   2425                        const void            *details)
   2426 {
   2427     static const xcb_protocol_request_t xcb_req = {
   2428         .count = 3,
   2429         .ext = &xcb_xkb_id,
   2430         .opcode = XCB_XKB_SELECT_EVENTS,
   2431         .isvoid = 1
   2432     };
   2433 
   2434     struct iovec xcb_parts[5];
   2435     xcb_void_cookie_t xcb_ret;
   2436     xcb_xkb_select_events_request_t xcb_out;
   2437 
   2438     xcb_out.deviceSpec = deviceSpec;
   2439     xcb_out.affectWhich = affectWhich;
   2440     xcb_out.clear = clear;
   2441     xcb_out.selectAll = selectAll;
   2442     xcb_out.affectMap = affectMap;
   2443     xcb_out.map = map;
   2444 
   2445     xcb_parts[2].iov_base = (char *) &xcb_out;
   2446     xcb_parts[2].iov_len = sizeof(xcb_out);
   2447     xcb_parts[3].iov_base = 0;
   2448     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2449     /* xcb_xkb_select_events_details_t details */
   2450     xcb_parts[4].iov_base = (char *) details;
   2451     xcb_parts[4].iov_len =
   2452       xcb_xkb_select_events_details_sizeof (details, affectWhich, clear, selectAll);
   2453 
   2454     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2455     return xcb_ret;
   2456 }
   2457 
   2458 xcb_void_cookie_t
   2459 xcb_xkb_select_events_aux_checked (xcb_connection_t                      *c,
   2460                                    xcb_xkb_device_spec_t                  deviceSpec,
   2461                                    uint16_t                               affectWhich,
   2462                                    uint16_t                               clear,
   2463                                    uint16_t                               selectAll,
   2464                                    uint16_t                               affectMap,
   2465                                    uint16_t                               map,
   2466                                    const xcb_xkb_select_events_details_t *details)
   2467 {
   2468     static const xcb_protocol_request_t xcb_req = {
   2469         .count = 3,
   2470         .ext = &xcb_xkb_id,
   2471         .opcode = XCB_XKB_SELECT_EVENTS,
   2472         .isvoid = 1
   2473     };
   2474 
   2475     struct iovec xcb_parts[5];
   2476     xcb_void_cookie_t xcb_ret;
   2477     xcb_xkb_select_events_request_t xcb_out;
   2478     void *xcb_aux0 = 0;
   2479 
   2480     xcb_out.deviceSpec = deviceSpec;
   2481     xcb_out.affectWhich = affectWhich;
   2482     xcb_out.clear = clear;
   2483     xcb_out.selectAll = selectAll;
   2484     xcb_out.affectMap = affectMap;
   2485     xcb_out.map = map;
   2486 
   2487     xcb_parts[2].iov_base = (char *) &xcb_out;
   2488     xcb_parts[2].iov_len = sizeof(xcb_out);
   2489     xcb_parts[3].iov_base = 0;
   2490     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2491     /* xcb_xkb_select_events_details_t details */
   2492     xcb_parts[4].iov_len =
   2493       xcb_xkb_select_events_details_serialize (&xcb_aux0, affectWhich, clear, selectAll, details);
   2494     xcb_parts[4].iov_base = xcb_aux0;
   2495 
   2496     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2497     free(xcb_aux0);
   2498     return xcb_ret;
   2499 }
   2500 
   2501 xcb_void_cookie_t
   2502 xcb_xkb_select_events_aux (xcb_connection_t                      *c,
   2503                            xcb_xkb_device_spec_t                  deviceSpec,
   2504                            uint16_t                               affectWhich,
   2505                            uint16_t                               clear,
   2506                            uint16_t                               selectAll,
   2507                            uint16_t                               affectMap,
   2508                            uint16_t                               map,
   2509                            const xcb_xkb_select_events_details_t *details)
   2510 {
   2511     static const xcb_protocol_request_t xcb_req = {
   2512         .count = 3,
   2513         .ext = &xcb_xkb_id,
   2514         .opcode = XCB_XKB_SELECT_EVENTS,
   2515         .isvoid = 1
   2516     };
   2517 
   2518     struct iovec xcb_parts[5];
   2519     xcb_void_cookie_t xcb_ret;
   2520     xcb_xkb_select_events_request_t xcb_out;
   2521     void *xcb_aux0 = 0;
   2522 
   2523     xcb_out.deviceSpec = deviceSpec;
   2524     xcb_out.affectWhich = affectWhich;
   2525     xcb_out.clear = clear;
   2526     xcb_out.selectAll = selectAll;
   2527     xcb_out.affectMap = affectMap;
   2528     xcb_out.map = map;
   2529 
   2530     xcb_parts[2].iov_base = (char *) &xcb_out;
   2531     xcb_parts[2].iov_len = sizeof(xcb_out);
   2532     xcb_parts[3].iov_base = 0;
   2533     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2534     /* xcb_xkb_select_events_details_t details */
   2535     xcb_parts[4].iov_len =
   2536       xcb_xkb_select_events_details_serialize (&xcb_aux0, affectWhich, clear, selectAll, details);
   2537     xcb_parts[4].iov_base = xcb_aux0;
   2538 
   2539     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2540     free(xcb_aux0);
   2541     return xcb_ret;
   2542 }
   2543 
   2544 void *
   2545 xcb_xkb_select_events_details (const xcb_xkb_select_events_request_t *R)
   2546 {
   2547     return (void *) (R + 1);
   2548 }
   2549 
   2550 xcb_void_cookie_t
   2551 xcb_xkb_bell_checked (xcb_connection_t          *c,
   2552                       xcb_xkb_device_spec_t      deviceSpec,
   2553                       xcb_xkb_bell_class_spec_t  bellClass,
   2554                       xcb_xkb_id_spec_t          bellID,
   2555                       int8_t                     percent,
   2556                       uint8_t                    forceSound,
   2557                       uint8_t                    eventOnly,
   2558                       int16_t                    pitch,
   2559                       int16_t                    duration,
   2560                       xcb_atom_t                 name,
   2561                       xcb_window_t               window)
   2562 {
   2563     static const xcb_protocol_request_t xcb_req = {
   2564         .count = 2,
   2565         .ext = &xcb_xkb_id,
   2566         .opcode = XCB_XKB_BELL,
   2567         .isvoid = 1
   2568     };
   2569 
   2570     struct iovec xcb_parts[4];
   2571     xcb_void_cookie_t xcb_ret;
   2572     xcb_xkb_bell_request_t xcb_out;
   2573 
   2574     xcb_out.deviceSpec = deviceSpec;
   2575     xcb_out.bellClass = bellClass;
   2576     xcb_out.bellID = bellID;
   2577     xcb_out.percent = percent;
   2578     xcb_out.forceSound = forceSound;
   2579     xcb_out.eventOnly = eventOnly;
   2580     xcb_out.pad0 = 0;
   2581     xcb_out.pitch = pitch;
   2582     xcb_out.duration = duration;
   2583     memset(xcb_out.pad1, 0, 2);
   2584     xcb_out.name = name;
   2585     xcb_out.window = window;
   2586 
   2587     xcb_parts[2].iov_base = (char *) &xcb_out;
   2588     xcb_parts[2].iov_len = sizeof(xcb_out);
   2589     xcb_parts[3].iov_base = 0;
   2590     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2591 
   2592     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2593     return xcb_ret;
   2594 }
   2595 
   2596 xcb_void_cookie_t
   2597 xcb_xkb_bell (xcb_connection_t          *c,
   2598               xcb_xkb_device_spec_t      deviceSpec,
   2599               xcb_xkb_bell_class_spec_t  bellClass,
   2600               xcb_xkb_id_spec_t          bellID,
   2601               int8_t                     percent,
   2602               uint8_t                    forceSound,
   2603               uint8_t                    eventOnly,
   2604               int16_t                    pitch,
   2605               int16_t                    duration,
   2606               xcb_atom_t                 name,
   2607               xcb_window_t               window)
   2608 {
   2609     static const xcb_protocol_request_t xcb_req = {
   2610         .count = 2,
   2611         .ext = &xcb_xkb_id,
   2612         .opcode = XCB_XKB_BELL,
   2613         .isvoid = 1
   2614     };
   2615 
   2616     struct iovec xcb_parts[4];
   2617     xcb_void_cookie_t xcb_ret;
   2618     xcb_xkb_bell_request_t xcb_out;
   2619 
   2620     xcb_out.deviceSpec = deviceSpec;
   2621     xcb_out.bellClass = bellClass;
   2622     xcb_out.bellID = bellID;
   2623     xcb_out.percent = percent;
   2624     xcb_out.forceSound = forceSound;
   2625     xcb_out.eventOnly = eventOnly;
   2626     xcb_out.pad0 = 0;
   2627     xcb_out.pitch = pitch;
   2628     xcb_out.duration = duration;
   2629     memset(xcb_out.pad1, 0, 2);
   2630     xcb_out.name = name;
   2631     xcb_out.window = window;
   2632 
   2633     xcb_parts[2].iov_base = (char *) &xcb_out;
   2634     xcb_parts[2].iov_len = sizeof(xcb_out);
   2635     xcb_parts[3].iov_base = 0;
   2636     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2637 
   2638     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2639     return xcb_ret;
   2640 }
   2641 
   2642 xcb_xkb_get_state_cookie_t
   2643 xcb_xkb_get_state (xcb_connection_t      *c,
   2644                    xcb_xkb_device_spec_t  deviceSpec)
   2645 {
   2646     static const xcb_protocol_request_t xcb_req = {
   2647         .count = 2,
   2648         .ext = &xcb_xkb_id,
   2649         .opcode = XCB_XKB_GET_STATE,
   2650         .isvoid = 0
   2651     };
   2652 
   2653     struct iovec xcb_parts[4];
   2654     xcb_xkb_get_state_cookie_t xcb_ret;
   2655     xcb_xkb_get_state_request_t xcb_out;
   2656 
   2657     xcb_out.deviceSpec = deviceSpec;
   2658     memset(xcb_out.pad0, 0, 2);
   2659 
   2660     xcb_parts[2].iov_base = (char *) &xcb_out;
   2661     xcb_parts[2].iov_len = sizeof(xcb_out);
   2662     xcb_parts[3].iov_base = 0;
   2663     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2664 
   2665     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2666     return xcb_ret;
   2667 }
   2668 
   2669 xcb_xkb_get_state_cookie_t
   2670 xcb_xkb_get_state_unchecked (xcb_connection_t      *c,
   2671                              xcb_xkb_device_spec_t  deviceSpec)
   2672 {
   2673     static const xcb_protocol_request_t xcb_req = {
   2674         .count = 2,
   2675         .ext = &xcb_xkb_id,
   2676         .opcode = XCB_XKB_GET_STATE,
   2677         .isvoid = 0
   2678     };
   2679 
   2680     struct iovec xcb_parts[4];
   2681     xcb_xkb_get_state_cookie_t xcb_ret;
   2682     xcb_xkb_get_state_request_t xcb_out;
   2683 
   2684     xcb_out.deviceSpec = deviceSpec;
   2685     memset(xcb_out.pad0, 0, 2);
   2686 
   2687     xcb_parts[2].iov_base = (char *) &xcb_out;
   2688     xcb_parts[2].iov_len = sizeof(xcb_out);
   2689     xcb_parts[3].iov_base = 0;
   2690     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2691 
   2692     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2693     return xcb_ret;
   2694 }
   2695 
   2696 xcb_xkb_get_state_reply_t *
   2697 xcb_xkb_get_state_reply (xcb_connection_t            *c,
   2698                          xcb_xkb_get_state_cookie_t   cookie  /**< */,
   2699                          xcb_generic_error_t        **e)
   2700 {
   2701     return (xcb_xkb_get_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   2702 }
   2703 
   2704 xcb_void_cookie_t
   2705 xcb_xkb_latch_lock_state_checked (xcb_connection_t      *c,
   2706                                   xcb_xkb_device_spec_t  deviceSpec,
   2707                                   uint8_t                affectModLocks,
   2708                                   uint8_t                modLocks,
   2709                                   uint8_t                lockGroup,
   2710                                   uint8_t                groupLock,
   2711                                   uint8_t                affectModLatches,
   2712                                   uint8_t                latchGroup,
   2713                                   uint16_t               groupLatch)
   2714 {
   2715     static const xcb_protocol_request_t xcb_req = {
   2716         .count = 2,
   2717         .ext = &xcb_xkb_id,
   2718         .opcode = XCB_XKB_LATCH_LOCK_STATE,
   2719         .isvoid = 1
   2720     };
   2721 
   2722     struct iovec xcb_parts[4];
   2723     xcb_void_cookie_t xcb_ret;
   2724     xcb_xkb_latch_lock_state_request_t xcb_out;
   2725 
   2726     xcb_out.deviceSpec = deviceSpec;
   2727     xcb_out.affectModLocks = affectModLocks;
   2728     xcb_out.modLocks = modLocks;
   2729     xcb_out.lockGroup = lockGroup;
   2730     xcb_out.groupLock = groupLock;
   2731     xcb_out.affectModLatches = affectModLatches;
   2732     xcb_out.pad0 = 0;
   2733     xcb_out.pad1 = 0;
   2734     xcb_out.latchGroup = latchGroup;
   2735     xcb_out.groupLatch = groupLatch;
   2736 
   2737     xcb_parts[2].iov_base = (char *) &xcb_out;
   2738     xcb_parts[2].iov_len = sizeof(xcb_out);
   2739     xcb_parts[3].iov_base = 0;
   2740     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2741 
   2742     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2743     return xcb_ret;
   2744 }
   2745 
   2746 xcb_void_cookie_t
   2747 xcb_xkb_latch_lock_state (xcb_connection_t      *c,
   2748                           xcb_xkb_device_spec_t  deviceSpec,
   2749                           uint8_t                affectModLocks,
   2750                           uint8_t                modLocks,
   2751                           uint8_t                lockGroup,
   2752                           uint8_t                groupLock,
   2753                           uint8_t                affectModLatches,
   2754                           uint8_t                latchGroup,
   2755                           uint16_t               groupLatch)
   2756 {
   2757     static const xcb_protocol_request_t xcb_req = {
   2758         .count = 2,
   2759         .ext = &xcb_xkb_id,
   2760         .opcode = XCB_XKB_LATCH_LOCK_STATE,
   2761         .isvoid = 1
   2762     };
   2763 
   2764     struct iovec xcb_parts[4];
   2765     xcb_void_cookie_t xcb_ret;
   2766     xcb_xkb_latch_lock_state_request_t xcb_out;
   2767 
   2768     xcb_out.deviceSpec = deviceSpec;
   2769     xcb_out.affectModLocks = affectModLocks;
   2770     xcb_out.modLocks = modLocks;
   2771     xcb_out.lockGroup = lockGroup;
   2772     xcb_out.groupLock = groupLock;
   2773     xcb_out.affectModLatches = affectModLatches;
   2774     xcb_out.pad0 = 0;
   2775     xcb_out.pad1 = 0;
   2776     xcb_out.latchGroup = latchGroup;
   2777     xcb_out.groupLatch = groupLatch;
   2778 
   2779     xcb_parts[2].iov_base = (char *) &xcb_out;
   2780     xcb_parts[2].iov_len = sizeof(xcb_out);
   2781     xcb_parts[3].iov_base = 0;
   2782     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2783 
   2784     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2785     return xcb_ret;
   2786 }
   2787 
   2788 xcb_xkb_get_controls_cookie_t
   2789 xcb_xkb_get_controls (xcb_connection_t      *c,
   2790                       xcb_xkb_device_spec_t  deviceSpec)
   2791 {
   2792     static const xcb_protocol_request_t xcb_req = {
   2793         .count = 2,
   2794         .ext = &xcb_xkb_id,
   2795         .opcode = XCB_XKB_GET_CONTROLS,
   2796         .isvoid = 0
   2797     };
   2798 
   2799     struct iovec xcb_parts[4];
   2800     xcb_xkb_get_controls_cookie_t xcb_ret;
   2801     xcb_xkb_get_controls_request_t xcb_out;
   2802 
   2803     xcb_out.deviceSpec = deviceSpec;
   2804     memset(xcb_out.pad0, 0, 2);
   2805 
   2806     xcb_parts[2].iov_base = (char *) &xcb_out;
   2807     xcb_parts[2].iov_len = sizeof(xcb_out);
   2808     xcb_parts[3].iov_base = 0;
   2809     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2810 
   2811     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2812     return xcb_ret;
   2813 }
   2814 
   2815 xcb_xkb_get_controls_cookie_t
   2816 xcb_xkb_get_controls_unchecked (xcb_connection_t      *c,
   2817                                 xcb_xkb_device_spec_t  deviceSpec)
   2818 {
   2819     static const xcb_protocol_request_t xcb_req = {
   2820         .count = 2,
   2821         .ext = &xcb_xkb_id,
   2822         .opcode = XCB_XKB_GET_CONTROLS,
   2823         .isvoid = 0
   2824     };
   2825 
   2826     struct iovec xcb_parts[4];
   2827     xcb_xkb_get_controls_cookie_t xcb_ret;
   2828     xcb_xkb_get_controls_request_t xcb_out;
   2829 
   2830     xcb_out.deviceSpec = deviceSpec;
   2831     memset(xcb_out.pad0, 0, 2);
   2832 
   2833     xcb_parts[2].iov_base = (char *) &xcb_out;
   2834     xcb_parts[2].iov_len = sizeof(xcb_out);
   2835     xcb_parts[3].iov_base = 0;
   2836     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2837 
   2838     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2839     return xcb_ret;
   2840 }
   2841 
   2842 xcb_xkb_get_controls_reply_t *
   2843 xcb_xkb_get_controls_reply (xcb_connection_t               *c,
   2844                             xcb_xkb_get_controls_cookie_t   cookie  /**< */,
   2845                             xcb_generic_error_t           **e)
   2846 {
   2847     return (xcb_xkb_get_controls_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   2848 }
   2849 
   2850 xcb_void_cookie_t
   2851 xcb_xkb_set_controls_checked (xcb_connection_t      *c,
   2852                               xcb_xkb_device_spec_t  deviceSpec,
   2853                               uint8_t                affectInternalRealMods,
   2854                               uint8_t                internalRealMods,
   2855                               uint8_t                affectIgnoreLockRealMods,
   2856                               uint8_t                ignoreLockRealMods,
   2857                               uint16_t               affectInternalVirtualMods,
   2858                               uint16_t               internalVirtualMods,
   2859                               uint16_t               affectIgnoreLockVirtualMods,
   2860                               uint16_t               ignoreLockVirtualMods,
   2861                               uint8_t                mouseKeysDfltBtn,
   2862                               uint8_t                groupsWrap,
   2863                               uint16_t               accessXOptions,
   2864                               uint32_t               affectEnabledControls,
   2865                               uint32_t               enabledControls,
   2866                               uint32_t               changeControls,
   2867                               uint16_t               repeatDelay,
   2868                               uint16_t               repeatInterval,
   2869                               uint16_t               slowKeysDelay,
   2870                               uint16_t               debounceDelay,
   2871                               uint16_t               mouseKeysDelay,
   2872                               uint16_t               mouseKeysInterval,
   2873                               uint16_t               mouseKeysTimeToMax,
   2874                               uint16_t               mouseKeysMaxSpeed,
   2875                               int16_t                mouseKeysCurve,
   2876                               uint16_t               accessXTimeout,
   2877                               uint32_t               accessXTimeoutMask,
   2878                               uint32_t               accessXTimeoutValues,
   2879                               uint16_t               accessXTimeoutOptionsMask,
   2880                               uint16_t               accessXTimeoutOptionsValues,
   2881                               const uint8_t         *perKeyRepeat)
   2882 {
   2883     static const xcb_protocol_request_t xcb_req = {
   2884         .count = 2,
   2885         .ext = &xcb_xkb_id,
   2886         .opcode = XCB_XKB_SET_CONTROLS,
   2887         .isvoid = 1
   2888     };
   2889 
   2890     struct iovec xcb_parts[4];
   2891     xcb_void_cookie_t xcb_ret;
   2892     xcb_xkb_set_controls_request_t xcb_out;
   2893 
   2894     xcb_out.deviceSpec = deviceSpec;
   2895     xcb_out.affectInternalRealMods = affectInternalRealMods;
   2896     xcb_out.internalRealMods = internalRealMods;
   2897     xcb_out.affectIgnoreLockRealMods = affectIgnoreLockRealMods;
   2898     xcb_out.ignoreLockRealMods = ignoreLockRealMods;
   2899     xcb_out.affectInternalVirtualMods = affectInternalVirtualMods;
   2900     xcb_out.internalVirtualMods = internalVirtualMods;
   2901     xcb_out.affectIgnoreLockVirtualMods = affectIgnoreLockVirtualMods;
   2902     xcb_out.ignoreLockVirtualMods = ignoreLockVirtualMods;
   2903     xcb_out.mouseKeysDfltBtn = mouseKeysDfltBtn;
   2904     xcb_out.groupsWrap = groupsWrap;
   2905     xcb_out.accessXOptions = accessXOptions;
   2906     memset(xcb_out.pad0, 0, 2);
   2907     xcb_out.affectEnabledControls = affectEnabledControls;
   2908     xcb_out.enabledControls = enabledControls;
   2909     xcb_out.changeControls = changeControls;
   2910     xcb_out.repeatDelay = repeatDelay;
   2911     xcb_out.repeatInterval = repeatInterval;
   2912     xcb_out.slowKeysDelay = slowKeysDelay;
   2913     xcb_out.debounceDelay = debounceDelay;
   2914     xcb_out.mouseKeysDelay = mouseKeysDelay;
   2915     xcb_out.mouseKeysInterval = mouseKeysInterval;
   2916     xcb_out.mouseKeysTimeToMax = mouseKeysTimeToMax;
   2917     xcb_out.mouseKeysMaxSpeed = mouseKeysMaxSpeed;
   2918     xcb_out.mouseKeysCurve = mouseKeysCurve;
   2919     xcb_out.accessXTimeout = accessXTimeout;
   2920     xcb_out.accessXTimeoutMask = accessXTimeoutMask;
   2921     xcb_out.accessXTimeoutValues = accessXTimeoutValues;
   2922     xcb_out.accessXTimeoutOptionsMask = accessXTimeoutOptionsMask;
   2923     xcb_out.accessXTimeoutOptionsValues = accessXTimeoutOptionsValues;
   2924     memcpy(xcb_out.perKeyRepeat, perKeyRepeat, 32);
   2925 
   2926     xcb_parts[2].iov_base = (char *) &xcb_out;
   2927     xcb_parts[2].iov_len = sizeof(xcb_out);
   2928     xcb_parts[3].iov_base = 0;
   2929     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2930 
   2931     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2932     return xcb_ret;
   2933 }
   2934 
   2935 xcb_void_cookie_t
   2936 xcb_xkb_set_controls (xcb_connection_t      *c,
   2937                       xcb_xkb_device_spec_t  deviceSpec,
   2938                       uint8_t                affectInternalRealMods,
   2939                       uint8_t                internalRealMods,
   2940                       uint8_t                affectIgnoreLockRealMods,
   2941                       uint8_t                ignoreLockRealMods,
   2942                       uint16_t               affectInternalVirtualMods,
   2943                       uint16_t               internalVirtualMods,
   2944                       uint16_t               affectIgnoreLockVirtualMods,
   2945                       uint16_t               ignoreLockVirtualMods,
   2946                       uint8_t                mouseKeysDfltBtn,
   2947                       uint8_t                groupsWrap,
   2948                       uint16_t               accessXOptions,
   2949                       uint32_t               affectEnabledControls,
   2950                       uint32_t               enabledControls,
   2951                       uint32_t               changeControls,
   2952                       uint16_t               repeatDelay,
   2953                       uint16_t               repeatInterval,
   2954                       uint16_t               slowKeysDelay,
   2955                       uint16_t               debounceDelay,
   2956                       uint16_t               mouseKeysDelay,
   2957                       uint16_t               mouseKeysInterval,
   2958                       uint16_t               mouseKeysTimeToMax,
   2959                       uint16_t               mouseKeysMaxSpeed,
   2960                       int16_t                mouseKeysCurve,
   2961                       uint16_t               accessXTimeout,
   2962                       uint32_t               accessXTimeoutMask,
   2963                       uint32_t               accessXTimeoutValues,
   2964                       uint16_t               accessXTimeoutOptionsMask,
   2965                       uint16_t               accessXTimeoutOptionsValues,
   2966                       const uint8_t         *perKeyRepeat)
   2967 {
   2968     static const xcb_protocol_request_t xcb_req = {
   2969         .count = 2,
   2970         .ext = &xcb_xkb_id,
   2971         .opcode = XCB_XKB_SET_CONTROLS,
   2972         .isvoid = 1
   2973     };
   2974 
   2975     struct iovec xcb_parts[4];
   2976     xcb_void_cookie_t xcb_ret;
   2977     xcb_xkb_set_controls_request_t xcb_out;
   2978 
   2979     xcb_out.deviceSpec = deviceSpec;
   2980     xcb_out.affectInternalRealMods = affectInternalRealMods;
   2981     xcb_out.internalRealMods = internalRealMods;
   2982     xcb_out.affectIgnoreLockRealMods = affectIgnoreLockRealMods;
   2983     xcb_out.ignoreLockRealMods = ignoreLockRealMods;
   2984     xcb_out.affectInternalVirtualMods = affectInternalVirtualMods;
   2985     xcb_out.internalVirtualMods = internalVirtualMods;
   2986     xcb_out.affectIgnoreLockVirtualMods = affectIgnoreLockVirtualMods;
   2987     xcb_out.ignoreLockVirtualMods = ignoreLockVirtualMods;
   2988     xcb_out.mouseKeysDfltBtn = mouseKeysDfltBtn;
   2989     xcb_out.groupsWrap = groupsWrap;
   2990     xcb_out.accessXOptions = accessXOptions;
   2991     memset(xcb_out.pad0, 0, 2);
   2992     xcb_out.affectEnabledControls = affectEnabledControls;
   2993     xcb_out.enabledControls = enabledControls;
   2994     xcb_out.changeControls = changeControls;
   2995     xcb_out.repeatDelay = repeatDelay;
   2996     xcb_out.repeatInterval = repeatInterval;
   2997     xcb_out.slowKeysDelay = slowKeysDelay;
   2998     xcb_out.debounceDelay = debounceDelay;
   2999     xcb_out.mouseKeysDelay = mouseKeysDelay;
   3000     xcb_out.mouseKeysInterval = mouseKeysInterval;
   3001     xcb_out.mouseKeysTimeToMax = mouseKeysTimeToMax;
   3002     xcb_out.mouseKeysMaxSpeed = mouseKeysMaxSpeed;
   3003     xcb_out.mouseKeysCurve = mouseKeysCurve;
   3004     xcb_out.accessXTimeout = accessXTimeout;
   3005     xcb_out.accessXTimeoutMask = accessXTimeoutMask;
   3006     xcb_out.accessXTimeoutValues = accessXTimeoutValues;
   3007     xcb_out.accessXTimeoutOptionsMask = accessXTimeoutOptionsMask;
   3008     xcb_out.accessXTimeoutOptionsValues = accessXTimeoutOptionsValues;
   3009     memcpy(xcb_out.perKeyRepeat, perKeyRepeat, 32);
   3010 
   3011     xcb_parts[2].iov_base = (char *) &xcb_out;
   3012     xcb_parts[2].iov_len = sizeof(xcb_out);
   3013     xcb_parts[3].iov_base = 0;
   3014     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   3015 
   3016     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   3017     return xcb_ret;
   3018 }
   3019 
   3020 int
   3021 xcb_xkb_get_map_map_types_rtrn_length (const xcb_xkb_get_map_reply_t *R,
   3022                                        const xcb_xkb_get_map_map_t *S)
   3023 {
   3024     return R->nTypes;
   3025 }
   3026 
   3027 xcb_xkb_key_type_iterator_t
   3028 xcb_xkb_get_map_map_types_rtrn_iterator (const xcb_xkb_get_map_reply_t *R,
   3029                                          const xcb_xkb_get_map_map_t *S)
   3030 {
   3031     xcb_xkb_key_type_iterator_t i;
   3032     i.data = S->types_rtrn;
   3033     i.rem = R->nTypes;
   3034     i.index = (char *) i.data - (char *) S;
   3035     return i;
   3036 }
   3037 
   3038 int
   3039 xcb_xkb_get_map_map_syms_rtrn_length (const xcb_xkb_get_map_reply_t *R,
   3040                                       const xcb_xkb_get_map_map_t *S)
   3041 {
   3042     return R->nKeySyms;
   3043 }
   3044 
   3045 xcb_xkb_key_sym_map_iterator_t
   3046 xcb_xkb_get_map_map_syms_rtrn_iterator (const xcb_xkb_get_map_reply_t *R,
   3047                                         const xcb_xkb_get_map_map_t *S)
   3048 {
   3049     xcb_xkb_key_sym_map_iterator_t i;
   3050     i.data = S->syms_rtrn;
   3051     i.rem = R->nKeySyms;
   3052     i.index = (char *) i.data - (char *) S;
   3053     return i;
   3054 }
   3055 
   3056 uint8_t *
   3057 xcb_xkb_get_map_map_acts_rtrn_count (const xcb_xkb_get_map_map_t *S)
   3058 {
   3059     return S->acts_rtrn_count;
   3060 }
   3061 
   3062 int
   3063 xcb_xkb_get_map_map_acts_rtrn_count_length (const xcb_xkb_get_map_reply_t *R,
   3064                                             const xcb_xkb_get_map_map_t *S)
   3065 {
   3066     return R->nKeyActions;
   3067 }
   3068 
   3069 xcb_generic_iterator_t
   3070 xcb_xkb_get_map_map_acts_rtrn_count_end (const xcb_xkb_get_map_reply_t *R,
   3071                                          const xcb_xkb_get_map_map_t *S)
   3072 {
   3073     xcb_generic_iterator_t i;
   3074     i.data = S->acts_rtrn_count + R->nKeyActions;
   3075     i.rem = 0;
   3076     i.index = (char *) i.data - (char *) S;
   3077     return i;
   3078 }
   3079 
   3080 xcb_xkb_action_t *
   3081 xcb_xkb_get_map_map_acts_rtrn_acts (const xcb_xkb_get_map_map_t *S)
   3082 {
   3083     return S->acts_rtrn_acts;
   3084 }
   3085 
   3086 int
   3087 xcb_xkb_get_map_map_acts_rtrn_acts_length (const xcb_xkb_get_map_reply_t *R,
   3088                                            const xcb_xkb_get_map_map_t *S)
   3089 {
   3090     return R->totalActions;
   3091 }
   3092 
   3093 xcb_xkb_action_iterator_t
   3094 xcb_xkb_get_map_map_acts_rtrn_acts_iterator (const xcb_xkb_get_map_reply_t *R,
   3095                                              const xcb_xkb_get_map_map_t *S)
   3096 {
   3097     xcb_xkb_action_iterator_t i;
   3098     i.data = S->acts_rtrn_acts;
   3099     i.rem = R->totalActions;
   3100     i.index = (char *) i.data - (char *) S;
   3101     return i;
   3102 }
   3103 
   3104 xcb_xkb_set_behavior_t *
   3105 xcb_xkb_get_map_map_behaviors_rtrn (const xcb_xkb_get_map_map_t *S)
   3106 {
   3107     return S->behaviors_rtrn;
   3108 }
   3109 
   3110 int
   3111 xcb_xkb_get_map_map_behaviors_rtrn_length (const xcb_xkb_get_map_reply_t *R,
   3112                                            const xcb_xkb_get_map_map_t *S)
   3113 {
   3114     return R->totalKeyBehaviors;
   3115 }
   3116 
   3117 xcb_xkb_set_behavior_iterator_t
   3118 xcb_xkb_get_map_map_behaviors_rtrn_iterator (const xcb_xkb_get_map_reply_t *R,
   3119                                              const xcb_xkb_get_map_map_t *S)
   3120 {
   3121     xcb_xkb_set_behavior_iterator_t i;
   3122     i.data = S->behaviors_rtrn;
   3123     i.rem = R->totalKeyBehaviors;
   3124     i.index = (char *) i.data - (char *) S;
   3125     return i;
   3126 }
   3127 
   3128 uint8_t *
   3129 xcb_xkb_get_map_map_vmods_rtrn (const xcb_xkb_get_map_map_t *S)
   3130 {
   3131     return S->vmods_rtrn;
   3132 }
   3133 
   3134 int
   3135 xcb_xkb_get_map_map_vmods_rtrn_length (const xcb_xkb_get_map_reply_t *R,
   3136                                        const xcb_xkb_get_map_map_t *S)
   3137 {
   3138     return xcb_popcount(R->virtualMods);
   3139 }
   3140 
   3141 xcb_generic_iterator_t
   3142 xcb_xkb_get_map_map_vmods_rtrn_end (const xcb_xkb_get_map_reply_t *R,
   3143                                     const xcb_xkb_get_map_map_t *S)
   3144 {
   3145     xcb_generic_iterator_t i;
   3146     i.data = S->vmods_rtrn + xcb_popcount(R->virtualMods);
   3147     i.rem = 0;
   3148     i.index = (char *) i.data - (char *) S;
   3149     return i;
   3150 }
   3151 
   3152 xcb_xkb_set_explicit_t *
   3153 xcb_xkb_get_map_map_explicit_rtrn (const xcb_xkb_get_map_map_t *S)
   3154 {
   3155     return S->explicit_rtrn;
   3156 }
   3157 
   3158 int
   3159 xcb_xkb_get_map_map_explicit_rtrn_length (const xcb_xkb_get_map_reply_t *R,
   3160                                           const xcb_xkb_get_map_map_t *S)
   3161 {
   3162     return R->totalKeyExplicit;
   3163 }
   3164 
   3165 xcb_xkb_set_explicit_iterator_t
   3166 xcb_xkb_get_map_map_explicit_rtrn_iterator (const xcb_xkb_get_map_reply_t *R,
   3167                                             const xcb_xkb_get_map_map_t *S)
   3168 {
   3169     xcb_xkb_set_explicit_iterator_t i;
   3170     i.data = S->explicit_rtrn;
   3171     i.rem = R->totalKeyExplicit;
   3172     i.index = (char *) i.data - (char *) S;
   3173     return i;
   3174 }
   3175 
   3176 xcb_xkb_key_mod_map_t *
   3177 xcb_xkb_get_map_map_modmap_rtrn (const xcb_xkb_get_map_map_t *S)
   3178 {
   3179     return S->modmap_rtrn;
   3180 }
   3181 
   3182 int
   3183 xcb_xkb_get_map_map_modmap_rtrn_length (const xcb_xkb_get_map_reply_t *R,
   3184                                         const xcb_xkb_get_map_map_t *S)
   3185 {
   3186     return R->totalModMapKeys;
   3187 }
   3188 
   3189 xcb_xkb_key_mod_map_iterator_t
   3190 xcb_xkb_get_map_map_modmap_rtrn_iterator (const xcb_xkb_get_map_reply_t *R,
   3191                                           const xcb_xkb_get_map_map_t *S)
   3192 {
   3193     xcb_xkb_key_mod_map_iterator_t i;
   3194     i.data = S->modmap_rtrn;
   3195     i.rem = R->totalModMapKeys;
   3196     i.index = (char *) i.data - (char *) S;
   3197     return i;
   3198 }
   3199 
   3200 xcb_xkb_key_v_mod_map_t *
   3201 xcb_xkb_get_map_map_vmodmap_rtrn (const xcb_xkb_get_map_map_t *S)
   3202 {
   3203     return S->vmodmap_rtrn;
   3204 }
   3205 
   3206 int
   3207 xcb_xkb_get_map_map_vmodmap_rtrn_length (const xcb_xkb_get_map_reply_t *R,
   3208                                          const xcb_xkb_get_map_map_t *S)
   3209 {
   3210     return R->totalVModMapKeys;
   3211 }
   3212 
   3213 xcb_xkb_key_v_mod_map_iterator_t
   3214 xcb_xkb_get_map_map_vmodmap_rtrn_iterator (const xcb_xkb_get_map_reply_t *R,
   3215                                            const xcb_xkb_get_map_map_t *S)
   3216 {
   3217     xcb_xkb_key_v_mod_map_iterator_t i;
   3218     i.data = S->vmodmap_rtrn;
   3219     i.rem = R->totalVModMapKeys;
   3220     i.index = (char *) i.data - (char *) S;
   3221     return i;
   3222 }
   3223 
   3224 int
   3225 xcb_xkb_get_map_map_serialize (void                        **_buffer,
   3226                                uint8_t                       nTypes,
   3227                                uint8_t                       nKeySyms,
   3228                                uint8_t                       nKeyActions,
   3229                                uint16_t                      totalActions,
   3230                                uint8_t                       totalKeyBehaviors,
   3231                                uint16_t                      virtualMods,
   3232                                uint8_t                       totalKeyExplicit,
   3233                                uint8_t                       totalModMapKeys,
   3234                                uint8_t                       totalVModMapKeys,
   3235                                uint16_t                      present,
   3236                                const xcb_xkb_get_map_map_t  *_aux)
   3237 {
   3238     char *xcb_out = *_buffer;
   3239     unsigned int xcb_buffer_len = 0;
   3240     unsigned int xcb_align_to = 0;
   3241     unsigned int xcb_padding_offset = 0;
   3242 
   3243     unsigned int xcb_pad = 0;
   3244     char xcb_pad0[3] = {0, 0, 0};
   3245     struct iovec xcb_parts[23];
   3246     unsigned int xcb_parts_idx = 0;
   3247     unsigned int xcb_block_len = 0;
   3248     unsigned int i;
   3249     char *xcb_tmp;
   3250 
   3251     if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
   3252         /* insert padding */
   3253         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3254         xcb_buffer_len += xcb_block_len + xcb_pad;
   3255         if (0 != xcb_pad) {
   3256             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3257             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3258             xcb_parts_idx++;
   3259             xcb_pad = 0;
   3260         }
   3261         xcb_block_len = 0;
   3262         xcb_padding_offset = 0;
   3263         /* types_rtrn */
   3264         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->types_rtrn;
   3265         xcb_parts[xcb_parts_idx].iov_len = 0;
   3266         xcb_tmp = (char *) _aux->types_rtrn;
   3267         for(i=0; i<nTypes; i++) {
   3268             xcb_block_len = xcb_xkb_key_type_sizeof(xcb_tmp);
   3269             xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
   3270         }
   3271         xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
   3272         xcb_parts_idx++;
   3273         xcb_align_to = ALIGNOF(xcb_xkb_key_type_t);
   3274     }
   3275     if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
   3276         /* insert padding */
   3277         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3278         xcb_buffer_len += xcb_block_len + xcb_pad;
   3279         if (0 != xcb_pad) {
   3280             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3281             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3282             xcb_parts_idx++;
   3283             xcb_pad = 0;
   3284         }
   3285         xcb_block_len = 0;
   3286         xcb_padding_offset = 0;
   3287         /* syms_rtrn */
   3288         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->syms_rtrn;
   3289         xcb_parts[xcb_parts_idx].iov_len = 0;
   3290         xcb_tmp = (char *) _aux->syms_rtrn;
   3291         for(i=0; i<nKeySyms; i++) {
   3292             xcb_block_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
   3293             xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
   3294         }
   3295         xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
   3296         xcb_parts_idx++;
   3297         xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
   3298     }
   3299     if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
   3300         /* insert padding */
   3301         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3302         xcb_buffer_len += xcb_block_len + xcb_pad;
   3303         if (0 != xcb_pad) {
   3304             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3305             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3306             xcb_parts_idx++;
   3307             xcb_pad = 0;
   3308         }
   3309         xcb_block_len = 0;
   3310         xcb_padding_offset = 0;
   3311         /* acts_rtrn_count */
   3312         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_count;
   3313         xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
   3314         xcb_parts[xcb_parts_idx].iov_len = nKeyActions * sizeof(xcb_keycode_t);
   3315         xcb_parts_idx++;
   3316         xcb_align_to = ALIGNOF(uint8_t);
   3317         xcb_align_to = 4;
   3318         /* insert padding */
   3319         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3320         xcb_buffer_len += xcb_block_len + xcb_pad;
   3321         if (0 != xcb_pad) {
   3322             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3323             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3324             xcb_parts_idx++;
   3325             xcb_pad = 0;
   3326         }
   3327         xcb_block_len = 0;
   3328         xcb_padding_offset = 0;
   3329         /* insert padding */
   3330         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3331         xcb_buffer_len += xcb_block_len + xcb_pad;
   3332         if (0 != xcb_pad) {
   3333             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3334             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3335             xcb_parts_idx++;
   3336             xcb_pad = 0;
   3337         }
   3338         xcb_block_len = 0;
   3339         xcb_padding_offset = 0;
   3340         /* acts_rtrn_acts */
   3341         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_acts;
   3342         xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
   3343         xcb_parts[xcb_parts_idx].iov_len = totalActions * sizeof(xcb_xkb_action_t);
   3344         xcb_parts_idx++;
   3345         xcb_align_to = ALIGNOF(xcb_xkb_action_t);
   3346     }
   3347     if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
   3348         /* insert padding */
   3349         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3350         xcb_buffer_len += xcb_block_len + xcb_pad;
   3351         if (0 != xcb_pad) {
   3352             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3353             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3354             xcb_parts_idx++;
   3355             xcb_pad = 0;
   3356         }
   3357         xcb_block_len = 0;
   3358         xcb_padding_offset = 0;
   3359         /* behaviors_rtrn */
   3360         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->behaviors_rtrn;
   3361         xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
   3362         xcb_parts[xcb_parts_idx].iov_len = totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
   3363         xcb_parts_idx++;
   3364         xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
   3365     }
   3366     if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
   3367         /* insert padding */
   3368         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3369         xcb_buffer_len += xcb_block_len + xcb_pad;
   3370         if (0 != xcb_pad) {
   3371             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3372             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3373             xcb_parts_idx++;
   3374             xcb_pad = 0;
   3375         }
   3376         xcb_block_len = 0;
   3377         xcb_padding_offset = 0;
   3378         /* vmods_rtrn */
   3379         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmods_rtrn;
   3380         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
   3381         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
   3382         xcb_parts_idx++;
   3383         xcb_align_to = ALIGNOF(uint8_t);
   3384         xcb_align_to = 4;
   3385         /* insert padding */
   3386         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3387         xcb_buffer_len += xcb_block_len + xcb_pad;
   3388         if (0 != xcb_pad) {
   3389             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3390             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3391             xcb_parts_idx++;
   3392             xcb_pad = 0;
   3393         }
   3394         xcb_block_len = 0;
   3395         xcb_padding_offset = 0;
   3396     }
   3397     if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
   3398         /* insert padding */
   3399         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3400         xcb_buffer_len += xcb_block_len + xcb_pad;
   3401         if (0 != xcb_pad) {
   3402             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3403             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3404             xcb_parts_idx++;
   3405             xcb_pad = 0;
   3406         }
   3407         xcb_block_len = 0;
   3408         xcb_padding_offset = 0;
   3409         /* explicit_rtrn */
   3410         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->explicit_rtrn;
   3411         xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
   3412         xcb_parts[xcb_parts_idx].iov_len = totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
   3413         xcb_parts_idx++;
   3414         xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
   3415         xcb_align_to = 4;
   3416         /* insert padding */
   3417         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3418         xcb_buffer_len += xcb_block_len + xcb_pad;
   3419         if (0 != xcb_pad) {
   3420             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3421             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3422             xcb_parts_idx++;
   3423             xcb_pad = 0;
   3424         }
   3425         xcb_block_len = 0;
   3426         xcb_padding_offset = 0;
   3427     }
   3428     if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
   3429         /* insert padding */
   3430         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3431         xcb_buffer_len += xcb_block_len + xcb_pad;
   3432         if (0 != xcb_pad) {
   3433             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3434             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3435             xcb_parts_idx++;
   3436             xcb_pad = 0;
   3437         }
   3438         xcb_block_len = 0;
   3439         xcb_padding_offset = 0;
   3440         /* modmap_rtrn */
   3441         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->modmap_rtrn;
   3442         xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
   3443         xcb_parts[xcb_parts_idx].iov_len = totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
   3444         xcb_parts_idx++;
   3445         xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
   3446         xcb_align_to = 4;
   3447         /* insert padding */
   3448         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3449         xcb_buffer_len += xcb_block_len + xcb_pad;
   3450         if (0 != xcb_pad) {
   3451             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3452             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3453             xcb_parts_idx++;
   3454             xcb_pad = 0;
   3455         }
   3456         xcb_block_len = 0;
   3457         xcb_padding_offset = 0;
   3458     }
   3459     if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
   3460         /* insert padding */
   3461         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3462         xcb_buffer_len += xcb_block_len + xcb_pad;
   3463         if (0 != xcb_pad) {
   3464             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3465             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3466             xcb_parts_idx++;
   3467             xcb_pad = 0;
   3468         }
   3469         xcb_block_len = 0;
   3470         xcb_padding_offset = 0;
   3471         /* vmodmap_rtrn */
   3472         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmodmap_rtrn;
   3473         xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
   3474         xcb_parts[xcb_parts_idx].iov_len = totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
   3475         xcb_parts_idx++;
   3476         xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
   3477     }
   3478     /* insert padding */
   3479     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3480     xcb_buffer_len += xcb_block_len + xcb_pad;
   3481     if (0 != xcb_pad) {
   3482         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   3483         xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   3484         xcb_parts_idx++;
   3485         xcb_pad = 0;
   3486     }
   3487     xcb_block_len = 0;
   3488     xcb_padding_offset = 0;
   3489 
   3490     if (NULL == xcb_out) {
   3491         /* allocate memory */
   3492         xcb_out = malloc(xcb_buffer_len);
   3493         *_buffer = xcb_out;
   3494     }
   3495 
   3496     xcb_tmp = xcb_out;
   3497     for(i=0; i<xcb_parts_idx; i++) {
   3498         if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
   3499             memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
   3500         if (0 != xcb_parts[i].iov_len)
   3501             xcb_tmp += xcb_parts[i].iov_len;
   3502     }
   3503 
   3504     return xcb_buffer_len;
   3505 }
   3506 
   3507 int
   3508 xcb_xkb_get_map_map_unpack (const void             *_buffer,
   3509                             uint8_t                 nTypes,
   3510                             uint8_t                 nKeySyms,
   3511                             uint8_t                 nKeyActions,
   3512                             uint16_t                totalActions,
   3513                             uint8_t                 totalKeyBehaviors,
   3514                             uint16_t                virtualMods,
   3515                             uint8_t                 totalKeyExplicit,
   3516                             uint8_t                 totalModMapKeys,
   3517                             uint8_t                 totalVModMapKeys,
   3518                             uint16_t                present,
   3519                             xcb_xkb_get_map_map_t  *_aux)
   3520 {
   3521     char *xcb_tmp = (char *)_buffer;
   3522     unsigned int xcb_buffer_len = 0;
   3523     unsigned int xcb_block_len = 0;
   3524     unsigned int xcb_pad = 0;
   3525     unsigned int xcb_align_to = 0;
   3526     unsigned int xcb_padding_offset = 0;
   3527 
   3528     unsigned int i;
   3529     unsigned int xcb_tmp_len;
   3530 
   3531     if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
   3532         /* insert padding */
   3533         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3534         xcb_buffer_len += xcb_block_len + xcb_pad;
   3535         if (0 != xcb_pad) {
   3536             xcb_tmp += xcb_pad;
   3537             xcb_pad = 0;
   3538         }
   3539         xcb_block_len = 0;
   3540         xcb_padding_offset = 0;
   3541         /* types_rtrn */
   3542         _aux->types_rtrn = (xcb_xkb_key_type_t *)xcb_tmp;
   3543         for(i=0; i<nTypes; i++) {
   3544             xcb_tmp_len = xcb_xkb_key_type_sizeof(xcb_tmp);
   3545             xcb_block_len += xcb_tmp_len;
   3546             xcb_tmp += xcb_tmp_len;
   3547         }
   3548         xcb_align_to = ALIGNOF(xcb_xkb_key_type_t);
   3549     }
   3550     if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
   3551         /* insert padding */
   3552         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3553         xcb_buffer_len += xcb_block_len + xcb_pad;
   3554         if (0 != xcb_pad) {
   3555             xcb_tmp += xcb_pad;
   3556             xcb_pad = 0;
   3557         }
   3558         xcb_block_len = 0;
   3559         xcb_padding_offset = 0;
   3560         /* syms_rtrn */
   3561         _aux->syms_rtrn = (xcb_xkb_key_sym_map_t *)xcb_tmp;
   3562         for(i=0; i<nKeySyms; i++) {
   3563             xcb_tmp_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
   3564             xcb_block_len += xcb_tmp_len;
   3565             xcb_tmp += xcb_tmp_len;
   3566         }
   3567         xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
   3568     }
   3569     if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
   3570         /* insert padding */
   3571         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3572         xcb_buffer_len += xcb_block_len + xcb_pad;
   3573         if (0 != xcb_pad) {
   3574             xcb_tmp += xcb_pad;
   3575             xcb_pad = 0;
   3576         }
   3577         xcb_block_len = 0;
   3578         xcb_padding_offset = 0;
   3579         /* acts_rtrn_count */
   3580         _aux->acts_rtrn_count = (uint8_t *)xcb_tmp;
   3581         xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
   3582         xcb_tmp += xcb_block_len;
   3583         xcb_align_to = ALIGNOF(uint8_t);
   3584         xcb_align_to = 4;
   3585         /* insert padding */
   3586         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3587         xcb_buffer_len += xcb_block_len + xcb_pad;
   3588         if (0 != xcb_pad) {
   3589             xcb_tmp += xcb_pad;
   3590             xcb_pad = 0;
   3591         }
   3592         xcb_block_len = 0;
   3593         xcb_padding_offset = 0;
   3594         /* insert padding */
   3595         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3596         xcb_buffer_len += xcb_block_len + xcb_pad;
   3597         if (0 != xcb_pad) {
   3598             xcb_tmp += xcb_pad;
   3599             xcb_pad = 0;
   3600         }
   3601         xcb_block_len = 0;
   3602         xcb_padding_offset = 0;
   3603         /* acts_rtrn_acts */
   3604         _aux->acts_rtrn_acts = (xcb_xkb_action_t *)xcb_tmp;
   3605         xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
   3606         xcb_tmp += xcb_block_len;
   3607         xcb_align_to = ALIGNOF(xcb_xkb_action_t);
   3608     }
   3609     if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
   3610         /* insert padding */
   3611         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3612         xcb_buffer_len += xcb_block_len + xcb_pad;
   3613         if (0 != xcb_pad) {
   3614             xcb_tmp += xcb_pad;
   3615             xcb_pad = 0;
   3616         }
   3617         xcb_block_len = 0;
   3618         xcb_padding_offset = 0;
   3619         /* behaviors_rtrn */
   3620         _aux->behaviors_rtrn = (xcb_xkb_set_behavior_t *)xcb_tmp;
   3621         xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
   3622         xcb_tmp += xcb_block_len;
   3623         xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
   3624     }
   3625     if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
   3626         /* insert padding */
   3627         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3628         xcb_buffer_len += xcb_block_len + xcb_pad;
   3629         if (0 != xcb_pad) {
   3630             xcb_tmp += xcb_pad;
   3631             xcb_pad = 0;
   3632         }
   3633         xcb_block_len = 0;
   3634         xcb_padding_offset = 0;
   3635         /* vmods_rtrn */
   3636         _aux->vmods_rtrn = (uint8_t *)xcb_tmp;
   3637         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
   3638         xcb_tmp += xcb_block_len;
   3639         xcb_align_to = ALIGNOF(uint8_t);
   3640         xcb_align_to = 4;
   3641         /* insert padding */
   3642         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3643         xcb_buffer_len += xcb_block_len + xcb_pad;
   3644         if (0 != xcb_pad) {
   3645             xcb_tmp += xcb_pad;
   3646             xcb_pad = 0;
   3647         }
   3648         xcb_block_len = 0;
   3649         xcb_padding_offset = 0;
   3650     }
   3651     if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
   3652         /* insert padding */
   3653         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3654         xcb_buffer_len += xcb_block_len + xcb_pad;
   3655         if (0 != xcb_pad) {
   3656             xcb_tmp += xcb_pad;
   3657             xcb_pad = 0;
   3658         }
   3659         xcb_block_len = 0;
   3660         xcb_padding_offset = 0;
   3661         /* explicit_rtrn */
   3662         _aux->explicit_rtrn = (xcb_xkb_set_explicit_t *)xcb_tmp;
   3663         xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
   3664         xcb_tmp += xcb_block_len;
   3665         xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
   3666         xcb_align_to = 4;
   3667         /* insert padding */
   3668         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3669         xcb_buffer_len += xcb_block_len + xcb_pad;
   3670         if (0 != xcb_pad) {
   3671             xcb_tmp += xcb_pad;
   3672             xcb_pad = 0;
   3673         }
   3674         xcb_block_len = 0;
   3675         xcb_padding_offset = 0;
   3676     }
   3677     if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
   3678         /* insert padding */
   3679         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3680         xcb_buffer_len += xcb_block_len + xcb_pad;
   3681         if (0 != xcb_pad) {
   3682             xcb_tmp += xcb_pad;
   3683             xcb_pad = 0;
   3684         }
   3685         xcb_block_len = 0;
   3686         xcb_padding_offset = 0;
   3687         /* modmap_rtrn */
   3688         _aux->modmap_rtrn = (xcb_xkb_key_mod_map_t *)xcb_tmp;
   3689         xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
   3690         xcb_tmp += xcb_block_len;
   3691         xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
   3692         xcb_align_to = 4;
   3693         /* insert padding */
   3694         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3695         xcb_buffer_len += xcb_block_len + xcb_pad;
   3696         if (0 != xcb_pad) {
   3697             xcb_tmp += xcb_pad;
   3698             xcb_pad = 0;
   3699         }
   3700         xcb_block_len = 0;
   3701         xcb_padding_offset = 0;
   3702     }
   3703     if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
   3704         /* insert padding */
   3705         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3706         xcb_buffer_len += xcb_block_len + xcb_pad;
   3707         if (0 != xcb_pad) {
   3708             xcb_tmp += xcb_pad;
   3709             xcb_pad = 0;
   3710         }
   3711         xcb_block_len = 0;
   3712         xcb_padding_offset = 0;
   3713         /* vmodmap_rtrn */
   3714         _aux->vmodmap_rtrn = (xcb_xkb_key_v_mod_map_t *)xcb_tmp;
   3715         xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
   3716         xcb_tmp += xcb_block_len;
   3717         xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
   3718     }
   3719     /* insert padding */
   3720     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   3721     xcb_buffer_len += xcb_block_len + xcb_pad;
   3722     if (0 != xcb_pad) {
   3723         xcb_tmp += xcb_pad;
   3724         xcb_pad = 0;
   3725     }
   3726     xcb_block_len = 0;
   3727     xcb_padding_offset = 0;
   3728 
   3729     return xcb_buffer_len;
   3730 }
   3731 
   3732 int
   3733 xcb_xkb_get_map_map_sizeof (const void  *_buffer,
   3734                             uint8_t      nTypes,
   3735                             uint8_t      nKeySyms,
   3736                             uint8_t      nKeyActions,
   3737                             uint16_t     totalActions,
   3738                             uint8_t      totalKeyBehaviors,
   3739                             uint16_t     virtualMods,
   3740                             uint8_t      totalKeyExplicit,
   3741                             uint8_t      totalModMapKeys,
   3742                             uint8_t      totalVModMapKeys,
   3743                             uint16_t     present)
   3744 {
   3745     xcb_xkb_get_map_map_t _aux;
   3746     return xcb_xkb_get_map_map_unpack(_buffer, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, &_aux);
   3747 }
   3748 
   3749 int
   3750 xcb_xkb_get_map_sizeof (const void  *_buffer)
   3751 {
   3752     char *xcb_tmp = (char *)_buffer;
   3753     const xcb_xkb_get_map_reply_t *_aux = (xcb_xkb_get_map_reply_t *)_buffer;
   3754     unsigned int xcb_buffer_len = 0;
   3755     unsigned int xcb_block_len = 0;
   3756     unsigned int xcb_pad = 0;
   3757     unsigned int xcb_align_to = 0;
   3758 
   3759 
   3760     xcb_block_len += sizeof(xcb_xkb_get_map_reply_t);
   3761     xcb_tmp += xcb_block_len;
   3762     xcb_buffer_len += xcb_block_len;
   3763     xcb_block_len = 0;
   3764     /* map */
   3765     xcb_block_len += xcb_xkb_get_map_map_sizeof(xcb_tmp, _aux->nTypes, _aux->nKeySyms, _aux->nKeyActions, _aux->totalActions, _aux->totalKeyBehaviors, _aux->virtualMods, _aux->totalKeyExplicit, _aux->totalModMapKeys, _aux->totalVModMapKeys, _aux->present);
   3766     xcb_tmp += xcb_block_len;
   3767     xcb_align_to = ALIGNOF(char);
   3768     /* insert padding */
   3769     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   3770     xcb_buffer_len += xcb_block_len + xcb_pad;
   3771     if (0 != xcb_pad) {
   3772         xcb_tmp += xcb_pad;
   3773         xcb_pad = 0;
   3774     }
   3775     xcb_block_len = 0;
   3776 
   3777     return xcb_buffer_len;
   3778 }
   3779 
   3780 xcb_xkb_get_map_cookie_t
   3781 xcb_xkb_get_map (xcb_connection_t      *c,
   3782                  xcb_xkb_device_spec_t  deviceSpec,
   3783                  uint16_t               full,
   3784                  uint16_t               partial,
   3785                  uint8_t                firstType,
   3786                  uint8_t                nTypes,
   3787                  xcb_keycode_t          firstKeySym,
   3788                  uint8_t                nKeySyms,
   3789                  xcb_keycode_t          firstKeyAction,
   3790                  uint8_t                nKeyActions,
   3791                  xcb_keycode_t          firstKeyBehavior,
   3792                  uint8_t                nKeyBehaviors,
   3793                  uint16_t               virtualMods,
   3794                  xcb_keycode_t          firstKeyExplicit,
   3795                  uint8_t                nKeyExplicit,
   3796                  xcb_keycode_t          firstModMapKey,
   3797                  uint8_t                nModMapKeys,
   3798                  xcb_keycode_t          firstVModMapKey,
   3799                  uint8_t                nVModMapKeys)
   3800 {
   3801     static const xcb_protocol_request_t xcb_req = {
   3802         .count = 2,
   3803         .ext = &xcb_xkb_id,
   3804         .opcode = XCB_XKB_GET_MAP,
   3805         .isvoid = 0
   3806     };
   3807 
   3808     struct iovec xcb_parts[4];
   3809     xcb_xkb_get_map_cookie_t xcb_ret;
   3810     xcb_xkb_get_map_request_t xcb_out;
   3811 
   3812     xcb_out.deviceSpec = deviceSpec;
   3813     xcb_out.full = full;
   3814     xcb_out.partial = partial;
   3815     xcb_out.firstType = firstType;
   3816     xcb_out.nTypes = nTypes;
   3817     xcb_out.firstKeySym = firstKeySym;
   3818     xcb_out.nKeySyms = nKeySyms;
   3819     xcb_out.firstKeyAction = firstKeyAction;
   3820     xcb_out.nKeyActions = nKeyActions;
   3821     xcb_out.firstKeyBehavior = firstKeyBehavior;
   3822     xcb_out.nKeyBehaviors = nKeyBehaviors;
   3823     xcb_out.virtualMods = virtualMods;
   3824     xcb_out.firstKeyExplicit = firstKeyExplicit;
   3825     xcb_out.nKeyExplicit = nKeyExplicit;
   3826     xcb_out.firstModMapKey = firstModMapKey;
   3827     xcb_out.nModMapKeys = nModMapKeys;
   3828     xcb_out.firstVModMapKey = firstVModMapKey;
   3829     xcb_out.nVModMapKeys = nVModMapKeys;
   3830     memset(xcb_out.pad0, 0, 2);
   3831 
   3832     xcb_parts[2].iov_base = (char *) &xcb_out;
   3833     xcb_parts[2].iov_len = sizeof(xcb_out);
   3834     xcb_parts[3].iov_base = 0;
   3835     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   3836 
   3837     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   3838     return xcb_ret;
   3839 }
   3840 
   3841 xcb_xkb_get_map_cookie_t
   3842 xcb_xkb_get_map_unchecked (xcb_connection_t      *c,
   3843                            xcb_xkb_device_spec_t  deviceSpec,
   3844                            uint16_t               full,
   3845                            uint16_t               partial,
   3846                            uint8_t                firstType,
   3847                            uint8_t                nTypes,
   3848                            xcb_keycode_t          firstKeySym,
   3849                            uint8_t                nKeySyms,
   3850                            xcb_keycode_t          firstKeyAction,
   3851                            uint8_t                nKeyActions,
   3852                            xcb_keycode_t          firstKeyBehavior,
   3853                            uint8_t                nKeyBehaviors,
   3854                            uint16_t               virtualMods,
   3855                            xcb_keycode_t          firstKeyExplicit,
   3856                            uint8_t                nKeyExplicit,
   3857                            xcb_keycode_t          firstModMapKey,
   3858                            uint8_t                nModMapKeys,
   3859                            xcb_keycode_t          firstVModMapKey,
   3860                            uint8_t                nVModMapKeys)
   3861 {
   3862     static const xcb_protocol_request_t xcb_req = {
   3863         .count = 2,
   3864         .ext = &xcb_xkb_id,
   3865         .opcode = XCB_XKB_GET_MAP,
   3866         .isvoid = 0
   3867     };
   3868 
   3869     struct iovec xcb_parts[4];
   3870     xcb_xkb_get_map_cookie_t xcb_ret;
   3871     xcb_xkb_get_map_request_t xcb_out;
   3872 
   3873     xcb_out.deviceSpec = deviceSpec;
   3874     xcb_out.full = full;
   3875     xcb_out.partial = partial;
   3876     xcb_out.firstType = firstType;
   3877     xcb_out.nTypes = nTypes;
   3878     xcb_out.firstKeySym = firstKeySym;
   3879     xcb_out.nKeySyms = nKeySyms;
   3880     xcb_out.firstKeyAction = firstKeyAction;
   3881     xcb_out.nKeyActions = nKeyActions;
   3882     xcb_out.firstKeyBehavior = firstKeyBehavior;
   3883     xcb_out.nKeyBehaviors = nKeyBehaviors;
   3884     xcb_out.virtualMods = virtualMods;
   3885     xcb_out.firstKeyExplicit = firstKeyExplicit;
   3886     xcb_out.nKeyExplicit = nKeyExplicit;
   3887     xcb_out.firstModMapKey = firstModMapKey;
   3888     xcb_out.nModMapKeys = nModMapKeys;
   3889     xcb_out.firstVModMapKey = firstVModMapKey;
   3890     xcb_out.nVModMapKeys = nVModMapKeys;
   3891     memset(xcb_out.pad0, 0, 2);
   3892 
   3893     xcb_parts[2].iov_base = (char *) &xcb_out;
   3894     xcb_parts[2].iov_len = sizeof(xcb_out);
   3895     xcb_parts[3].iov_base = 0;
   3896     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   3897 
   3898     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   3899     return xcb_ret;
   3900 }
   3901 
   3902 void *
   3903 xcb_xkb_get_map_map (const xcb_xkb_get_map_reply_t *R)
   3904 {
   3905     return (void *) (R + 1);
   3906 }
   3907 
   3908 xcb_xkb_get_map_reply_t *
   3909 xcb_xkb_get_map_reply (xcb_connection_t          *c,
   3910                        xcb_xkb_get_map_cookie_t   cookie  /**< */,
   3911                        xcb_generic_error_t      **e)
   3912 {
   3913     return (xcb_xkb_get_map_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   3914 }
   3915 
   3916 int
   3917 xcb_xkb_set_map_values_types_length (const xcb_xkb_set_map_request_t *R,
   3918                                      const xcb_xkb_set_map_values_t *S)
   3919 {
   3920     return R->nTypes;
   3921 }
   3922 
   3923 xcb_xkb_set_key_type_iterator_t
   3924 xcb_xkb_set_map_values_types_iterator (const xcb_xkb_set_map_request_t *R,
   3925                                        const xcb_xkb_set_map_values_t *S)
   3926 {
   3927     xcb_xkb_set_key_type_iterator_t i;
   3928     i.data = S->types;
   3929     i.rem = R->nTypes;
   3930     i.index = (char *) i.data - (char *) S;
   3931     return i;
   3932 }
   3933 
   3934 int
   3935 xcb_xkb_set_map_values_syms_length (const xcb_xkb_set_map_request_t *R,
   3936                                     const xcb_xkb_set_map_values_t *S)
   3937 {
   3938     return R->nKeySyms;
   3939 }
   3940 
   3941 xcb_xkb_key_sym_map_iterator_t
   3942 xcb_xkb_set_map_values_syms_iterator (const xcb_xkb_set_map_request_t *R,
   3943                                       const xcb_xkb_set_map_values_t *S)
   3944 {
   3945     xcb_xkb_key_sym_map_iterator_t i;
   3946     i.data = S->syms;
   3947     i.rem = R->nKeySyms;
   3948     i.index = (char *) i.data - (char *) S;
   3949     return i;
   3950 }
   3951 
   3952 uint8_t *
   3953 xcb_xkb_set_map_values_actions_count (const xcb_xkb_set_map_values_t *S)
   3954 {
   3955     return S->actionsCount;
   3956 }
   3957 
   3958 int
   3959 xcb_xkb_set_map_values_actions_count_length (const xcb_xkb_set_map_request_t *R,
   3960                                              const xcb_xkb_set_map_values_t *S)
   3961 {
   3962     return R->nKeyActions;
   3963 }
   3964 
   3965 xcb_generic_iterator_t
   3966 xcb_xkb_set_map_values_actions_count_end (const xcb_xkb_set_map_request_t *R,
   3967                                           const xcb_xkb_set_map_values_t *S)
   3968 {
   3969     xcb_generic_iterator_t i;
   3970     i.data = S->actionsCount + R->nKeyActions;
   3971     i.rem = 0;
   3972     i.index = (char *) i.data - (char *) S;
   3973     return i;
   3974 }
   3975 
   3976 xcb_xkb_action_t *
   3977 xcb_xkb_set_map_values_actions (const xcb_xkb_set_map_values_t *S)
   3978 {
   3979     return S->actions;
   3980 }
   3981 
   3982 int
   3983 xcb_xkb_set_map_values_actions_length (const xcb_xkb_set_map_request_t *R,
   3984                                        const xcb_xkb_set_map_values_t *S)
   3985 {
   3986     return R->totalActions;
   3987 }
   3988 
   3989 xcb_xkb_action_iterator_t
   3990 xcb_xkb_set_map_values_actions_iterator (const xcb_xkb_set_map_request_t *R,
   3991                                          const xcb_xkb_set_map_values_t *S)
   3992 {
   3993     xcb_xkb_action_iterator_t i;
   3994     i.data = S->actions;
   3995     i.rem = R->totalActions;
   3996     i.index = (char *) i.data - (char *) S;
   3997     return i;
   3998 }
   3999 
   4000 xcb_xkb_set_behavior_t *
   4001 xcb_xkb_set_map_values_behaviors (const xcb_xkb_set_map_values_t *S)
   4002 {
   4003     return S->behaviors;
   4004 }
   4005 
   4006 int
   4007 xcb_xkb_set_map_values_behaviors_length (const xcb_xkb_set_map_request_t *R,
   4008                                          const xcb_xkb_set_map_values_t *S)
   4009 {
   4010     return R->totalKeyBehaviors;
   4011 }
   4012 
   4013 xcb_xkb_set_behavior_iterator_t
   4014 xcb_xkb_set_map_values_behaviors_iterator (const xcb_xkb_set_map_request_t *R,
   4015                                            const xcb_xkb_set_map_values_t *S)
   4016 {
   4017     xcb_xkb_set_behavior_iterator_t i;
   4018     i.data = S->behaviors;
   4019     i.rem = R->totalKeyBehaviors;
   4020     i.index = (char *) i.data - (char *) S;
   4021     return i;
   4022 }
   4023 
   4024 uint8_t *
   4025 xcb_xkb_set_map_values_vmods (const xcb_xkb_set_map_values_t *S)
   4026 {
   4027     return S->vmods;
   4028 }
   4029 
   4030 int
   4031 xcb_xkb_set_map_values_vmods_length (const xcb_xkb_set_map_request_t *R,
   4032                                      const xcb_xkb_set_map_values_t *S)
   4033 {
   4034     return xcb_popcount(R->virtualMods);
   4035 }
   4036 
   4037 xcb_generic_iterator_t
   4038 xcb_xkb_set_map_values_vmods_end (const xcb_xkb_set_map_request_t *R,
   4039                                   const xcb_xkb_set_map_values_t *S)
   4040 {
   4041     xcb_generic_iterator_t i;
   4042     i.data = S->vmods + xcb_popcount(R->virtualMods);
   4043     i.rem = 0;
   4044     i.index = (char *) i.data - (char *) S;
   4045     return i;
   4046 }
   4047 
   4048 xcb_xkb_set_explicit_t *
   4049 xcb_xkb_set_map_values_explicit (const xcb_xkb_set_map_values_t *S)
   4050 {
   4051     return S->explicit;
   4052 }
   4053 
   4054 int
   4055 xcb_xkb_set_map_values_explicit_length (const xcb_xkb_set_map_request_t *R,
   4056                                         const xcb_xkb_set_map_values_t *S)
   4057 {
   4058     return R->totalKeyExplicit;
   4059 }
   4060 
   4061 xcb_xkb_set_explicit_iterator_t
   4062 xcb_xkb_set_map_values_explicit_iterator (const xcb_xkb_set_map_request_t *R,
   4063                                           const xcb_xkb_set_map_values_t *S)
   4064 {
   4065     xcb_xkb_set_explicit_iterator_t i;
   4066     i.data = S->explicit;
   4067     i.rem = R->totalKeyExplicit;
   4068     i.index = (char *) i.data - (char *) S;
   4069     return i;
   4070 }
   4071 
   4072 xcb_xkb_key_mod_map_t *
   4073 xcb_xkb_set_map_values_modmap (const xcb_xkb_set_map_values_t *S)
   4074 {
   4075     return S->modmap;
   4076 }
   4077 
   4078 int
   4079 xcb_xkb_set_map_values_modmap_length (const xcb_xkb_set_map_request_t *R,
   4080                                       const xcb_xkb_set_map_values_t *S)
   4081 {
   4082     return R->totalModMapKeys;
   4083 }
   4084 
   4085 xcb_xkb_key_mod_map_iterator_t
   4086 xcb_xkb_set_map_values_modmap_iterator (const xcb_xkb_set_map_request_t *R,
   4087                                         const xcb_xkb_set_map_values_t *S)
   4088 {
   4089     xcb_xkb_key_mod_map_iterator_t i;
   4090     i.data = S->modmap;
   4091     i.rem = R->totalModMapKeys;
   4092     i.index = (char *) i.data - (char *) S;
   4093     return i;
   4094 }
   4095 
   4096 xcb_xkb_key_v_mod_map_t *
   4097 xcb_xkb_set_map_values_vmodmap (const xcb_xkb_set_map_values_t *S)
   4098 {
   4099     return S->vmodmap;
   4100 }
   4101 
   4102 int
   4103 xcb_xkb_set_map_values_vmodmap_length (const xcb_xkb_set_map_request_t *R,
   4104                                        const xcb_xkb_set_map_values_t *S)
   4105 {
   4106     return R->totalVModMapKeys;
   4107 }
   4108 
   4109 xcb_xkb_key_v_mod_map_iterator_t
   4110 xcb_xkb_set_map_values_vmodmap_iterator (const xcb_xkb_set_map_request_t *R,
   4111                                          const xcb_xkb_set_map_values_t *S)
   4112 {
   4113     xcb_xkb_key_v_mod_map_iterator_t i;
   4114     i.data = S->vmodmap;
   4115     i.rem = R->totalVModMapKeys;
   4116     i.index = (char *) i.data - (char *) S;
   4117     return i;
   4118 }
   4119 
   4120 int
   4121 xcb_xkb_set_map_values_serialize (void                           **_buffer,
   4122                                   uint8_t                          nTypes,
   4123                                   uint8_t                          nKeySyms,
   4124                                   uint8_t                          nKeyActions,
   4125                                   uint16_t                         totalActions,
   4126                                   uint8_t                          totalKeyBehaviors,
   4127                                   uint16_t                         virtualMods,
   4128                                   uint8_t                          totalKeyExplicit,
   4129                                   uint8_t                          totalModMapKeys,
   4130                                   uint8_t                          totalVModMapKeys,
   4131                                   uint16_t                         present,
   4132                                   const xcb_xkb_set_map_values_t  *_aux)
   4133 {
   4134     char *xcb_out = *_buffer;
   4135     unsigned int xcb_buffer_len = 0;
   4136     unsigned int xcb_align_to = 0;
   4137     unsigned int xcb_padding_offset = 0;
   4138 
   4139     unsigned int xcb_pad = 0;
   4140     char xcb_pad0[3] = {0, 0, 0};
   4141     struct iovec xcb_parts[21];
   4142     unsigned int xcb_parts_idx = 0;
   4143     unsigned int xcb_block_len = 0;
   4144     unsigned int i;
   4145     char *xcb_tmp;
   4146 
   4147     if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
   4148         /* insert padding */
   4149         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4150         xcb_buffer_len += xcb_block_len + xcb_pad;
   4151         if (0 != xcb_pad) {
   4152             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4153             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4154             xcb_parts_idx++;
   4155             xcb_pad = 0;
   4156         }
   4157         xcb_block_len = 0;
   4158         xcb_padding_offset = 0;
   4159         /* types */
   4160         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->types;
   4161         xcb_parts[xcb_parts_idx].iov_len = 0;
   4162         xcb_tmp = (char *) _aux->types;
   4163         for(i=0; i<nTypes; i++) {
   4164             xcb_block_len = xcb_xkb_set_key_type_sizeof(xcb_tmp);
   4165             xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
   4166         }
   4167         xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
   4168         xcb_parts_idx++;
   4169         xcb_align_to = ALIGNOF(xcb_xkb_set_key_type_t);
   4170     }
   4171     if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
   4172         /* insert padding */
   4173         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4174         xcb_buffer_len += xcb_block_len + xcb_pad;
   4175         if (0 != xcb_pad) {
   4176             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4177             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4178             xcb_parts_idx++;
   4179             xcb_pad = 0;
   4180         }
   4181         xcb_block_len = 0;
   4182         xcb_padding_offset = 0;
   4183         /* syms */
   4184         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->syms;
   4185         xcb_parts[xcb_parts_idx].iov_len = 0;
   4186         xcb_tmp = (char *) _aux->syms;
   4187         for(i=0; i<nKeySyms; i++) {
   4188             xcb_block_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
   4189             xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
   4190         }
   4191         xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
   4192         xcb_parts_idx++;
   4193         xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
   4194     }
   4195     if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
   4196         /* insert padding */
   4197         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4198         xcb_buffer_len += xcb_block_len + xcb_pad;
   4199         if (0 != xcb_pad) {
   4200             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4201             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4202             xcb_parts_idx++;
   4203             xcb_pad = 0;
   4204         }
   4205         xcb_block_len = 0;
   4206         xcb_padding_offset = 0;
   4207         /* actionsCount */
   4208         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->actionsCount;
   4209         xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
   4210         xcb_parts[xcb_parts_idx].iov_len = nKeyActions * sizeof(xcb_keycode_t);
   4211         xcb_parts_idx++;
   4212         xcb_align_to = ALIGNOF(uint8_t);
   4213         xcb_align_to = 4;
   4214         /* insert padding */
   4215         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4216         xcb_buffer_len += xcb_block_len + xcb_pad;
   4217         if (0 != xcb_pad) {
   4218             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4219             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4220             xcb_parts_idx++;
   4221             xcb_pad = 0;
   4222         }
   4223         xcb_block_len = 0;
   4224         xcb_padding_offset = 0;
   4225         /* insert padding */
   4226         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4227         xcb_buffer_len += xcb_block_len + xcb_pad;
   4228         if (0 != xcb_pad) {
   4229             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4230             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4231             xcb_parts_idx++;
   4232             xcb_pad = 0;
   4233         }
   4234         xcb_block_len = 0;
   4235         xcb_padding_offset = 0;
   4236         /* actions */
   4237         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->actions;
   4238         xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
   4239         xcb_parts[xcb_parts_idx].iov_len = totalActions * sizeof(xcb_xkb_action_t);
   4240         xcb_parts_idx++;
   4241         xcb_align_to = ALIGNOF(xcb_xkb_action_t);
   4242     }
   4243     if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
   4244         /* insert padding */
   4245         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4246         xcb_buffer_len += xcb_block_len + xcb_pad;
   4247         if (0 != xcb_pad) {
   4248             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4249             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4250             xcb_parts_idx++;
   4251             xcb_pad = 0;
   4252         }
   4253         xcb_block_len = 0;
   4254         xcb_padding_offset = 0;
   4255         /* behaviors */
   4256         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->behaviors;
   4257         xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
   4258         xcb_parts[xcb_parts_idx].iov_len = totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
   4259         xcb_parts_idx++;
   4260         xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
   4261     }
   4262     if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
   4263         /* insert padding */
   4264         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4265         xcb_buffer_len += xcb_block_len + xcb_pad;
   4266         if (0 != xcb_pad) {
   4267             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4268             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4269             xcb_parts_idx++;
   4270             xcb_pad = 0;
   4271         }
   4272         xcb_block_len = 0;
   4273         xcb_padding_offset = 0;
   4274         /* vmods */
   4275         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmods;
   4276         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
   4277         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
   4278         xcb_parts_idx++;
   4279         xcb_align_to = ALIGNOF(uint8_t);
   4280         xcb_align_to = 4;
   4281         /* insert padding */
   4282         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4283         xcb_buffer_len += xcb_block_len + xcb_pad;
   4284         if (0 != xcb_pad) {
   4285             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4286             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4287             xcb_parts_idx++;
   4288             xcb_pad = 0;
   4289         }
   4290         xcb_block_len = 0;
   4291         xcb_padding_offset = 0;
   4292     }
   4293     if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
   4294         /* insert padding */
   4295         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4296         xcb_buffer_len += xcb_block_len + xcb_pad;
   4297         if (0 != xcb_pad) {
   4298             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4299             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4300             xcb_parts_idx++;
   4301             xcb_pad = 0;
   4302         }
   4303         xcb_block_len = 0;
   4304         xcb_padding_offset = 0;
   4305         /* explicit */
   4306         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->explicit;
   4307         xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
   4308         xcb_parts[xcb_parts_idx].iov_len = totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
   4309         xcb_parts_idx++;
   4310         xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
   4311     }
   4312     if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
   4313         /* insert padding */
   4314         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4315         xcb_buffer_len += xcb_block_len + xcb_pad;
   4316         if (0 != xcb_pad) {
   4317             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4318             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4319             xcb_parts_idx++;
   4320             xcb_pad = 0;
   4321         }
   4322         xcb_block_len = 0;
   4323         xcb_padding_offset = 0;
   4324         /* modmap */
   4325         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->modmap;
   4326         xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
   4327         xcb_parts[xcb_parts_idx].iov_len = totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
   4328         xcb_parts_idx++;
   4329         xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
   4330     }
   4331     if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
   4332         /* insert padding */
   4333         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4334         xcb_buffer_len += xcb_block_len + xcb_pad;
   4335         if (0 != xcb_pad) {
   4336             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4337             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4338             xcb_parts_idx++;
   4339             xcb_pad = 0;
   4340         }
   4341         xcb_block_len = 0;
   4342         xcb_padding_offset = 0;
   4343         /* vmodmap */
   4344         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmodmap;
   4345         xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
   4346         xcb_parts[xcb_parts_idx].iov_len = totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
   4347         xcb_parts_idx++;
   4348         xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
   4349     }
   4350     /* insert padding */
   4351     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4352     xcb_buffer_len += xcb_block_len + xcb_pad;
   4353     if (0 != xcb_pad) {
   4354         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   4355         xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   4356         xcb_parts_idx++;
   4357         xcb_pad = 0;
   4358     }
   4359     xcb_block_len = 0;
   4360     xcb_padding_offset = 0;
   4361 
   4362     if (NULL == xcb_out) {
   4363         /* allocate memory */
   4364         xcb_out = malloc(xcb_buffer_len);
   4365         *_buffer = xcb_out;
   4366     }
   4367 
   4368     xcb_tmp = xcb_out;
   4369     for(i=0; i<xcb_parts_idx; i++) {
   4370         if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
   4371             memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
   4372         if (0 != xcb_parts[i].iov_len)
   4373             xcb_tmp += xcb_parts[i].iov_len;
   4374     }
   4375 
   4376     return xcb_buffer_len;
   4377 }
   4378 
   4379 int
   4380 xcb_xkb_set_map_values_unpack (const void                *_buffer,
   4381                                uint8_t                    nTypes,
   4382                                uint8_t                    nKeySyms,
   4383                                uint8_t                    nKeyActions,
   4384                                uint16_t                   totalActions,
   4385                                uint8_t                    totalKeyBehaviors,
   4386                                uint16_t                   virtualMods,
   4387                                uint8_t                    totalKeyExplicit,
   4388                                uint8_t                    totalModMapKeys,
   4389                                uint8_t                    totalVModMapKeys,
   4390                                uint16_t                   present,
   4391                                xcb_xkb_set_map_values_t  *_aux)
   4392 {
   4393     char *xcb_tmp = (char *)_buffer;
   4394     unsigned int xcb_buffer_len = 0;
   4395     unsigned int xcb_block_len = 0;
   4396     unsigned int xcb_pad = 0;
   4397     unsigned int xcb_align_to = 0;
   4398     unsigned int xcb_padding_offset = 0;
   4399 
   4400     unsigned int i;
   4401     unsigned int xcb_tmp_len;
   4402 
   4403     if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
   4404         /* insert padding */
   4405         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4406         xcb_buffer_len += xcb_block_len + xcb_pad;
   4407         if (0 != xcb_pad) {
   4408             xcb_tmp += xcb_pad;
   4409             xcb_pad = 0;
   4410         }
   4411         xcb_block_len = 0;
   4412         xcb_padding_offset = 0;
   4413         /* types */
   4414         _aux->types = (xcb_xkb_set_key_type_t *)xcb_tmp;
   4415         for(i=0; i<nTypes; i++) {
   4416             xcb_tmp_len = xcb_xkb_set_key_type_sizeof(xcb_tmp);
   4417             xcb_block_len += xcb_tmp_len;
   4418             xcb_tmp += xcb_tmp_len;
   4419         }
   4420         xcb_align_to = ALIGNOF(xcb_xkb_set_key_type_t);
   4421     }
   4422     if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
   4423         /* insert padding */
   4424         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4425         xcb_buffer_len += xcb_block_len + xcb_pad;
   4426         if (0 != xcb_pad) {
   4427             xcb_tmp += xcb_pad;
   4428             xcb_pad = 0;
   4429         }
   4430         xcb_block_len = 0;
   4431         xcb_padding_offset = 0;
   4432         /* syms */
   4433         _aux->syms = (xcb_xkb_key_sym_map_t *)xcb_tmp;
   4434         for(i=0; i<nKeySyms; i++) {
   4435             xcb_tmp_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
   4436             xcb_block_len += xcb_tmp_len;
   4437             xcb_tmp += xcb_tmp_len;
   4438         }
   4439         xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
   4440     }
   4441     if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
   4442         /* insert padding */
   4443         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4444         xcb_buffer_len += xcb_block_len + xcb_pad;
   4445         if (0 != xcb_pad) {
   4446             xcb_tmp += xcb_pad;
   4447             xcb_pad = 0;
   4448         }
   4449         xcb_block_len = 0;
   4450         xcb_padding_offset = 0;
   4451         /* actionsCount */
   4452         _aux->actionsCount = (uint8_t *)xcb_tmp;
   4453         xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
   4454         xcb_tmp += xcb_block_len;
   4455         xcb_align_to = ALIGNOF(uint8_t);
   4456         xcb_align_to = 4;
   4457         /* insert padding */
   4458         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4459         xcb_buffer_len += xcb_block_len + xcb_pad;
   4460         if (0 != xcb_pad) {
   4461             xcb_tmp += xcb_pad;
   4462             xcb_pad = 0;
   4463         }
   4464         xcb_block_len = 0;
   4465         xcb_padding_offset = 0;
   4466         /* insert padding */
   4467         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4468         xcb_buffer_len += xcb_block_len + xcb_pad;
   4469         if (0 != xcb_pad) {
   4470             xcb_tmp += xcb_pad;
   4471             xcb_pad = 0;
   4472         }
   4473         xcb_block_len = 0;
   4474         xcb_padding_offset = 0;
   4475         /* actions */
   4476         _aux->actions = (xcb_xkb_action_t *)xcb_tmp;
   4477         xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
   4478         xcb_tmp += xcb_block_len;
   4479         xcb_align_to = ALIGNOF(xcb_xkb_action_t);
   4480     }
   4481     if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
   4482         /* insert padding */
   4483         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4484         xcb_buffer_len += xcb_block_len + xcb_pad;
   4485         if (0 != xcb_pad) {
   4486             xcb_tmp += xcb_pad;
   4487             xcb_pad = 0;
   4488         }
   4489         xcb_block_len = 0;
   4490         xcb_padding_offset = 0;
   4491         /* behaviors */
   4492         _aux->behaviors = (xcb_xkb_set_behavior_t *)xcb_tmp;
   4493         xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
   4494         xcb_tmp += xcb_block_len;
   4495         xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
   4496     }
   4497     if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
   4498         /* insert padding */
   4499         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4500         xcb_buffer_len += xcb_block_len + xcb_pad;
   4501         if (0 != xcb_pad) {
   4502             xcb_tmp += xcb_pad;
   4503             xcb_pad = 0;
   4504         }
   4505         xcb_block_len = 0;
   4506         xcb_padding_offset = 0;
   4507         /* vmods */
   4508         _aux->vmods = (uint8_t *)xcb_tmp;
   4509         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
   4510         xcb_tmp += xcb_block_len;
   4511         xcb_align_to = ALIGNOF(uint8_t);
   4512         xcb_align_to = 4;
   4513         /* insert padding */
   4514         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4515         xcb_buffer_len += xcb_block_len + xcb_pad;
   4516         if (0 != xcb_pad) {
   4517             xcb_tmp += xcb_pad;
   4518             xcb_pad = 0;
   4519         }
   4520         xcb_block_len = 0;
   4521         xcb_padding_offset = 0;
   4522     }
   4523     if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
   4524         /* insert padding */
   4525         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4526         xcb_buffer_len += xcb_block_len + xcb_pad;
   4527         if (0 != xcb_pad) {
   4528             xcb_tmp += xcb_pad;
   4529             xcb_pad = 0;
   4530         }
   4531         xcb_block_len = 0;
   4532         xcb_padding_offset = 0;
   4533         /* explicit */
   4534         _aux->explicit = (xcb_xkb_set_explicit_t *)xcb_tmp;
   4535         xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
   4536         xcb_tmp += xcb_block_len;
   4537         xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
   4538     }
   4539     if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
   4540         /* insert padding */
   4541         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4542         xcb_buffer_len += xcb_block_len + xcb_pad;
   4543         if (0 != xcb_pad) {
   4544             xcb_tmp += xcb_pad;
   4545             xcb_pad = 0;
   4546         }
   4547         xcb_block_len = 0;
   4548         xcb_padding_offset = 0;
   4549         /* modmap */
   4550         _aux->modmap = (xcb_xkb_key_mod_map_t *)xcb_tmp;
   4551         xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
   4552         xcb_tmp += xcb_block_len;
   4553         xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
   4554     }
   4555     if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
   4556         /* insert padding */
   4557         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4558         xcb_buffer_len += xcb_block_len + xcb_pad;
   4559         if (0 != xcb_pad) {
   4560             xcb_tmp += xcb_pad;
   4561             xcb_pad = 0;
   4562         }
   4563         xcb_block_len = 0;
   4564         xcb_padding_offset = 0;
   4565         /* vmodmap */
   4566         _aux->vmodmap = (xcb_xkb_key_v_mod_map_t *)xcb_tmp;
   4567         xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
   4568         xcb_tmp += xcb_block_len;
   4569         xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
   4570     }
   4571     /* insert padding */
   4572     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   4573     xcb_buffer_len += xcb_block_len + xcb_pad;
   4574     if (0 != xcb_pad) {
   4575         xcb_tmp += xcb_pad;
   4576         xcb_pad = 0;
   4577     }
   4578     xcb_block_len = 0;
   4579     xcb_padding_offset = 0;
   4580 
   4581     return xcb_buffer_len;
   4582 }
   4583 
   4584 int
   4585 xcb_xkb_set_map_values_sizeof (const void  *_buffer,
   4586                                uint8_t      nTypes,
   4587                                uint8_t      nKeySyms,
   4588                                uint8_t      nKeyActions,
   4589                                uint16_t     totalActions,
   4590                                uint8_t      totalKeyBehaviors,
   4591                                uint16_t     virtualMods,
   4592                                uint8_t      totalKeyExplicit,
   4593                                uint8_t      totalModMapKeys,
   4594                                uint8_t      totalVModMapKeys,
   4595                                uint16_t     present)
   4596 {
   4597     xcb_xkb_set_map_values_t _aux;
   4598     return xcb_xkb_set_map_values_unpack(_buffer, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, &_aux);
   4599 }
   4600 
   4601 int
   4602 xcb_xkb_set_map_sizeof (const void  *_buffer)
   4603 {
   4604     char *xcb_tmp = (char *)_buffer;
   4605     const xcb_xkb_set_map_request_t *_aux = (xcb_xkb_set_map_request_t *)_buffer;
   4606     unsigned int xcb_buffer_len = 0;
   4607     unsigned int xcb_block_len = 0;
   4608     unsigned int xcb_pad = 0;
   4609     unsigned int xcb_align_to = 0;
   4610 
   4611 
   4612     xcb_block_len += sizeof(xcb_xkb_set_map_request_t);
   4613     xcb_tmp += xcb_block_len;
   4614     xcb_buffer_len += xcb_block_len;
   4615     xcb_block_len = 0;
   4616     /* values */
   4617     xcb_block_len += xcb_xkb_set_map_values_sizeof(xcb_tmp, _aux->nTypes, _aux->nKeySyms, _aux->nKeyActions, _aux->totalActions, _aux->totalKeyBehaviors, _aux->virtualMods, _aux->totalKeyExplicit, _aux->totalModMapKeys, _aux->totalVModMapKeys, _aux->present);
   4618     xcb_tmp += xcb_block_len;
   4619     xcb_align_to = ALIGNOF(char);
   4620     /* insert padding */
   4621     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   4622     xcb_buffer_len += xcb_block_len + xcb_pad;
   4623     if (0 != xcb_pad) {
   4624         xcb_tmp += xcb_pad;
   4625         xcb_pad = 0;
   4626     }
   4627     xcb_block_len = 0;
   4628 
   4629     return xcb_buffer_len;
   4630 }
   4631 
   4632 xcb_void_cookie_t
   4633 xcb_xkb_set_map_checked (xcb_connection_t      *c,
   4634                          xcb_xkb_device_spec_t  deviceSpec,
   4635                          uint16_t               present,
   4636                          uint16_t               flags,
   4637                          xcb_keycode_t          minKeyCode,
   4638                          xcb_keycode_t          maxKeyCode,
   4639                          uint8_t                firstType,
   4640                          uint8_t                nTypes,
   4641                          xcb_keycode_t          firstKeySym,
   4642                          uint8_t                nKeySyms,
   4643                          uint16_t               totalSyms,
   4644                          xcb_keycode_t          firstKeyAction,
   4645                          uint8_t                nKeyActions,
   4646                          uint16_t               totalActions,
   4647                          xcb_keycode_t          firstKeyBehavior,
   4648                          uint8_t                nKeyBehaviors,
   4649                          uint8_t                totalKeyBehaviors,
   4650                          xcb_keycode_t          firstKeyExplicit,
   4651                          uint8_t                nKeyExplicit,
   4652                          uint8_t                totalKeyExplicit,
   4653                          xcb_keycode_t          firstModMapKey,
   4654                          uint8_t                nModMapKeys,
   4655                          uint8_t                totalModMapKeys,
   4656                          xcb_keycode_t          firstVModMapKey,
   4657                          uint8_t                nVModMapKeys,
   4658                          uint8_t                totalVModMapKeys,
   4659                          uint16_t               virtualMods,
   4660                          const void            *values)
   4661 {
   4662     static const xcb_protocol_request_t xcb_req = {
   4663         .count = 3,
   4664         .ext = &xcb_xkb_id,
   4665         .opcode = XCB_XKB_SET_MAP,
   4666         .isvoid = 1
   4667     };
   4668 
   4669     struct iovec xcb_parts[5];
   4670     xcb_void_cookie_t xcb_ret;
   4671     xcb_xkb_set_map_request_t xcb_out;
   4672 
   4673     xcb_out.deviceSpec = deviceSpec;
   4674     xcb_out.present = present;
   4675     xcb_out.flags = flags;
   4676     xcb_out.minKeyCode = minKeyCode;
   4677     xcb_out.maxKeyCode = maxKeyCode;
   4678     xcb_out.firstType = firstType;
   4679     xcb_out.nTypes = nTypes;
   4680     xcb_out.firstKeySym = firstKeySym;
   4681     xcb_out.nKeySyms = nKeySyms;
   4682     xcb_out.totalSyms = totalSyms;
   4683     xcb_out.firstKeyAction = firstKeyAction;
   4684     xcb_out.nKeyActions = nKeyActions;
   4685     xcb_out.totalActions = totalActions;
   4686     xcb_out.firstKeyBehavior = firstKeyBehavior;
   4687     xcb_out.nKeyBehaviors = nKeyBehaviors;
   4688     xcb_out.totalKeyBehaviors = totalKeyBehaviors;
   4689     xcb_out.firstKeyExplicit = firstKeyExplicit;
   4690     xcb_out.nKeyExplicit = nKeyExplicit;
   4691     xcb_out.totalKeyExplicit = totalKeyExplicit;
   4692     xcb_out.firstModMapKey = firstModMapKey;
   4693     xcb_out.nModMapKeys = nModMapKeys;
   4694     xcb_out.totalModMapKeys = totalModMapKeys;
   4695     xcb_out.firstVModMapKey = firstVModMapKey;
   4696     xcb_out.nVModMapKeys = nVModMapKeys;
   4697     xcb_out.totalVModMapKeys = totalVModMapKeys;
   4698     xcb_out.virtualMods = virtualMods;
   4699 
   4700     xcb_parts[2].iov_base = (char *) &xcb_out;
   4701     xcb_parts[2].iov_len = sizeof(xcb_out);
   4702     xcb_parts[3].iov_base = 0;
   4703     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   4704     /* xcb_xkb_set_map_values_t values */
   4705     xcb_parts[4].iov_base = (char *) values;
   4706     xcb_parts[4].iov_len =
   4707       xcb_xkb_set_map_values_sizeof (values, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present);
   4708 
   4709     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   4710     return xcb_ret;
   4711 }
   4712 
   4713 xcb_void_cookie_t
   4714 xcb_xkb_set_map (xcb_connection_t      *c,
   4715                  xcb_xkb_device_spec_t  deviceSpec,
   4716                  uint16_t               present,
   4717                  uint16_t               flags,
   4718                  xcb_keycode_t          minKeyCode,
   4719                  xcb_keycode_t          maxKeyCode,
   4720                  uint8_t                firstType,
   4721                  uint8_t                nTypes,
   4722                  xcb_keycode_t          firstKeySym,
   4723                  uint8_t                nKeySyms,
   4724                  uint16_t               totalSyms,
   4725                  xcb_keycode_t          firstKeyAction,
   4726                  uint8_t                nKeyActions,
   4727                  uint16_t               totalActions,
   4728                  xcb_keycode_t          firstKeyBehavior,
   4729                  uint8_t                nKeyBehaviors,
   4730                  uint8_t                totalKeyBehaviors,
   4731                  xcb_keycode_t          firstKeyExplicit,
   4732                  uint8_t                nKeyExplicit,
   4733                  uint8_t                totalKeyExplicit,
   4734                  xcb_keycode_t          firstModMapKey,
   4735                  uint8_t                nModMapKeys,
   4736                  uint8_t                totalModMapKeys,
   4737                  xcb_keycode_t          firstVModMapKey,
   4738                  uint8_t                nVModMapKeys,
   4739                  uint8_t                totalVModMapKeys,
   4740                  uint16_t               virtualMods,
   4741                  const void            *values)
   4742 {
   4743     static const xcb_protocol_request_t xcb_req = {
   4744         .count = 3,
   4745         .ext = &xcb_xkb_id,
   4746         .opcode = XCB_XKB_SET_MAP,
   4747         .isvoid = 1
   4748     };
   4749 
   4750     struct iovec xcb_parts[5];
   4751     xcb_void_cookie_t xcb_ret;
   4752     xcb_xkb_set_map_request_t xcb_out;
   4753 
   4754     xcb_out.deviceSpec = deviceSpec;
   4755     xcb_out.present = present;
   4756     xcb_out.flags = flags;
   4757     xcb_out.minKeyCode = minKeyCode;
   4758     xcb_out.maxKeyCode = maxKeyCode;
   4759     xcb_out.firstType = firstType;
   4760     xcb_out.nTypes = nTypes;
   4761     xcb_out.firstKeySym = firstKeySym;
   4762     xcb_out.nKeySyms = nKeySyms;
   4763     xcb_out.totalSyms = totalSyms;
   4764     xcb_out.firstKeyAction = firstKeyAction;
   4765     xcb_out.nKeyActions = nKeyActions;
   4766     xcb_out.totalActions = totalActions;
   4767     xcb_out.firstKeyBehavior = firstKeyBehavior;
   4768     xcb_out.nKeyBehaviors = nKeyBehaviors;
   4769     xcb_out.totalKeyBehaviors = totalKeyBehaviors;
   4770     xcb_out.firstKeyExplicit = firstKeyExplicit;
   4771     xcb_out.nKeyExplicit = nKeyExplicit;
   4772     xcb_out.totalKeyExplicit = totalKeyExplicit;
   4773     xcb_out.firstModMapKey = firstModMapKey;
   4774     xcb_out.nModMapKeys = nModMapKeys;
   4775     xcb_out.totalModMapKeys = totalModMapKeys;
   4776     xcb_out.firstVModMapKey = firstVModMapKey;
   4777     xcb_out.nVModMapKeys = nVModMapKeys;
   4778     xcb_out.totalVModMapKeys = totalVModMapKeys;
   4779     xcb_out.virtualMods = virtualMods;
   4780 
   4781     xcb_parts[2].iov_base = (char *) &xcb_out;
   4782     xcb_parts[2].iov_len = sizeof(xcb_out);
   4783     xcb_parts[3].iov_base = 0;
   4784     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   4785     /* xcb_xkb_set_map_values_t values */
   4786     xcb_parts[4].iov_base = (char *) values;
   4787     xcb_parts[4].iov_len =
   4788       xcb_xkb_set_map_values_sizeof (values, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present);
   4789 
   4790     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   4791     return xcb_ret;
   4792 }
   4793 
   4794 xcb_void_cookie_t
   4795 xcb_xkb_set_map_aux_checked (xcb_connection_t               *c,
   4796                              xcb_xkb_device_spec_t           deviceSpec,
   4797                              uint16_t                        present,
   4798                              uint16_t                        flags,
   4799                              xcb_keycode_t                   minKeyCode,
   4800                              xcb_keycode_t                   maxKeyCode,
   4801                              uint8_t                         firstType,
   4802                              uint8_t                         nTypes,
   4803                              xcb_keycode_t                   firstKeySym,
   4804                              uint8_t                         nKeySyms,
   4805                              uint16_t                        totalSyms,
   4806                              xcb_keycode_t                   firstKeyAction,
   4807                              uint8_t                         nKeyActions,
   4808                              uint16_t                        totalActions,
   4809                              xcb_keycode_t                   firstKeyBehavior,
   4810                              uint8_t                         nKeyBehaviors,
   4811                              uint8_t                         totalKeyBehaviors,
   4812                              xcb_keycode_t                   firstKeyExplicit,
   4813                              uint8_t                         nKeyExplicit,
   4814                              uint8_t                         totalKeyExplicit,
   4815                              xcb_keycode_t                   firstModMapKey,
   4816                              uint8_t                         nModMapKeys,
   4817                              uint8_t                         totalModMapKeys,
   4818                              xcb_keycode_t                   firstVModMapKey,
   4819                              uint8_t                         nVModMapKeys,
   4820                              uint8_t                         totalVModMapKeys,
   4821                              uint16_t                        virtualMods,
   4822                              const xcb_xkb_set_map_values_t *values)
   4823 {
   4824     static const xcb_protocol_request_t xcb_req = {
   4825         .count = 3,
   4826         .ext = &xcb_xkb_id,
   4827         .opcode = XCB_XKB_SET_MAP,
   4828         .isvoid = 1
   4829     };
   4830 
   4831     struct iovec xcb_parts[5];
   4832     xcb_void_cookie_t xcb_ret;
   4833     xcb_xkb_set_map_request_t xcb_out;
   4834     void *xcb_aux0 = 0;
   4835 
   4836     xcb_out.deviceSpec = deviceSpec;
   4837     xcb_out.present = present;
   4838     xcb_out.flags = flags;
   4839     xcb_out.minKeyCode = minKeyCode;
   4840     xcb_out.maxKeyCode = maxKeyCode;
   4841     xcb_out.firstType = firstType;
   4842     xcb_out.nTypes = nTypes;
   4843     xcb_out.firstKeySym = firstKeySym;
   4844     xcb_out.nKeySyms = nKeySyms;
   4845     xcb_out.totalSyms = totalSyms;
   4846     xcb_out.firstKeyAction = firstKeyAction;
   4847     xcb_out.nKeyActions = nKeyActions;
   4848     xcb_out.totalActions = totalActions;
   4849     xcb_out.firstKeyBehavior = firstKeyBehavior;
   4850     xcb_out.nKeyBehaviors = nKeyBehaviors;
   4851     xcb_out.totalKeyBehaviors = totalKeyBehaviors;
   4852     xcb_out.firstKeyExplicit = firstKeyExplicit;
   4853     xcb_out.nKeyExplicit = nKeyExplicit;
   4854     xcb_out.totalKeyExplicit = totalKeyExplicit;
   4855     xcb_out.firstModMapKey = firstModMapKey;
   4856     xcb_out.nModMapKeys = nModMapKeys;
   4857     xcb_out.totalModMapKeys = totalModMapKeys;
   4858     xcb_out.firstVModMapKey = firstVModMapKey;
   4859     xcb_out.nVModMapKeys = nVModMapKeys;
   4860     xcb_out.totalVModMapKeys = totalVModMapKeys;
   4861     xcb_out.virtualMods = virtualMods;
   4862 
   4863     xcb_parts[2].iov_base = (char *) &xcb_out;
   4864     xcb_parts[2].iov_len = sizeof(xcb_out);
   4865     xcb_parts[3].iov_base = 0;
   4866     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   4867     /* xcb_xkb_set_map_values_t values */
   4868     xcb_parts[4].iov_len =
   4869       xcb_xkb_set_map_values_serialize (&xcb_aux0, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, values);
   4870     xcb_parts[4].iov_base = xcb_aux0;
   4871 
   4872     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   4873     free(xcb_aux0);
   4874     return xcb_ret;
   4875 }
   4876 
   4877 xcb_void_cookie_t
   4878 xcb_xkb_set_map_aux (xcb_connection_t               *c,
   4879                      xcb_xkb_device_spec_t           deviceSpec,
   4880                      uint16_t                        present,
   4881                      uint16_t                        flags,
   4882                      xcb_keycode_t                   minKeyCode,
   4883                      xcb_keycode_t                   maxKeyCode,
   4884                      uint8_t                         firstType,
   4885                      uint8_t                         nTypes,
   4886                      xcb_keycode_t                   firstKeySym,
   4887                      uint8_t                         nKeySyms,
   4888                      uint16_t                        totalSyms,
   4889                      xcb_keycode_t                   firstKeyAction,
   4890                      uint8_t                         nKeyActions,
   4891                      uint16_t                        totalActions,
   4892                      xcb_keycode_t                   firstKeyBehavior,
   4893                      uint8_t                         nKeyBehaviors,
   4894                      uint8_t                         totalKeyBehaviors,
   4895                      xcb_keycode_t                   firstKeyExplicit,
   4896                      uint8_t                         nKeyExplicit,
   4897                      uint8_t                         totalKeyExplicit,
   4898                      xcb_keycode_t                   firstModMapKey,
   4899                      uint8_t                         nModMapKeys,
   4900                      uint8_t                         totalModMapKeys,
   4901                      xcb_keycode_t                   firstVModMapKey,
   4902                      uint8_t                         nVModMapKeys,
   4903                      uint8_t                         totalVModMapKeys,
   4904                      uint16_t                        virtualMods,
   4905                      const xcb_xkb_set_map_values_t *values)
   4906 {
   4907     static const xcb_protocol_request_t xcb_req = {
   4908         .count = 3,
   4909         .ext = &xcb_xkb_id,
   4910         .opcode = XCB_XKB_SET_MAP,
   4911         .isvoid = 1
   4912     };
   4913 
   4914     struct iovec xcb_parts[5];
   4915     xcb_void_cookie_t xcb_ret;
   4916     xcb_xkb_set_map_request_t xcb_out;
   4917     void *xcb_aux0 = 0;
   4918 
   4919     xcb_out.deviceSpec = deviceSpec;
   4920     xcb_out.present = present;
   4921     xcb_out.flags = flags;
   4922     xcb_out.minKeyCode = minKeyCode;
   4923     xcb_out.maxKeyCode = maxKeyCode;
   4924     xcb_out.firstType = firstType;
   4925     xcb_out.nTypes = nTypes;
   4926     xcb_out.firstKeySym = firstKeySym;
   4927     xcb_out.nKeySyms = nKeySyms;
   4928     xcb_out.totalSyms = totalSyms;
   4929     xcb_out.firstKeyAction = firstKeyAction;
   4930     xcb_out.nKeyActions = nKeyActions;
   4931     xcb_out.totalActions = totalActions;
   4932     xcb_out.firstKeyBehavior = firstKeyBehavior;
   4933     xcb_out.nKeyBehaviors = nKeyBehaviors;
   4934     xcb_out.totalKeyBehaviors = totalKeyBehaviors;
   4935     xcb_out.firstKeyExplicit = firstKeyExplicit;
   4936     xcb_out.nKeyExplicit = nKeyExplicit;
   4937     xcb_out.totalKeyExplicit = totalKeyExplicit;
   4938     xcb_out.firstModMapKey = firstModMapKey;
   4939     xcb_out.nModMapKeys = nModMapKeys;
   4940     xcb_out.totalModMapKeys = totalModMapKeys;
   4941     xcb_out.firstVModMapKey = firstVModMapKey;
   4942     xcb_out.nVModMapKeys = nVModMapKeys;
   4943     xcb_out.totalVModMapKeys = totalVModMapKeys;
   4944     xcb_out.virtualMods = virtualMods;
   4945 
   4946     xcb_parts[2].iov_base = (char *) &xcb_out;
   4947     xcb_parts[2].iov_len = sizeof(xcb_out);
   4948     xcb_parts[3].iov_base = 0;
   4949     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   4950     /* xcb_xkb_set_map_values_t values */
   4951     xcb_parts[4].iov_len =
   4952       xcb_xkb_set_map_values_serialize (&xcb_aux0, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, values);
   4953     xcb_parts[4].iov_base = xcb_aux0;
   4954 
   4955     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   4956     free(xcb_aux0);
   4957     return xcb_ret;
   4958 }
   4959 
   4960 void *
   4961 xcb_xkb_set_map_values (const xcb_xkb_set_map_request_t *R)
   4962 {
   4963     return (void *) (R + 1);
   4964 }
   4965 
   4966 int
   4967 xcb_xkb_get_compat_map_sizeof (const void  *_buffer)
   4968 {
   4969     char *xcb_tmp = (char *)_buffer;
   4970     const xcb_xkb_get_compat_map_reply_t *_aux = (xcb_xkb_get_compat_map_reply_t *)_buffer;
   4971     unsigned int xcb_buffer_len = 0;
   4972     unsigned int xcb_block_len = 0;
   4973     unsigned int xcb_pad = 0;
   4974     unsigned int xcb_align_to = 0;
   4975 
   4976 
   4977     xcb_block_len += sizeof(xcb_xkb_get_compat_map_reply_t);
   4978     xcb_tmp += xcb_block_len;
   4979     xcb_buffer_len += xcb_block_len;
   4980     xcb_block_len = 0;
   4981     /* si_rtrn */
   4982     xcb_block_len += _aux->nSIRtrn * sizeof(xcb_xkb_sym_interpret_t);
   4983     xcb_tmp += xcb_block_len;
   4984     xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t);
   4985     /* insert padding */
   4986     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   4987     xcb_buffer_len += xcb_block_len + xcb_pad;
   4988     if (0 != xcb_pad) {
   4989         xcb_tmp += xcb_pad;
   4990         xcb_pad = 0;
   4991     }
   4992     xcb_block_len = 0;
   4993     /* group_rtrn */
   4994     xcb_block_len += xcb_popcount(_aux->groupsRtrn) * sizeof(xcb_xkb_mod_def_t);
   4995     xcb_tmp += xcb_block_len;
   4996     xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t);
   4997     /* insert padding */
   4998     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   4999     xcb_buffer_len += xcb_block_len + xcb_pad;
   5000     if (0 != xcb_pad) {
   5001         xcb_tmp += xcb_pad;
   5002         xcb_pad = 0;
   5003     }
   5004     xcb_block_len = 0;
   5005 
   5006     return xcb_buffer_len;
   5007 }
   5008 
   5009 xcb_xkb_get_compat_map_cookie_t
   5010 xcb_xkb_get_compat_map (xcb_connection_t      *c,
   5011                         xcb_xkb_device_spec_t  deviceSpec,
   5012                         uint8_t                groups,
   5013                         uint8_t                getAllSI,
   5014                         uint16_t               firstSI,
   5015                         uint16_t               nSI)
   5016 {
   5017     static const xcb_protocol_request_t xcb_req = {
   5018         .count = 2,
   5019         .ext = &xcb_xkb_id,
   5020         .opcode = XCB_XKB_GET_COMPAT_MAP,
   5021         .isvoid = 0
   5022     };
   5023 
   5024     struct iovec xcb_parts[4];
   5025     xcb_xkb_get_compat_map_cookie_t xcb_ret;
   5026     xcb_xkb_get_compat_map_request_t xcb_out;
   5027 
   5028     xcb_out.deviceSpec = deviceSpec;
   5029     xcb_out.groups = groups;
   5030     xcb_out.getAllSI = getAllSI;
   5031     xcb_out.firstSI = firstSI;
   5032     xcb_out.nSI = nSI;
   5033 
   5034     xcb_parts[2].iov_base = (char *) &xcb_out;
   5035     xcb_parts[2].iov_len = sizeof(xcb_out);
   5036     xcb_parts[3].iov_base = 0;
   5037     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5038 
   5039     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   5040     return xcb_ret;
   5041 }
   5042 
   5043 xcb_xkb_get_compat_map_cookie_t
   5044 xcb_xkb_get_compat_map_unchecked (xcb_connection_t      *c,
   5045                                   xcb_xkb_device_spec_t  deviceSpec,
   5046                                   uint8_t                groups,
   5047                                   uint8_t                getAllSI,
   5048                                   uint16_t               firstSI,
   5049                                   uint16_t               nSI)
   5050 {
   5051     static const xcb_protocol_request_t xcb_req = {
   5052         .count = 2,
   5053         .ext = &xcb_xkb_id,
   5054         .opcode = XCB_XKB_GET_COMPAT_MAP,
   5055         .isvoid = 0
   5056     };
   5057 
   5058     struct iovec xcb_parts[4];
   5059     xcb_xkb_get_compat_map_cookie_t xcb_ret;
   5060     xcb_xkb_get_compat_map_request_t xcb_out;
   5061 
   5062     xcb_out.deviceSpec = deviceSpec;
   5063     xcb_out.groups = groups;
   5064     xcb_out.getAllSI = getAllSI;
   5065     xcb_out.firstSI = firstSI;
   5066     xcb_out.nSI = nSI;
   5067 
   5068     xcb_parts[2].iov_base = (char *) &xcb_out;
   5069     xcb_parts[2].iov_len = sizeof(xcb_out);
   5070     xcb_parts[3].iov_base = 0;
   5071     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5072 
   5073     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   5074     return xcb_ret;
   5075 }
   5076 
   5077 xcb_xkb_sym_interpret_t *
   5078 xcb_xkb_get_compat_map_si_rtrn (const xcb_xkb_get_compat_map_reply_t *R)
   5079 {
   5080     return (xcb_xkb_sym_interpret_t *) (R + 1);
   5081 }
   5082 
   5083 int
   5084 xcb_xkb_get_compat_map_si_rtrn_length (const xcb_xkb_get_compat_map_reply_t *R)
   5085 {
   5086     return R->nSIRtrn;
   5087 }
   5088 
   5089 xcb_xkb_sym_interpret_iterator_t
   5090 xcb_xkb_get_compat_map_si_rtrn_iterator (const xcb_xkb_get_compat_map_reply_t *R)
   5091 {
   5092     xcb_xkb_sym_interpret_iterator_t i;
   5093     i.data = (xcb_xkb_sym_interpret_t *) (R + 1);
   5094     i.rem = R->nSIRtrn;
   5095     i.index = (char *) i.data - (char *) R;
   5096     return i;
   5097 }
   5098 
   5099 xcb_xkb_mod_def_t *
   5100 xcb_xkb_get_compat_map_group_rtrn (const xcb_xkb_get_compat_map_reply_t *R)
   5101 {
   5102     xcb_generic_iterator_t prev = xcb_xkb_sym_interpret_end(xcb_xkb_get_compat_map_si_rtrn_iterator(R));
   5103     return (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index) + 0);
   5104 }
   5105 
   5106 int
   5107 xcb_xkb_get_compat_map_group_rtrn_length (const xcb_xkb_get_compat_map_reply_t *R)
   5108 {
   5109     return xcb_popcount(R->groupsRtrn);
   5110 }
   5111 
   5112 xcb_xkb_mod_def_iterator_t
   5113 xcb_xkb_get_compat_map_group_rtrn_iterator (const xcb_xkb_get_compat_map_reply_t *R)
   5114 {
   5115     xcb_xkb_mod_def_iterator_t i;
   5116     xcb_generic_iterator_t prev = xcb_xkb_sym_interpret_end(xcb_xkb_get_compat_map_si_rtrn_iterator(R));
   5117     i.data = (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index));
   5118     i.rem = xcb_popcount(R->groupsRtrn);
   5119     i.index = (char *) i.data - (char *) R;
   5120     return i;
   5121 }
   5122 
   5123 xcb_xkb_get_compat_map_reply_t *
   5124 xcb_xkb_get_compat_map_reply (xcb_connection_t                 *c,
   5125                               xcb_xkb_get_compat_map_cookie_t   cookie  /**< */,
   5126                               xcb_generic_error_t             **e)
   5127 {
   5128     return (xcb_xkb_get_compat_map_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   5129 }
   5130 
   5131 int
   5132 xcb_xkb_set_compat_map_sizeof (const void  *_buffer)
   5133 {
   5134     char *xcb_tmp = (char *)_buffer;
   5135     const xcb_xkb_set_compat_map_request_t *_aux = (xcb_xkb_set_compat_map_request_t *)_buffer;
   5136     unsigned int xcb_buffer_len = 0;
   5137     unsigned int xcb_block_len = 0;
   5138     unsigned int xcb_pad = 0;
   5139     unsigned int xcb_align_to = 0;
   5140 
   5141 
   5142     xcb_block_len += sizeof(xcb_xkb_set_compat_map_request_t);
   5143     xcb_tmp += xcb_block_len;
   5144     xcb_buffer_len += xcb_block_len;
   5145     xcb_block_len = 0;
   5146     /* si */
   5147     xcb_block_len += _aux->nSI * sizeof(xcb_xkb_sym_interpret_t);
   5148     xcb_tmp += xcb_block_len;
   5149     xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t);
   5150     /* insert padding */
   5151     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   5152     xcb_buffer_len += xcb_block_len + xcb_pad;
   5153     if (0 != xcb_pad) {
   5154         xcb_tmp += xcb_pad;
   5155         xcb_pad = 0;
   5156     }
   5157     xcb_block_len = 0;
   5158     /* groupMaps */
   5159     xcb_block_len += xcb_popcount(_aux->groups) * sizeof(xcb_xkb_mod_def_t);
   5160     xcb_tmp += xcb_block_len;
   5161     xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t);
   5162     /* insert padding */
   5163     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   5164     xcb_buffer_len += xcb_block_len + xcb_pad;
   5165     if (0 != xcb_pad) {
   5166         xcb_tmp += xcb_pad;
   5167         xcb_pad = 0;
   5168     }
   5169     xcb_block_len = 0;
   5170 
   5171     return xcb_buffer_len;
   5172 }
   5173 
   5174 xcb_void_cookie_t
   5175 xcb_xkb_set_compat_map_checked (xcb_connection_t              *c,
   5176                                 xcb_xkb_device_spec_t          deviceSpec,
   5177                                 uint8_t                        recomputeActions,
   5178                                 uint8_t                        truncateSI,
   5179                                 uint8_t                        groups,
   5180                                 uint16_t                       firstSI,
   5181                                 uint16_t                       nSI,
   5182                                 const xcb_xkb_sym_interpret_t *si,
   5183                                 const xcb_xkb_mod_def_t       *groupMaps)
   5184 {
   5185     static const xcb_protocol_request_t xcb_req = {
   5186         .count = 6,
   5187         .ext = &xcb_xkb_id,
   5188         .opcode = XCB_XKB_SET_COMPAT_MAP,
   5189         .isvoid = 1
   5190     };
   5191 
   5192     struct iovec xcb_parts[8];
   5193     xcb_void_cookie_t xcb_ret;
   5194     xcb_xkb_set_compat_map_request_t xcb_out;
   5195 
   5196     xcb_out.deviceSpec = deviceSpec;
   5197     xcb_out.pad0 = 0;
   5198     xcb_out.recomputeActions = recomputeActions;
   5199     xcb_out.truncateSI = truncateSI;
   5200     xcb_out.groups = groups;
   5201     xcb_out.firstSI = firstSI;
   5202     xcb_out.nSI = nSI;
   5203     memset(xcb_out.pad1, 0, 2);
   5204 
   5205     xcb_parts[2].iov_base = (char *) &xcb_out;
   5206     xcb_parts[2].iov_len = sizeof(xcb_out);
   5207     xcb_parts[3].iov_base = 0;
   5208     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5209     /* xcb_xkb_sym_interpret_t si */
   5210     xcb_parts[4].iov_base = (char *) si;
   5211     xcb_parts[4].iov_len = nSI * sizeof(xcb_xkb_sym_interpret_t);
   5212     xcb_parts[5].iov_base = 0;
   5213     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   5214     /* xcb_xkb_mod_def_t groupMaps */
   5215     xcb_parts[6].iov_base = (char *) groupMaps;
   5216     xcb_parts[6].iov_len = xcb_popcount(groups) * sizeof(xcb_xkb_mod_def_t);
   5217     xcb_parts[7].iov_base = 0;
   5218     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
   5219 
   5220     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   5221     return xcb_ret;
   5222 }
   5223 
   5224 xcb_void_cookie_t
   5225 xcb_xkb_set_compat_map (xcb_connection_t              *c,
   5226                         xcb_xkb_device_spec_t          deviceSpec,
   5227                         uint8_t                        recomputeActions,
   5228                         uint8_t                        truncateSI,
   5229                         uint8_t                        groups,
   5230                         uint16_t                       firstSI,
   5231                         uint16_t                       nSI,
   5232                         const xcb_xkb_sym_interpret_t *si,
   5233                         const xcb_xkb_mod_def_t       *groupMaps)
   5234 {
   5235     static const xcb_protocol_request_t xcb_req = {
   5236         .count = 6,
   5237         .ext = &xcb_xkb_id,
   5238         .opcode = XCB_XKB_SET_COMPAT_MAP,
   5239         .isvoid = 1
   5240     };
   5241 
   5242     struct iovec xcb_parts[8];
   5243     xcb_void_cookie_t xcb_ret;
   5244     xcb_xkb_set_compat_map_request_t xcb_out;
   5245 
   5246     xcb_out.deviceSpec = deviceSpec;
   5247     xcb_out.pad0 = 0;
   5248     xcb_out.recomputeActions = recomputeActions;
   5249     xcb_out.truncateSI = truncateSI;
   5250     xcb_out.groups = groups;
   5251     xcb_out.firstSI = firstSI;
   5252     xcb_out.nSI = nSI;
   5253     memset(xcb_out.pad1, 0, 2);
   5254 
   5255     xcb_parts[2].iov_base = (char *) &xcb_out;
   5256     xcb_parts[2].iov_len = sizeof(xcb_out);
   5257     xcb_parts[3].iov_base = 0;
   5258     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5259     /* xcb_xkb_sym_interpret_t si */
   5260     xcb_parts[4].iov_base = (char *) si;
   5261     xcb_parts[4].iov_len = nSI * sizeof(xcb_xkb_sym_interpret_t);
   5262     xcb_parts[5].iov_base = 0;
   5263     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   5264     /* xcb_xkb_mod_def_t groupMaps */
   5265     xcb_parts[6].iov_base = (char *) groupMaps;
   5266     xcb_parts[6].iov_len = xcb_popcount(groups) * sizeof(xcb_xkb_mod_def_t);
   5267     xcb_parts[7].iov_base = 0;
   5268     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
   5269 
   5270     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   5271     return xcb_ret;
   5272 }
   5273 
   5274 xcb_xkb_sym_interpret_t *
   5275 xcb_xkb_set_compat_map_si (const xcb_xkb_set_compat_map_request_t *R)
   5276 {
   5277     return (xcb_xkb_sym_interpret_t *) (R + 1);
   5278 }
   5279 
   5280 int
   5281 xcb_xkb_set_compat_map_si_length (const xcb_xkb_set_compat_map_request_t *R)
   5282 {
   5283     return R->nSI;
   5284 }
   5285 
   5286 xcb_xkb_sym_interpret_iterator_t
   5287 xcb_xkb_set_compat_map_si_iterator (const xcb_xkb_set_compat_map_request_t *R)
   5288 {
   5289     xcb_xkb_sym_interpret_iterator_t i;
   5290     i.data = (xcb_xkb_sym_interpret_t *) (R + 1);
   5291     i.rem = R->nSI;
   5292     i.index = (char *) i.data - (char *) R;
   5293     return i;
   5294 }
   5295 
   5296 xcb_xkb_mod_def_t *
   5297 xcb_xkb_set_compat_map_group_maps (const xcb_xkb_set_compat_map_request_t *R)
   5298 {
   5299     xcb_generic_iterator_t prev = xcb_xkb_sym_interpret_end(xcb_xkb_set_compat_map_si_iterator(R));
   5300     return (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index) + 0);
   5301 }
   5302 
   5303 int
   5304 xcb_xkb_set_compat_map_group_maps_length (const xcb_xkb_set_compat_map_request_t *R)
   5305 {
   5306     return xcb_popcount(R->groups);
   5307 }
   5308 
   5309 xcb_xkb_mod_def_iterator_t
   5310 xcb_xkb_set_compat_map_group_maps_iterator (const xcb_xkb_set_compat_map_request_t *R)
   5311 {
   5312     xcb_xkb_mod_def_iterator_t i;
   5313     xcb_generic_iterator_t prev = xcb_xkb_sym_interpret_end(xcb_xkb_set_compat_map_si_iterator(R));
   5314     i.data = (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index));
   5315     i.rem = xcb_popcount(R->groups);
   5316     i.index = (char *) i.data - (char *) R;
   5317     return i;
   5318 }
   5319 
   5320 xcb_xkb_get_indicator_state_cookie_t
   5321 xcb_xkb_get_indicator_state (xcb_connection_t      *c,
   5322                              xcb_xkb_device_spec_t  deviceSpec)
   5323 {
   5324     static const xcb_protocol_request_t xcb_req = {
   5325         .count = 2,
   5326         .ext = &xcb_xkb_id,
   5327         .opcode = XCB_XKB_GET_INDICATOR_STATE,
   5328         .isvoid = 0
   5329     };
   5330 
   5331     struct iovec xcb_parts[4];
   5332     xcb_xkb_get_indicator_state_cookie_t xcb_ret;
   5333     xcb_xkb_get_indicator_state_request_t xcb_out;
   5334 
   5335     xcb_out.deviceSpec = deviceSpec;
   5336     memset(xcb_out.pad0, 0, 2);
   5337 
   5338     xcb_parts[2].iov_base = (char *) &xcb_out;
   5339     xcb_parts[2].iov_len = sizeof(xcb_out);
   5340     xcb_parts[3].iov_base = 0;
   5341     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5342 
   5343     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   5344     return xcb_ret;
   5345 }
   5346 
   5347 xcb_xkb_get_indicator_state_cookie_t
   5348 xcb_xkb_get_indicator_state_unchecked (xcb_connection_t      *c,
   5349                                        xcb_xkb_device_spec_t  deviceSpec)
   5350 {
   5351     static const xcb_protocol_request_t xcb_req = {
   5352         .count = 2,
   5353         .ext = &xcb_xkb_id,
   5354         .opcode = XCB_XKB_GET_INDICATOR_STATE,
   5355         .isvoid = 0
   5356     };
   5357 
   5358     struct iovec xcb_parts[4];
   5359     xcb_xkb_get_indicator_state_cookie_t xcb_ret;
   5360     xcb_xkb_get_indicator_state_request_t xcb_out;
   5361 
   5362     xcb_out.deviceSpec = deviceSpec;
   5363     memset(xcb_out.pad0, 0, 2);
   5364 
   5365     xcb_parts[2].iov_base = (char *) &xcb_out;
   5366     xcb_parts[2].iov_len = sizeof(xcb_out);
   5367     xcb_parts[3].iov_base = 0;
   5368     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5369 
   5370     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   5371     return xcb_ret;
   5372 }
   5373 
   5374 xcb_xkb_get_indicator_state_reply_t *
   5375 xcb_xkb_get_indicator_state_reply (xcb_connection_t                      *c,
   5376                                    xcb_xkb_get_indicator_state_cookie_t   cookie  /**< */,
   5377                                    xcb_generic_error_t                  **e)
   5378 {
   5379     return (xcb_xkb_get_indicator_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   5380 }
   5381 
   5382 int
   5383 xcb_xkb_get_indicator_map_sizeof (const void  *_buffer)
   5384 {
   5385     char *xcb_tmp = (char *)_buffer;
   5386     const xcb_xkb_get_indicator_map_reply_t *_aux = (xcb_xkb_get_indicator_map_reply_t *)_buffer;
   5387     unsigned int xcb_buffer_len = 0;
   5388     unsigned int xcb_block_len = 0;
   5389     unsigned int xcb_pad = 0;
   5390     unsigned int xcb_align_to = 0;
   5391 
   5392 
   5393     xcb_block_len += sizeof(xcb_xkb_get_indicator_map_reply_t);
   5394     xcb_tmp += xcb_block_len;
   5395     xcb_buffer_len += xcb_block_len;
   5396     xcb_block_len = 0;
   5397     /* maps */
   5398     xcb_block_len += xcb_popcount(_aux->which) * sizeof(xcb_xkb_indicator_map_t);
   5399     xcb_tmp += xcb_block_len;
   5400     xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
   5401     /* insert padding */
   5402     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   5403     xcb_buffer_len += xcb_block_len + xcb_pad;
   5404     if (0 != xcb_pad) {
   5405         xcb_tmp += xcb_pad;
   5406         xcb_pad = 0;
   5407     }
   5408     xcb_block_len = 0;
   5409 
   5410     return xcb_buffer_len;
   5411 }
   5412 
   5413 xcb_xkb_get_indicator_map_cookie_t
   5414 xcb_xkb_get_indicator_map (xcb_connection_t      *c,
   5415                            xcb_xkb_device_spec_t  deviceSpec,
   5416                            uint32_t               which)
   5417 {
   5418     static const xcb_protocol_request_t xcb_req = {
   5419         .count = 2,
   5420         .ext = &xcb_xkb_id,
   5421         .opcode = XCB_XKB_GET_INDICATOR_MAP,
   5422         .isvoid = 0
   5423     };
   5424 
   5425     struct iovec xcb_parts[4];
   5426     xcb_xkb_get_indicator_map_cookie_t xcb_ret;
   5427     xcb_xkb_get_indicator_map_request_t xcb_out;
   5428 
   5429     xcb_out.deviceSpec = deviceSpec;
   5430     memset(xcb_out.pad0, 0, 2);
   5431     xcb_out.which = which;
   5432 
   5433     xcb_parts[2].iov_base = (char *) &xcb_out;
   5434     xcb_parts[2].iov_len = sizeof(xcb_out);
   5435     xcb_parts[3].iov_base = 0;
   5436     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5437 
   5438     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   5439     return xcb_ret;
   5440 }
   5441 
   5442 xcb_xkb_get_indicator_map_cookie_t
   5443 xcb_xkb_get_indicator_map_unchecked (xcb_connection_t      *c,
   5444                                      xcb_xkb_device_spec_t  deviceSpec,
   5445                                      uint32_t               which)
   5446 {
   5447     static const xcb_protocol_request_t xcb_req = {
   5448         .count = 2,
   5449         .ext = &xcb_xkb_id,
   5450         .opcode = XCB_XKB_GET_INDICATOR_MAP,
   5451         .isvoid = 0
   5452     };
   5453 
   5454     struct iovec xcb_parts[4];
   5455     xcb_xkb_get_indicator_map_cookie_t xcb_ret;
   5456     xcb_xkb_get_indicator_map_request_t xcb_out;
   5457 
   5458     xcb_out.deviceSpec = deviceSpec;
   5459     memset(xcb_out.pad0, 0, 2);
   5460     xcb_out.which = which;
   5461 
   5462     xcb_parts[2].iov_base = (char *) &xcb_out;
   5463     xcb_parts[2].iov_len = sizeof(xcb_out);
   5464     xcb_parts[3].iov_base = 0;
   5465     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5466 
   5467     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   5468     return xcb_ret;
   5469 }
   5470 
   5471 xcb_xkb_indicator_map_t *
   5472 xcb_xkb_get_indicator_map_maps (const xcb_xkb_get_indicator_map_reply_t *R)
   5473 {
   5474     return (xcb_xkb_indicator_map_t *) (R + 1);
   5475 }
   5476 
   5477 int
   5478 xcb_xkb_get_indicator_map_maps_length (const xcb_xkb_get_indicator_map_reply_t *R)
   5479 {
   5480     return xcb_popcount(R->which);
   5481 }
   5482 
   5483 xcb_xkb_indicator_map_iterator_t
   5484 xcb_xkb_get_indicator_map_maps_iterator (const xcb_xkb_get_indicator_map_reply_t *R)
   5485 {
   5486     xcb_xkb_indicator_map_iterator_t i;
   5487     i.data = (xcb_xkb_indicator_map_t *) (R + 1);
   5488     i.rem = xcb_popcount(R->which);
   5489     i.index = (char *) i.data - (char *) R;
   5490     return i;
   5491 }
   5492 
   5493 xcb_xkb_get_indicator_map_reply_t *
   5494 xcb_xkb_get_indicator_map_reply (xcb_connection_t                    *c,
   5495                                  xcb_xkb_get_indicator_map_cookie_t   cookie  /**< */,
   5496                                  xcb_generic_error_t                **e)
   5497 {
   5498     return (xcb_xkb_get_indicator_map_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   5499 }
   5500 
   5501 int
   5502 xcb_xkb_set_indicator_map_sizeof (const void  *_buffer)
   5503 {
   5504     char *xcb_tmp = (char *)_buffer;
   5505     const xcb_xkb_set_indicator_map_request_t *_aux = (xcb_xkb_set_indicator_map_request_t *)_buffer;
   5506     unsigned int xcb_buffer_len = 0;
   5507     unsigned int xcb_block_len = 0;
   5508     unsigned int xcb_pad = 0;
   5509     unsigned int xcb_align_to = 0;
   5510 
   5511 
   5512     xcb_block_len += sizeof(xcb_xkb_set_indicator_map_request_t);
   5513     xcb_tmp += xcb_block_len;
   5514     xcb_buffer_len += xcb_block_len;
   5515     xcb_block_len = 0;
   5516     /* maps */
   5517     xcb_block_len += xcb_popcount(_aux->which) * sizeof(xcb_xkb_indicator_map_t);
   5518     xcb_tmp += xcb_block_len;
   5519     xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
   5520     /* insert padding */
   5521     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   5522     xcb_buffer_len += xcb_block_len + xcb_pad;
   5523     if (0 != xcb_pad) {
   5524         xcb_tmp += xcb_pad;
   5525         xcb_pad = 0;
   5526     }
   5527     xcb_block_len = 0;
   5528 
   5529     return xcb_buffer_len;
   5530 }
   5531 
   5532 xcb_void_cookie_t
   5533 xcb_xkb_set_indicator_map_checked (xcb_connection_t              *c,
   5534                                    xcb_xkb_device_spec_t          deviceSpec,
   5535                                    uint32_t                       which,
   5536                                    const xcb_xkb_indicator_map_t *maps)
   5537 {
   5538     static const xcb_protocol_request_t xcb_req = {
   5539         .count = 4,
   5540         .ext = &xcb_xkb_id,
   5541         .opcode = XCB_XKB_SET_INDICATOR_MAP,
   5542         .isvoid = 1
   5543     };
   5544 
   5545     struct iovec xcb_parts[6];
   5546     xcb_void_cookie_t xcb_ret;
   5547     xcb_xkb_set_indicator_map_request_t xcb_out;
   5548 
   5549     xcb_out.deviceSpec = deviceSpec;
   5550     memset(xcb_out.pad0, 0, 2);
   5551     xcb_out.which = which;
   5552 
   5553     xcb_parts[2].iov_base = (char *) &xcb_out;
   5554     xcb_parts[2].iov_len = sizeof(xcb_out);
   5555     xcb_parts[3].iov_base = 0;
   5556     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5557     /* xcb_xkb_indicator_map_t maps */
   5558     xcb_parts[4].iov_base = (char *) maps;
   5559     xcb_parts[4].iov_len = xcb_popcount(which) * sizeof(xcb_xkb_indicator_map_t);
   5560     xcb_parts[5].iov_base = 0;
   5561     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   5562 
   5563     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   5564     return xcb_ret;
   5565 }
   5566 
   5567 xcb_void_cookie_t
   5568 xcb_xkb_set_indicator_map (xcb_connection_t              *c,
   5569                            xcb_xkb_device_spec_t          deviceSpec,
   5570                            uint32_t                       which,
   5571                            const xcb_xkb_indicator_map_t *maps)
   5572 {
   5573     static const xcb_protocol_request_t xcb_req = {
   5574         .count = 4,
   5575         .ext = &xcb_xkb_id,
   5576         .opcode = XCB_XKB_SET_INDICATOR_MAP,
   5577         .isvoid = 1
   5578     };
   5579 
   5580     struct iovec xcb_parts[6];
   5581     xcb_void_cookie_t xcb_ret;
   5582     xcb_xkb_set_indicator_map_request_t xcb_out;
   5583 
   5584     xcb_out.deviceSpec = deviceSpec;
   5585     memset(xcb_out.pad0, 0, 2);
   5586     xcb_out.which = which;
   5587 
   5588     xcb_parts[2].iov_base = (char *) &xcb_out;
   5589     xcb_parts[2].iov_len = sizeof(xcb_out);
   5590     xcb_parts[3].iov_base = 0;
   5591     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5592     /* xcb_xkb_indicator_map_t maps */
   5593     xcb_parts[4].iov_base = (char *) maps;
   5594     xcb_parts[4].iov_len = xcb_popcount(which) * sizeof(xcb_xkb_indicator_map_t);
   5595     xcb_parts[5].iov_base = 0;
   5596     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   5597 
   5598     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   5599     return xcb_ret;
   5600 }
   5601 
   5602 xcb_xkb_indicator_map_t *
   5603 xcb_xkb_set_indicator_map_maps (const xcb_xkb_set_indicator_map_request_t *R)
   5604 {
   5605     return (xcb_xkb_indicator_map_t *) (R + 1);
   5606 }
   5607 
   5608 int
   5609 xcb_xkb_set_indicator_map_maps_length (const xcb_xkb_set_indicator_map_request_t *R)
   5610 {
   5611     return xcb_popcount(R->which);
   5612 }
   5613 
   5614 xcb_xkb_indicator_map_iterator_t
   5615 xcb_xkb_set_indicator_map_maps_iterator (const xcb_xkb_set_indicator_map_request_t *R)
   5616 {
   5617     xcb_xkb_indicator_map_iterator_t i;
   5618     i.data = (xcb_xkb_indicator_map_t *) (R + 1);
   5619     i.rem = xcb_popcount(R->which);
   5620     i.index = (char *) i.data - (char *) R;
   5621     return i;
   5622 }
   5623 
   5624 xcb_xkb_get_named_indicator_cookie_t
   5625 xcb_xkb_get_named_indicator (xcb_connection_t         *c,
   5626                              xcb_xkb_device_spec_t     deviceSpec,
   5627                              xcb_xkb_led_class_spec_t  ledClass,
   5628                              xcb_xkb_id_spec_t         ledID,
   5629                              xcb_atom_t                indicator)
   5630 {
   5631     static const xcb_protocol_request_t xcb_req = {
   5632         .count = 2,
   5633         .ext = &xcb_xkb_id,
   5634         .opcode = XCB_XKB_GET_NAMED_INDICATOR,
   5635         .isvoid = 0
   5636     };
   5637 
   5638     struct iovec xcb_parts[4];
   5639     xcb_xkb_get_named_indicator_cookie_t xcb_ret;
   5640     xcb_xkb_get_named_indicator_request_t xcb_out;
   5641 
   5642     xcb_out.deviceSpec = deviceSpec;
   5643     xcb_out.ledClass = ledClass;
   5644     xcb_out.ledID = ledID;
   5645     memset(xcb_out.pad0, 0, 2);
   5646     xcb_out.indicator = indicator;
   5647 
   5648     xcb_parts[2].iov_base = (char *) &xcb_out;
   5649     xcb_parts[2].iov_len = sizeof(xcb_out);
   5650     xcb_parts[3].iov_base = 0;
   5651     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5652 
   5653     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   5654     return xcb_ret;
   5655 }
   5656 
   5657 xcb_xkb_get_named_indicator_cookie_t
   5658 xcb_xkb_get_named_indicator_unchecked (xcb_connection_t         *c,
   5659                                        xcb_xkb_device_spec_t     deviceSpec,
   5660                                        xcb_xkb_led_class_spec_t  ledClass,
   5661                                        xcb_xkb_id_spec_t         ledID,
   5662                                        xcb_atom_t                indicator)
   5663 {
   5664     static const xcb_protocol_request_t xcb_req = {
   5665         .count = 2,
   5666         .ext = &xcb_xkb_id,
   5667         .opcode = XCB_XKB_GET_NAMED_INDICATOR,
   5668         .isvoid = 0
   5669     };
   5670 
   5671     struct iovec xcb_parts[4];
   5672     xcb_xkb_get_named_indicator_cookie_t xcb_ret;
   5673     xcb_xkb_get_named_indicator_request_t xcb_out;
   5674 
   5675     xcb_out.deviceSpec = deviceSpec;
   5676     xcb_out.ledClass = ledClass;
   5677     xcb_out.ledID = ledID;
   5678     memset(xcb_out.pad0, 0, 2);
   5679     xcb_out.indicator = indicator;
   5680 
   5681     xcb_parts[2].iov_base = (char *) &xcb_out;
   5682     xcb_parts[2].iov_len = sizeof(xcb_out);
   5683     xcb_parts[3].iov_base = 0;
   5684     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5685 
   5686     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   5687     return xcb_ret;
   5688 }
   5689 
   5690 xcb_xkb_get_named_indicator_reply_t *
   5691 xcb_xkb_get_named_indicator_reply (xcb_connection_t                      *c,
   5692                                    xcb_xkb_get_named_indicator_cookie_t   cookie  /**< */,
   5693                                    xcb_generic_error_t                  **e)
   5694 {
   5695     return (xcb_xkb_get_named_indicator_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   5696 }
   5697 
   5698 xcb_void_cookie_t
   5699 xcb_xkb_set_named_indicator_checked (xcb_connection_t         *c,
   5700                                      xcb_xkb_device_spec_t     deviceSpec,
   5701                                      xcb_xkb_led_class_spec_t  ledClass,
   5702                                      xcb_xkb_id_spec_t         ledID,
   5703                                      xcb_atom_t                indicator,
   5704                                      uint8_t                   setState,
   5705                                      uint8_t                   on,
   5706                                      uint8_t                   setMap,
   5707                                      uint8_t                   createMap,
   5708                                      uint8_t                   map_flags,
   5709                                      uint8_t                   map_whichGroups,
   5710                                      uint8_t                   map_groups,
   5711                                      uint8_t                   map_whichMods,
   5712                                      uint8_t                   map_realMods,
   5713                                      uint16_t                  map_vmods,
   5714                                      uint32_t                  map_ctrls)
   5715 {
   5716     static const xcb_protocol_request_t xcb_req = {
   5717         .count = 2,
   5718         .ext = &xcb_xkb_id,
   5719         .opcode = XCB_XKB_SET_NAMED_INDICATOR,
   5720         .isvoid = 1
   5721     };
   5722 
   5723     struct iovec xcb_parts[4];
   5724     xcb_void_cookie_t xcb_ret;
   5725     xcb_xkb_set_named_indicator_request_t xcb_out;
   5726 
   5727     xcb_out.deviceSpec = deviceSpec;
   5728     xcb_out.ledClass = ledClass;
   5729     xcb_out.ledID = ledID;
   5730     memset(xcb_out.pad0, 0, 2);
   5731     xcb_out.indicator = indicator;
   5732     xcb_out.setState = setState;
   5733     xcb_out.on = on;
   5734     xcb_out.setMap = setMap;
   5735     xcb_out.createMap = createMap;
   5736     xcb_out.pad1 = 0;
   5737     xcb_out.map_flags = map_flags;
   5738     xcb_out.map_whichGroups = map_whichGroups;
   5739     xcb_out.map_groups = map_groups;
   5740     xcb_out.map_whichMods = map_whichMods;
   5741     xcb_out.map_realMods = map_realMods;
   5742     xcb_out.map_vmods = map_vmods;
   5743     xcb_out.map_ctrls = map_ctrls;
   5744 
   5745     xcb_parts[2].iov_base = (char *) &xcb_out;
   5746     xcb_parts[2].iov_len = sizeof(xcb_out);
   5747     xcb_parts[3].iov_base = 0;
   5748     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5749 
   5750     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   5751     return xcb_ret;
   5752 }
   5753 
   5754 xcb_void_cookie_t
   5755 xcb_xkb_set_named_indicator (xcb_connection_t         *c,
   5756                              xcb_xkb_device_spec_t     deviceSpec,
   5757                              xcb_xkb_led_class_spec_t  ledClass,
   5758                              xcb_xkb_id_spec_t         ledID,
   5759                              xcb_atom_t                indicator,
   5760                              uint8_t                   setState,
   5761                              uint8_t                   on,
   5762                              uint8_t                   setMap,
   5763                              uint8_t                   createMap,
   5764                              uint8_t                   map_flags,
   5765                              uint8_t                   map_whichGroups,
   5766                              uint8_t                   map_groups,
   5767                              uint8_t                   map_whichMods,
   5768                              uint8_t                   map_realMods,
   5769                              uint16_t                  map_vmods,
   5770                              uint32_t                  map_ctrls)
   5771 {
   5772     static const xcb_protocol_request_t xcb_req = {
   5773         .count = 2,
   5774         .ext = &xcb_xkb_id,
   5775         .opcode = XCB_XKB_SET_NAMED_INDICATOR,
   5776         .isvoid = 1
   5777     };
   5778 
   5779     struct iovec xcb_parts[4];
   5780     xcb_void_cookie_t xcb_ret;
   5781     xcb_xkb_set_named_indicator_request_t xcb_out;
   5782 
   5783     xcb_out.deviceSpec = deviceSpec;
   5784     xcb_out.ledClass = ledClass;
   5785     xcb_out.ledID = ledID;
   5786     memset(xcb_out.pad0, 0, 2);
   5787     xcb_out.indicator = indicator;
   5788     xcb_out.setState = setState;
   5789     xcb_out.on = on;
   5790     xcb_out.setMap = setMap;
   5791     xcb_out.createMap = createMap;
   5792     xcb_out.pad1 = 0;
   5793     xcb_out.map_flags = map_flags;
   5794     xcb_out.map_whichGroups = map_whichGroups;
   5795     xcb_out.map_groups = map_groups;
   5796     xcb_out.map_whichMods = map_whichMods;
   5797     xcb_out.map_realMods = map_realMods;
   5798     xcb_out.map_vmods = map_vmods;
   5799     xcb_out.map_ctrls = map_ctrls;
   5800 
   5801     xcb_parts[2].iov_base = (char *) &xcb_out;
   5802     xcb_parts[2].iov_len = sizeof(xcb_out);
   5803     xcb_parts[3].iov_base = 0;
   5804     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   5805 
   5806     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   5807     return xcb_ret;
   5808 }
   5809 
   5810 xcb_atom_t *
   5811 xcb_xkb_get_names_value_list_type_names (const xcb_xkb_get_names_value_list_t *S)
   5812 {
   5813     return S->typeNames;
   5814 }
   5815 
   5816 int
   5817 xcb_xkb_get_names_value_list_type_names_length (const xcb_xkb_get_names_reply_t *R,
   5818                                                 const xcb_xkb_get_names_value_list_t *S)
   5819 {
   5820     return R->nTypes;
   5821 }
   5822 
   5823 xcb_generic_iterator_t
   5824 xcb_xkb_get_names_value_list_type_names_end (const xcb_xkb_get_names_reply_t *R,
   5825                                              const xcb_xkb_get_names_value_list_t *S)
   5826 {
   5827     xcb_generic_iterator_t i;
   5828     i.data = S->typeNames + R->nTypes;
   5829     i.rem = 0;
   5830     i.index = (char *) i.data - (char *) S;
   5831     return i;
   5832 }
   5833 
   5834 uint8_t *
   5835 xcb_xkb_get_names_value_list_n_levels_per_type (const xcb_xkb_get_names_value_list_t *S)
   5836 {
   5837     return S->nLevelsPerType;
   5838 }
   5839 
   5840 int
   5841 xcb_xkb_get_names_value_list_n_levels_per_type_length (const xcb_xkb_get_names_reply_t *R,
   5842                                                        const xcb_xkb_get_names_value_list_t *S)
   5843 {
   5844     return R->nTypes;
   5845 }
   5846 
   5847 xcb_generic_iterator_t
   5848 xcb_xkb_get_names_value_list_n_levels_per_type_end (const xcb_xkb_get_names_reply_t *R,
   5849                                                     const xcb_xkb_get_names_value_list_t *S)
   5850 {
   5851     xcb_generic_iterator_t i;
   5852     i.data = S->nLevelsPerType + R->nTypes;
   5853     i.rem = 0;
   5854     i.index = (char *) i.data - (char *) S;
   5855     return i;
   5856 }
   5857 
   5858 xcb_atom_t *
   5859 xcb_xkb_get_names_value_list_kt_level_names (const xcb_xkb_get_names_value_list_t *S)
   5860 {
   5861     return S->ktLevelNames;
   5862 }
   5863 
   5864 int
   5865 xcb_xkb_get_names_value_list_kt_level_names_length (const xcb_xkb_get_names_reply_t *R,
   5866                                                     const xcb_xkb_get_names_value_list_t *S)
   5867 {
   5868     int xcb_pre_tmp_1; /* sumof length */
   5869     int xcb_pre_tmp_2; /* sumof loop counter */
   5870     int64_t xcb_pre_tmp_3; /* sumof sum */
   5871     const uint8_t* xcb_pre_tmp_4; /* sumof list ptr */
   5872     /* sumof start */
   5873     xcb_pre_tmp_1 = R->nTypes;
   5874     xcb_pre_tmp_3 = 0;
   5875     xcb_pre_tmp_4 = S->nLevelsPerType;
   5876     for (xcb_pre_tmp_2 = 0; xcb_pre_tmp_2 < xcb_pre_tmp_1; xcb_pre_tmp_2++) {
   5877         xcb_pre_tmp_3 += *xcb_pre_tmp_4;
   5878         xcb_pre_tmp_4++;
   5879     }
   5880     /* sumof end. Result is in xcb_pre_tmp_3 */
   5881     return xcb_pre_tmp_3;
   5882 }
   5883 
   5884 xcb_generic_iterator_t
   5885 xcb_xkb_get_names_value_list_kt_level_names_end (const xcb_xkb_get_names_reply_t *R,
   5886                                                  const xcb_xkb_get_names_value_list_t *S)
   5887 {
   5888     xcb_generic_iterator_t i;
   5889     int xcb_pre_tmp_5; /* sumof length */
   5890     int xcb_pre_tmp_6; /* sumof loop counter */
   5891     int64_t xcb_pre_tmp_7; /* sumof sum */
   5892     const uint8_t* xcb_pre_tmp_8; /* sumof list ptr */
   5893     /* sumof start */
   5894     xcb_pre_tmp_5 = R->nTypes;
   5895     xcb_pre_tmp_7 = 0;
   5896     xcb_pre_tmp_8 = S->nLevelsPerType;
   5897     for (xcb_pre_tmp_6 = 0; xcb_pre_tmp_6 < xcb_pre_tmp_5; xcb_pre_tmp_6++) {
   5898         xcb_pre_tmp_7 += *xcb_pre_tmp_8;
   5899         xcb_pre_tmp_8++;
   5900     }
   5901     /* sumof end. Result is in xcb_pre_tmp_7 */
   5902     i.data = S->ktLevelNames + xcb_pre_tmp_7;
   5903     i.rem = 0;
   5904     i.index = (char *) i.data - (char *) S;
   5905     return i;
   5906 }
   5907 
   5908 xcb_atom_t *
   5909 xcb_xkb_get_names_value_list_indicator_names (const xcb_xkb_get_names_value_list_t *S)
   5910 {
   5911     return S->indicatorNames;
   5912 }
   5913 
   5914 int
   5915 xcb_xkb_get_names_value_list_indicator_names_length (const xcb_xkb_get_names_reply_t *R,
   5916                                                      const xcb_xkb_get_names_value_list_t *S)
   5917 {
   5918     return xcb_popcount(R->indicators);
   5919 }
   5920 
   5921 xcb_generic_iterator_t
   5922 xcb_xkb_get_names_value_list_indicator_names_end (const xcb_xkb_get_names_reply_t *R,
   5923                                                   const xcb_xkb_get_names_value_list_t *S)
   5924 {
   5925     xcb_generic_iterator_t i;
   5926     i.data = S->indicatorNames + xcb_popcount(R->indicators);
   5927     i.rem = 0;
   5928     i.index = (char *) i.data - (char *) S;
   5929     return i;
   5930 }
   5931 
   5932 xcb_atom_t *
   5933 xcb_xkb_get_names_value_list_virtual_mod_names (const xcb_xkb_get_names_value_list_t *S)
   5934 {
   5935     return S->virtualModNames;
   5936 }
   5937 
   5938 int
   5939 xcb_xkb_get_names_value_list_virtual_mod_names_length (const xcb_xkb_get_names_reply_t *R,
   5940                                                        const xcb_xkb_get_names_value_list_t *S)
   5941 {
   5942     return xcb_popcount(R->virtualMods);
   5943 }
   5944 
   5945 xcb_generic_iterator_t
   5946 xcb_xkb_get_names_value_list_virtual_mod_names_end (const xcb_xkb_get_names_reply_t *R,
   5947                                                     const xcb_xkb_get_names_value_list_t *S)
   5948 {
   5949     xcb_generic_iterator_t i;
   5950     i.data = S->virtualModNames + xcb_popcount(R->virtualMods);
   5951     i.rem = 0;
   5952     i.index = (char *) i.data - (char *) S;
   5953     return i;
   5954 }
   5955 
   5956 xcb_atom_t *
   5957 xcb_xkb_get_names_value_list_groups (const xcb_xkb_get_names_value_list_t *S)
   5958 {
   5959     return S->groups;
   5960 }
   5961 
   5962 int
   5963 xcb_xkb_get_names_value_list_groups_length (const xcb_xkb_get_names_reply_t *R,
   5964                                             const xcb_xkb_get_names_value_list_t *S)
   5965 {
   5966     return xcb_popcount(R->groupNames);
   5967 }
   5968 
   5969 xcb_generic_iterator_t
   5970 xcb_xkb_get_names_value_list_groups_end (const xcb_xkb_get_names_reply_t *R,
   5971                                          const xcb_xkb_get_names_value_list_t *S)
   5972 {
   5973     xcb_generic_iterator_t i;
   5974     i.data = S->groups + xcb_popcount(R->groupNames);
   5975     i.rem = 0;
   5976     i.index = (char *) i.data - (char *) S;
   5977     return i;
   5978 }
   5979 
   5980 xcb_xkb_key_name_t *
   5981 xcb_xkb_get_names_value_list_key_names (const xcb_xkb_get_names_value_list_t *S)
   5982 {
   5983     return S->keyNames;
   5984 }
   5985 
   5986 int
   5987 xcb_xkb_get_names_value_list_key_names_length (const xcb_xkb_get_names_reply_t *R,
   5988                                                const xcb_xkb_get_names_value_list_t *S)
   5989 {
   5990     return R->nKeys;
   5991 }
   5992 
   5993 xcb_xkb_key_name_iterator_t
   5994 xcb_xkb_get_names_value_list_key_names_iterator (const xcb_xkb_get_names_reply_t *R,
   5995                                                  const xcb_xkb_get_names_value_list_t *S)
   5996 {
   5997     xcb_xkb_key_name_iterator_t i;
   5998     i.data = S->keyNames;
   5999     i.rem = R->nKeys;
   6000     i.index = (char *) i.data - (char *) S;
   6001     return i;
   6002 }
   6003 
   6004 xcb_xkb_key_alias_t *
   6005 xcb_xkb_get_names_value_list_key_aliases (const xcb_xkb_get_names_value_list_t *S)
   6006 {
   6007     return S->keyAliases;
   6008 }
   6009 
   6010 int
   6011 xcb_xkb_get_names_value_list_key_aliases_length (const xcb_xkb_get_names_reply_t *R,
   6012                                                  const xcb_xkb_get_names_value_list_t *S)
   6013 {
   6014     return R->nKeyAliases;
   6015 }
   6016 
   6017 xcb_xkb_key_alias_iterator_t
   6018 xcb_xkb_get_names_value_list_key_aliases_iterator (const xcb_xkb_get_names_reply_t *R,
   6019                                                    const xcb_xkb_get_names_value_list_t *S)
   6020 {
   6021     xcb_xkb_key_alias_iterator_t i;
   6022     i.data = S->keyAliases;
   6023     i.rem = R->nKeyAliases;
   6024     i.index = (char *) i.data - (char *) S;
   6025     return i;
   6026 }
   6027 
   6028 xcb_atom_t *
   6029 xcb_xkb_get_names_value_list_radio_group_names (const xcb_xkb_get_names_value_list_t *S)
   6030 {
   6031     return S->radioGroupNames;
   6032 }
   6033 
   6034 int
   6035 xcb_xkb_get_names_value_list_radio_group_names_length (const xcb_xkb_get_names_reply_t *R,
   6036                                                        const xcb_xkb_get_names_value_list_t *S)
   6037 {
   6038     return R->nRadioGroups;
   6039 }
   6040 
   6041 xcb_generic_iterator_t
   6042 xcb_xkb_get_names_value_list_radio_group_names_end (const xcb_xkb_get_names_reply_t *R,
   6043                                                     const xcb_xkb_get_names_value_list_t *S)
   6044 {
   6045     xcb_generic_iterator_t i;
   6046     i.data = S->radioGroupNames + R->nRadioGroups;
   6047     i.rem = 0;
   6048     i.index = (char *) i.data - (char *) S;
   6049     return i;
   6050 }
   6051 
   6052 int
   6053 xcb_xkb_get_names_value_list_serialize (void                                 **_buffer,
   6054                                         uint8_t                                nTypes,
   6055                                         uint32_t                               indicators,
   6056                                         uint16_t                               virtualMods,
   6057                                         uint8_t                                groupNames,
   6058                                         uint8_t                                nKeys,
   6059                                         uint8_t                                nKeyAliases,
   6060                                         uint8_t                                nRadioGroups,
   6061                                         uint32_t                               which,
   6062                                         const xcb_xkb_get_names_value_list_t  *_aux)
   6063 {
   6064     char *xcb_out = *_buffer;
   6065     unsigned int xcb_buffer_len = 0;
   6066     unsigned int xcb_align_to = 0;
   6067     unsigned int xcb_padding_offset = 0;
   6068 
   6069     int xcb_pre_tmp_1; /* sumof length */
   6070     int xcb_pre_tmp_2; /* sumof loop counter */
   6071     int64_t xcb_pre_tmp_3; /* sumof sum */
   6072     const uint8_t* xcb_pre_tmp_4; /* sumof list ptr */
   6073     unsigned int xcb_pad = 0;
   6074     char xcb_pad0[3] = {0, 0, 0};
   6075     struct iovec xcb_parts[26];
   6076     unsigned int xcb_parts_idx = 0;
   6077     unsigned int xcb_block_len = 0;
   6078     unsigned int i;
   6079     char *xcb_tmp;
   6080 
   6081     if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
   6082         /* xcb_xkb_get_names_value_list_t.keycodesName */
   6083         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->keycodesName;
   6084         xcb_block_len += sizeof(xcb_atom_t);
   6085         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   6086         xcb_parts_idx++;
   6087         xcb_align_to = ALIGNOF(xcb_atom_t);
   6088     }
   6089     if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
   6090         /* xcb_xkb_get_names_value_list_t.geometryName */
   6091         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometryName;
   6092         xcb_block_len += sizeof(xcb_atom_t);
   6093         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   6094         xcb_parts_idx++;
   6095         xcb_align_to = ALIGNOF(xcb_atom_t);
   6096     }
   6097     if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
   6098         /* xcb_xkb_get_names_value_list_t.symbolsName */
   6099         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->symbolsName;
   6100         xcb_block_len += sizeof(xcb_atom_t);
   6101         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   6102         xcb_parts_idx++;
   6103         xcb_align_to = ALIGNOF(xcb_atom_t);
   6104     }
   6105     if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
   6106         /* xcb_xkb_get_names_value_list_t.physSymbolsName */
   6107         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->physSymbolsName;
   6108         xcb_block_len += sizeof(xcb_atom_t);
   6109         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   6110         xcb_parts_idx++;
   6111         xcb_align_to = ALIGNOF(xcb_atom_t);
   6112     }
   6113     if(which & XCB_XKB_NAME_DETAIL_TYPES) {
   6114         /* xcb_xkb_get_names_value_list_t.typesName */
   6115         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->typesName;
   6116         xcb_block_len += sizeof(xcb_atom_t);
   6117         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   6118         xcb_parts_idx++;
   6119         xcb_align_to = ALIGNOF(xcb_atom_t);
   6120     }
   6121     if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
   6122         /* xcb_xkb_get_names_value_list_t.compatName */
   6123         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatName;
   6124         xcb_block_len += sizeof(xcb_atom_t);
   6125         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   6126         xcb_parts_idx++;
   6127         xcb_align_to = ALIGNOF(xcb_atom_t);
   6128     }
   6129     if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
   6130         /* insert padding */
   6131         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6132         xcb_buffer_len += xcb_block_len + xcb_pad;
   6133         if (0 != xcb_pad) {
   6134             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6135             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6136             xcb_parts_idx++;
   6137             xcb_pad = 0;
   6138         }
   6139         xcb_block_len = 0;
   6140         xcb_padding_offset = 0;
   6141         /* typeNames */
   6142         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->typeNames;
   6143         xcb_block_len += nTypes * sizeof(xcb_atom_t);
   6144         xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(xcb_atom_t);
   6145         xcb_parts_idx++;
   6146         xcb_align_to = ALIGNOF(xcb_atom_t);
   6147     }
   6148     if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
   6149         /* insert padding */
   6150         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6151         xcb_buffer_len += xcb_block_len + xcb_pad;
   6152         if (0 != xcb_pad) {
   6153             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6154             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6155             xcb_parts_idx++;
   6156             xcb_pad = 0;
   6157         }
   6158         xcb_block_len = 0;
   6159         xcb_padding_offset = 0;
   6160         /* nLevelsPerType */
   6161         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->nLevelsPerType;
   6162         xcb_block_len += nTypes * sizeof(uint8_t);
   6163         xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(uint8_t);
   6164         xcb_parts_idx++;
   6165         xcb_align_to = ALIGNOF(uint8_t);
   6166         xcb_align_to = 4;
   6167         /* insert padding */
   6168         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6169         xcb_buffer_len += xcb_block_len + xcb_pad;
   6170         if (0 != xcb_pad) {
   6171             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6172             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6173             xcb_parts_idx++;
   6174             xcb_pad = 0;
   6175         }
   6176         xcb_block_len = 0;
   6177         xcb_padding_offset = 0;
   6178         /* insert padding */
   6179         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6180         xcb_buffer_len += xcb_block_len + xcb_pad;
   6181         if (0 != xcb_pad) {
   6182             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6183             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6184             xcb_parts_idx++;
   6185             xcb_pad = 0;
   6186         }
   6187         xcb_block_len = 0;
   6188         xcb_padding_offset = 0;
   6189         /* ktLevelNames */
   6190         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->ktLevelNames;
   6191         /* sumof start */
   6192         xcb_pre_tmp_1 = nTypes;
   6193         xcb_pre_tmp_3 = 0;
   6194         xcb_pre_tmp_4 = _aux->nLevelsPerType;
   6195         for (xcb_pre_tmp_2 = 0; xcb_pre_tmp_2 < xcb_pre_tmp_1; xcb_pre_tmp_2++) {
   6196             xcb_pre_tmp_3 += *xcb_pre_tmp_4;
   6197             xcb_pre_tmp_4++;
   6198         }
   6199         /* sumof end. Result is in xcb_pre_tmp_3 */
   6200         xcb_block_len += xcb_pre_tmp_3 * sizeof(xcb_atom_t);
   6201         xcb_parts[xcb_parts_idx].iov_len = xcb_pre_tmp_3 * sizeof(xcb_atom_t);
   6202         xcb_parts_idx++;
   6203         xcb_align_to = ALIGNOF(xcb_atom_t);
   6204     }
   6205     if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
   6206         /* insert padding */
   6207         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6208         xcb_buffer_len += xcb_block_len + xcb_pad;
   6209         if (0 != xcb_pad) {
   6210             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6211             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6212             xcb_parts_idx++;
   6213             xcb_pad = 0;
   6214         }
   6215         xcb_block_len = 0;
   6216         xcb_padding_offset = 0;
   6217         /* indicatorNames */
   6218         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicatorNames;
   6219         xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
   6220         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(indicators) * sizeof(xcb_atom_t);
   6221         xcb_parts_idx++;
   6222         xcb_align_to = ALIGNOF(xcb_atom_t);
   6223     }
   6224     if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
   6225         /* insert padding */
   6226         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6227         xcb_buffer_len += xcb_block_len + xcb_pad;
   6228         if (0 != xcb_pad) {
   6229             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6230             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6231             xcb_parts_idx++;
   6232             xcb_pad = 0;
   6233         }
   6234         xcb_block_len = 0;
   6235         xcb_padding_offset = 0;
   6236         /* virtualModNames */
   6237         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->virtualModNames;
   6238         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
   6239         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
   6240         xcb_parts_idx++;
   6241         xcb_align_to = ALIGNOF(xcb_atom_t);
   6242     }
   6243     if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
   6244         /* insert padding */
   6245         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6246         xcb_buffer_len += xcb_block_len + xcb_pad;
   6247         if (0 != xcb_pad) {
   6248             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6249             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6250             xcb_parts_idx++;
   6251             xcb_pad = 0;
   6252         }
   6253         xcb_block_len = 0;
   6254         xcb_padding_offset = 0;
   6255         /* groups */
   6256         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->groups;
   6257         xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
   6258         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(groupNames) * sizeof(xcb_atom_t);
   6259         xcb_parts_idx++;
   6260         xcb_align_to = ALIGNOF(xcb_atom_t);
   6261     }
   6262     if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
   6263         /* insert padding */
   6264         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6265         xcb_buffer_len += xcb_block_len + xcb_pad;
   6266         if (0 != xcb_pad) {
   6267             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6268             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6269             xcb_parts_idx++;
   6270             xcb_pad = 0;
   6271         }
   6272         xcb_block_len = 0;
   6273         xcb_padding_offset = 0;
   6274         /* keyNames */
   6275         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyNames;
   6276         xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
   6277         xcb_parts[xcb_parts_idx].iov_len = nKeys * sizeof(xcb_xkb_key_name_t);
   6278         xcb_parts_idx++;
   6279         xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
   6280     }
   6281     if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
   6282         /* insert padding */
   6283         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6284         xcb_buffer_len += xcb_block_len + xcb_pad;
   6285         if (0 != xcb_pad) {
   6286             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6287             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6288             xcb_parts_idx++;
   6289             xcb_pad = 0;
   6290         }
   6291         xcb_block_len = 0;
   6292         xcb_padding_offset = 0;
   6293         /* keyAliases */
   6294         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyAliases;
   6295         xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
   6296         xcb_parts[xcb_parts_idx].iov_len = nKeyAliases * sizeof(xcb_xkb_key_alias_t);
   6297         xcb_parts_idx++;
   6298         xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
   6299     }
   6300     if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
   6301         /* insert padding */
   6302         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6303         xcb_buffer_len += xcb_block_len + xcb_pad;
   6304         if (0 != xcb_pad) {
   6305             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6306             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6307             xcb_parts_idx++;
   6308             xcb_pad = 0;
   6309         }
   6310         xcb_block_len = 0;
   6311         xcb_padding_offset = 0;
   6312         /* radioGroupNames */
   6313         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->radioGroupNames;
   6314         xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
   6315         xcb_parts[xcb_parts_idx].iov_len = nRadioGroups * sizeof(xcb_atom_t);
   6316         xcb_parts_idx++;
   6317         xcb_align_to = ALIGNOF(xcb_atom_t);
   6318     }
   6319     /* insert padding */
   6320     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6321     xcb_buffer_len += xcb_block_len + xcb_pad;
   6322     if (0 != xcb_pad) {
   6323         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   6324         xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   6325         xcb_parts_idx++;
   6326         xcb_pad = 0;
   6327     }
   6328     xcb_block_len = 0;
   6329     xcb_padding_offset = 0;
   6330 
   6331     if (NULL == xcb_out) {
   6332         /* allocate memory */
   6333         xcb_out = malloc(xcb_buffer_len);
   6334         *_buffer = xcb_out;
   6335     }
   6336 
   6337     xcb_tmp = xcb_out;
   6338     for(i=0; i<xcb_parts_idx; i++) {
   6339         if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
   6340             memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
   6341         if (0 != xcb_parts[i].iov_len)
   6342             xcb_tmp += xcb_parts[i].iov_len;
   6343     }
   6344 
   6345     return xcb_buffer_len;
   6346 }
   6347 
   6348 int
   6349 xcb_xkb_get_names_value_list_unpack (const void                      *_buffer,
   6350                                      uint8_t                          nTypes,
   6351                                      uint32_t                         indicators,
   6352                                      uint16_t                         virtualMods,
   6353                                      uint8_t                          groupNames,
   6354                                      uint8_t                          nKeys,
   6355                                      uint8_t                          nKeyAliases,
   6356                                      uint8_t                          nRadioGroups,
   6357                                      uint32_t                         which,
   6358                                      xcb_xkb_get_names_value_list_t  *_aux)
   6359 {
   6360     char *xcb_tmp = (char *)_buffer;
   6361     unsigned int xcb_buffer_len = 0;
   6362     unsigned int xcb_block_len = 0;
   6363     unsigned int xcb_pad = 0;
   6364     unsigned int xcb_align_to = 0;
   6365     unsigned int xcb_padding_offset = 0;
   6366 
   6367     int xcb_pre_tmp_1; /* sumof length */
   6368     int xcb_pre_tmp_2; /* sumof loop counter */
   6369     int64_t xcb_pre_tmp_3; /* sumof sum */
   6370     const uint8_t* xcb_pre_tmp_4; /* sumof list ptr */
   6371 
   6372     if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
   6373         /* xcb_xkb_get_names_value_list_t.keycodesName */
   6374         _aux->keycodesName = *(xcb_atom_t *)xcb_tmp;
   6375         xcb_block_len += sizeof(xcb_atom_t);
   6376         xcb_tmp += sizeof(xcb_atom_t);
   6377         xcb_align_to = ALIGNOF(xcb_atom_t);
   6378     }
   6379     if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
   6380         /* xcb_xkb_get_names_value_list_t.geometryName */
   6381         _aux->geometryName = *(xcb_atom_t *)xcb_tmp;
   6382         xcb_block_len += sizeof(xcb_atom_t);
   6383         xcb_tmp += sizeof(xcb_atom_t);
   6384         xcb_align_to = ALIGNOF(xcb_atom_t);
   6385     }
   6386     if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
   6387         /* xcb_xkb_get_names_value_list_t.symbolsName */
   6388         _aux->symbolsName = *(xcb_atom_t *)xcb_tmp;
   6389         xcb_block_len += sizeof(xcb_atom_t);
   6390         xcb_tmp += sizeof(xcb_atom_t);
   6391         xcb_align_to = ALIGNOF(xcb_atom_t);
   6392     }
   6393     if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
   6394         /* xcb_xkb_get_names_value_list_t.physSymbolsName */
   6395         _aux->physSymbolsName = *(xcb_atom_t *)xcb_tmp;
   6396         xcb_block_len += sizeof(xcb_atom_t);
   6397         xcb_tmp += sizeof(xcb_atom_t);
   6398         xcb_align_to = ALIGNOF(xcb_atom_t);
   6399     }
   6400     if(which & XCB_XKB_NAME_DETAIL_TYPES) {
   6401         /* xcb_xkb_get_names_value_list_t.typesName */
   6402         _aux->typesName = *(xcb_atom_t *)xcb_tmp;
   6403         xcb_block_len += sizeof(xcb_atom_t);
   6404         xcb_tmp += sizeof(xcb_atom_t);
   6405         xcb_align_to = ALIGNOF(xcb_atom_t);
   6406     }
   6407     if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
   6408         /* xcb_xkb_get_names_value_list_t.compatName */
   6409         _aux->compatName = *(xcb_atom_t *)xcb_tmp;
   6410         xcb_block_len += sizeof(xcb_atom_t);
   6411         xcb_tmp += sizeof(xcb_atom_t);
   6412         xcb_align_to = ALIGNOF(xcb_atom_t);
   6413     }
   6414     if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
   6415         /* insert padding */
   6416         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6417         xcb_buffer_len += xcb_block_len + xcb_pad;
   6418         if (0 != xcb_pad) {
   6419             xcb_tmp += xcb_pad;
   6420             xcb_pad = 0;
   6421         }
   6422         xcb_block_len = 0;
   6423         xcb_padding_offset = 0;
   6424         /* typeNames */
   6425         _aux->typeNames = (xcb_atom_t *)xcb_tmp;
   6426         xcb_block_len += nTypes * sizeof(xcb_atom_t);
   6427         xcb_tmp += xcb_block_len;
   6428         xcb_align_to = ALIGNOF(xcb_atom_t);
   6429     }
   6430     if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
   6431         /* insert padding */
   6432         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6433         xcb_buffer_len += xcb_block_len + xcb_pad;
   6434         if (0 != xcb_pad) {
   6435             xcb_tmp += xcb_pad;
   6436             xcb_pad = 0;
   6437         }
   6438         xcb_block_len = 0;
   6439         xcb_padding_offset = 0;
   6440         /* nLevelsPerType */
   6441         _aux->nLevelsPerType = (uint8_t *)xcb_tmp;
   6442         xcb_block_len += nTypes * sizeof(uint8_t);
   6443         xcb_tmp += xcb_block_len;
   6444         xcb_align_to = ALIGNOF(uint8_t);
   6445         xcb_align_to = 4;
   6446         /* insert padding */
   6447         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6448         xcb_buffer_len += xcb_block_len + xcb_pad;
   6449         if (0 != xcb_pad) {
   6450             xcb_tmp += xcb_pad;
   6451             xcb_pad = 0;
   6452         }
   6453         xcb_block_len = 0;
   6454         xcb_padding_offset = 0;
   6455         /* insert padding */
   6456         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6457         xcb_buffer_len += xcb_block_len + xcb_pad;
   6458         if (0 != xcb_pad) {
   6459             xcb_tmp += xcb_pad;
   6460             xcb_pad = 0;
   6461         }
   6462         xcb_block_len = 0;
   6463         xcb_padding_offset = 0;
   6464         /* ktLevelNames */
   6465         _aux->ktLevelNames = (xcb_atom_t *)xcb_tmp;
   6466         /* sumof start */
   6467         xcb_pre_tmp_1 = nTypes;
   6468         xcb_pre_tmp_3 = 0;
   6469         xcb_pre_tmp_4 = _aux->nLevelsPerType;
   6470         for (xcb_pre_tmp_2 = 0; xcb_pre_tmp_2 < xcb_pre_tmp_1; xcb_pre_tmp_2++) {
   6471             xcb_pre_tmp_3 += *xcb_pre_tmp_4;
   6472             xcb_pre_tmp_4++;
   6473         }
   6474         /* sumof end. Result is in xcb_pre_tmp_3 */
   6475         xcb_block_len += xcb_pre_tmp_3 * sizeof(xcb_atom_t);
   6476         xcb_tmp += xcb_block_len;
   6477         xcb_align_to = ALIGNOF(xcb_atom_t);
   6478     }
   6479     if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
   6480         /* insert padding */
   6481         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6482         xcb_buffer_len += xcb_block_len + xcb_pad;
   6483         if (0 != xcb_pad) {
   6484             xcb_tmp += xcb_pad;
   6485             xcb_pad = 0;
   6486         }
   6487         xcb_block_len = 0;
   6488         xcb_padding_offset = 0;
   6489         /* indicatorNames */
   6490         _aux->indicatorNames = (xcb_atom_t *)xcb_tmp;
   6491         xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
   6492         xcb_tmp += xcb_block_len;
   6493         xcb_align_to = ALIGNOF(xcb_atom_t);
   6494     }
   6495     if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
   6496         /* insert padding */
   6497         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6498         xcb_buffer_len += xcb_block_len + xcb_pad;
   6499         if (0 != xcb_pad) {
   6500             xcb_tmp += xcb_pad;
   6501             xcb_pad = 0;
   6502         }
   6503         xcb_block_len = 0;
   6504         xcb_padding_offset = 0;
   6505         /* virtualModNames */
   6506         _aux->virtualModNames = (xcb_atom_t *)xcb_tmp;
   6507         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
   6508         xcb_tmp += xcb_block_len;
   6509         xcb_align_to = ALIGNOF(xcb_atom_t);
   6510     }
   6511     if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
   6512         /* insert padding */
   6513         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6514         xcb_buffer_len += xcb_block_len + xcb_pad;
   6515         if (0 != xcb_pad) {
   6516             xcb_tmp += xcb_pad;
   6517             xcb_pad = 0;
   6518         }
   6519         xcb_block_len = 0;
   6520         xcb_padding_offset = 0;
   6521         /* groups */
   6522         _aux->groups = (xcb_atom_t *)xcb_tmp;
   6523         xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
   6524         xcb_tmp += xcb_block_len;
   6525         xcb_align_to = ALIGNOF(xcb_atom_t);
   6526     }
   6527     if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
   6528         /* insert padding */
   6529         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6530         xcb_buffer_len += xcb_block_len + xcb_pad;
   6531         if (0 != xcb_pad) {
   6532             xcb_tmp += xcb_pad;
   6533             xcb_pad = 0;
   6534         }
   6535         xcb_block_len = 0;
   6536         xcb_padding_offset = 0;
   6537         /* keyNames */
   6538         _aux->keyNames = (xcb_xkb_key_name_t *)xcb_tmp;
   6539         xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
   6540         xcb_tmp += xcb_block_len;
   6541         xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
   6542     }
   6543     if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
   6544         /* insert padding */
   6545         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6546         xcb_buffer_len += xcb_block_len + xcb_pad;
   6547         if (0 != xcb_pad) {
   6548             xcb_tmp += xcb_pad;
   6549             xcb_pad = 0;
   6550         }
   6551         xcb_block_len = 0;
   6552         xcb_padding_offset = 0;
   6553         /* keyAliases */
   6554         _aux->keyAliases = (xcb_xkb_key_alias_t *)xcb_tmp;
   6555         xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
   6556         xcb_tmp += xcb_block_len;
   6557         xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
   6558     }
   6559     if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
   6560         /* insert padding */
   6561         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6562         xcb_buffer_len += xcb_block_len + xcb_pad;
   6563         if (0 != xcb_pad) {
   6564             xcb_tmp += xcb_pad;
   6565             xcb_pad = 0;
   6566         }
   6567         xcb_block_len = 0;
   6568         xcb_padding_offset = 0;
   6569         /* radioGroupNames */
   6570         _aux->radioGroupNames = (xcb_atom_t *)xcb_tmp;
   6571         xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
   6572         xcb_tmp += xcb_block_len;
   6573         xcb_align_to = ALIGNOF(xcb_atom_t);
   6574     }
   6575     /* insert padding */
   6576     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   6577     xcb_buffer_len += xcb_block_len + xcb_pad;
   6578     if (0 != xcb_pad) {
   6579         xcb_tmp += xcb_pad;
   6580         xcb_pad = 0;
   6581     }
   6582     xcb_block_len = 0;
   6583     xcb_padding_offset = 0;
   6584 
   6585     return xcb_buffer_len;
   6586 }
   6587 
   6588 int
   6589 xcb_xkb_get_names_value_list_sizeof (const void  *_buffer,
   6590                                      uint8_t      nTypes,
   6591                                      uint32_t     indicators,
   6592                                      uint16_t     virtualMods,
   6593                                      uint8_t      groupNames,
   6594                                      uint8_t      nKeys,
   6595                                      uint8_t      nKeyAliases,
   6596                                      uint8_t      nRadioGroups,
   6597                                      uint32_t     which)
   6598 {
   6599     xcb_xkb_get_names_value_list_t _aux;
   6600     return xcb_xkb_get_names_value_list_unpack(_buffer, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, &_aux);
   6601 }
   6602 
   6603 int
   6604 xcb_xkb_get_names_sizeof (const void  *_buffer)
   6605 {
   6606     char *xcb_tmp = (char *)_buffer;
   6607     const xcb_xkb_get_names_reply_t *_aux = (xcb_xkb_get_names_reply_t *)_buffer;
   6608     unsigned int xcb_buffer_len = 0;
   6609     unsigned int xcb_block_len = 0;
   6610     unsigned int xcb_pad = 0;
   6611     unsigned int xcb_align_to = 0;
   6612 
   6613 
   6614     xcb_block_len += sizeof(xcb_xkb_get_names_reply_t);
   6615     xcb_tmp += xcb_block_len;
   6616     xcb_buffer_len += xcb_block_len;
   6617     xcb_block_len = 0;
   6618     /* valueList */
   6619     xcb_block_len += xcb_xkb_get_names_value_list_sizeof(xcb_tmp, _aux->nTypes, _aux->indicators, _aux->virtualMods, _aux->groupNames, _aux->nKeys, _aux->nKeyAliases, _aux->nRadioGroups, _aux->which);
   6620     xcb_tmp += xcb_block_len;
   6621     xcb_align_to = ALIGNOF(char);
   6622     /* insert padding */
   6623     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   6624     xcb_buffer_len += xcb_block_len + xcb_pad;
   6625     if (0 != xcb_pad) {
   6626         xcb_tmp += xcb_pad;
   6627         xcb_pad = 0;
   6628     }
   6629     xcb_block_len = 0;
   6630 
   6631     return xcb_buffer_len;
   6632 }
   6633 
   6634 xcb_xkb_get_names_cookie_t
   6635 xcb_xkb_get_names (xcb_connection_t      *c,
   6636                    xcb_xkb_device_spec_t  deviceSpec,
   6637                    uint32_t               which)
   6638 {
   6639     static const xcb_protocol_request_t xcb_req = {
   6640         .count = 2,
   6641         .ext = &xcb_xkb_id,
   6642         .opcode = XCB_XKB_GET_NAMES,
   6643         .isvoid = 0
   6644     };
   6645 
   6646     struct iovec xcb_parts[4];
   6647     xcb_xkb_get_names_cookie_t xcb_ret;
   6648     xcb_xkb_get_names_request_t xcb_out;
   6649 
   6650     xcb_out.deviceSpec = deviceSpec;
   6651     memset(xcb_out.pad0, 0, 2);
   6652     xcb_out.which = which;
   6653 
   6654     xcb_parts[2].iov_base = (char *) &xcb_out;
   6655     xcb_parts[2].iov_len = sizeof(xcb_out);
   6656     xcb_parts[3].iov_base = 0;
   6657     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   6658 
   6659     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   6660     return xcb_ret;
   6661 }
   6662 
   6663 xcb_xkb_get_names_cookie_t
   6664 xcb_xkb_get_names_unchecked (xcb_connection_t      *c,
   6665                              xcb_xkb_device_spec_t  deviceSpec,
   6666                              uint32_t               which)
   6667 {
   6668     static const xcb_protocol_request_t xcb_req = {
   6669         .count = 2,
   6670         .ext = &xcb_xkb_id,
   6671         .opcode = XCB_XKB_GET_NAMES,
   6672         .isvoid = 0
   6673     };
   6674 
   6675     struct iovec xcb_parts[4];
   6676     xcb_xkb_get_names_cookie_t xcb_ret;
   6677     xcb_xkb_get_names_request_t xcb_out;
   6678 
   6679     xcb_out.deviceSpec = deviceSpec;
   6680     memset(xcb_out.pad0, 0, 2);
   6681     xcb_out.which = which;
   6682 
   6683     xcb_parts[2].iov_base = (char *) &xcb_out;
   6684     xcb_parts[2].iov_len = sizeof(xcb_out);
   6685     xcb_parts[3].iov_base = 0;
   6686     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   6687 
   6688     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   6689     return xcb_ret;
   6690 }
   6691 
   6692 void *
   6693 xcb_xkb_get_names_value_list (const xcb_xkb_get_names_reply_t *R)
   6694 {
   6695     return (void *) (R + 1);
   6696 }
   6697 
   6698 xcb_xkb_get_names_reply_t *
   6699 xcb_xkb_get_names_reply (xcb_connection_t            *c,
   6700                          xcb_xkb_get_names_cookie_t   cookie  /**< */,
   6701                          xcb_generic_error_t        **e)
   6702 {
   6703     return (xcb_xkb_get_names_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   6704 }
   6705 
   6706 xcb_atom_t *
   6707 xcb_xkb_set_names_values_type_names (const xcb_xkb_set_names_values_t *S)
   6708 {
   6709     return S->typeNames;
   6710 }
   6711 
   6712 int
   6713 xcb_xkb_set_names_values_type_names_length (const xcb_xkb_set_names_request_t *R,
   6714                                             const xcb_xkb_set_names_values_t *S)
   6715 {
   6716     return R->nTypes;
   6717 }
   6718 
   6719 xcb_generic_iterator_t
   6720 xcb_xkb_set_names_values_type_names_end (const xcb_xkb_set_names_request_t *R,
   6721                                          const xcb_xkb_set_names_values_t *S)
   6722 {
   6723     xcb_generic_iterator_t i;
   6724     i.data = S->typeNames + R->nTypes;
   6725     i.rem = 0;
   6726     i.index = (char *) i.data - (char *) S;
   6727     return i;
   6728 }
   6729 
   6730 uint8_t *
   6731 xcb_xkb_set_names_values_n_levels_per_type (const xcb_xkb_set_names_values_t *S)
   6732 {
   6733     return S->nLevelsPerType;
   6734 }
   6735 
   6736 int
   6737 xcb_xkb_set_names_values_n_levels_per_type_length (const xcb_xkb_set_names_request_t *R,
   6738                                                    const xcb_xkb_set_names_values_t *S)
   6739 {
   6740     return R->nTypes;
   6741 }
   6742 
   6743 xcb_generic_iterator_t
   6744 xcb_xkb_set_names_values_n_levels_per_type_end (const xcb_xkb_set_names_request_t *R,
   6745                                                 const xcb_xkb_set_names_values_t *S)
   6746 {
   6747     xcb_generic_iterator_t i;
   6748     i.data = S->nLevelsPerType + R->nTypes;
   6749     i.rem = 0;
   6750     i.index = (char *) i.data - (char *) S;
   6751     return i;
   6752 }
   6753 
   6754 xcb_atom_t *
   6755 xcb_xkb_set_names_values_kt_level_names (const xcb_xkb_set_names_values_t *S)
   6756 {
   6757     return S->ktLevelNames;
   6758 }
   6759 
   6760 int
   6761 xcb_xkb_set_names_values_kt_level_names_length (const xcb_xkb_set_names_request_t *R,
   6762                                                 const xcb_xkb_set_names_values_t *S)
   6763 {
   6764     int xcb_pre_tmp_1; /* sumof length */
   6765     int xcb_pre_tmp_2; /* sumof loop counter */
   6766     int64_t xcb_pre_tmp_3; /* sumof sum */
   6767     const uint8_t* xcb_pre_tmp_4; /* sumof list ptr */
   6768     /* sumof start */
   6769     xcb_pre_tmp_1 = R->nTypes;
   6770     xcb_pre_tmp_3 = 0;
   6771     xcb_pre_tmp_4 = S->nLevelsPerType;
   6772     for (xcb_pre_tmp_2 = 0; xcb_pre_tmp_2 < xcb_pre_tmp_1; xcb_pre_tmp_2++) {
   6773         xcb_pre_tmp_3 += *xcb_pre_tmp_4;
   6774         xcb_pre_tmp_4++;
   6775     }
   6776     /* sumof end. Result is in xcb_pre_tmp_3 */
   6777     return xcb_pre_tmp_3;
   6778 }
   6779 
   6780 xcb_generic_iterator_t
   6781 xcb_xkb_set_names_values_kt_level_names_end (const xcb_xkb_set_names_request_t *R,
   6782                                              const xcb_xkb_set_names_values_t *S)
   6783 {
   6784     xcb_generic_iterator_t i;
   6785     int xcb_pre_tmp_5; /* sumof length */
   6786     int xcb_pre_tmp_6; /* sumof loop counter */
   6787     int64_t xcb_pre_tmp_7; /* sumof sum */
   6788     const uint8_t* xcb_pre_tmp_8; /* sumof list ptr */
   6789     /* sumof start */
   6790     xcb_pre_tmp_5 = R->nTypes;
   6791     xcb_pre_tmp_7 = 0;
   6792     xcb_pre_tmp_8 = S->nLevelsPerType;
   6793     for (xcb_pre_tmp_6 = 0; xcb_pre_tmp_6 < xcb_pre_tmp_5; xcb_pre_tmp_6++) {
   6794         xcb_pre_tmp_7 += *xcb_pre_tmp_8;
   6795         xcb_pre_tmp_8++;
   6796     }
   6797     /* sumof end. Result is in xcb_pre_tmp_7 */
   6798     i.data = S->ktLevelNames + xcb_pre_tmp_7;
   6799     i.rem = 0;
   6800     i.index = (char *) i.data - (char *) S;
   6801     return i;
   6802 }
   6803 
   6804 xcb_atom_t *
   6805 xcb_xkb_set_names_values_indicator_names (const xcb_xkb_set_names_values_t *S)
   6806 {
   6807     return S->indicatorNames;
   6808 }
   6809 
   6810 int
   6811 xcb_xkb_set_names_values_indicator_names_length (const xcb_xkb_set_names_request_t *R,
   6812                                                  const xcb_xkb_set_names_values_t *S)
   6813 {
   6814     return xcb_popcount(R->indicators);
   6815 }
   6816 
   6817 xcb_generic_iterator_t
   6818 xcb_xkb_set_names_values_indicator_names_end (const xcb_xkb_set_names_request_t *R,
   6819                                               const xcb_xkb_set_names_values_t *S)
   6820 {
   6821     xcb_generic_iterator_t i;
   6822     i.data = S->indicatorNames + xcb_popcount(R->indicators);
   6823     i.rem = 0;
   6824     i.index = (char *) i.data - (char *) S;
   6825     return i;
   6826 }
   6827 
   6828 xcb_atom_t *
   6829 xcb_xkb_set_names_values_virtual_mod_names (const xcb_xkb_set_names_values_t *S)
   6830 {
   6831     return S->virtualModNames;
   6832 }
   6833 
   6834 int
   6835 xcb_xkb_set_names_values_virtual_mod_names_length (const xcb_xkb_set_names_request_t *R,
   6836                                                    const xcb_xkb_set_names_values_t *S)
   6837 {
   6838     return xcb_popcount(R->virtualMods);
   6839 }
   6840 
   6841 xcb_generic_iterator_t
   6842 xcb_xkb_set_names_values_virtual_mod_names_end (const xcb_xkb_set_names_request_t *R,
   6843                                                 const xcb_xkb_set_names_values_t *S)
   6844 {
   6845     xcb_generic_iterator_t i;
   6846     i.data = S->virtualModNames + xcb_popcount(R->virtualMods);
   6847     i.rem = 0;
   6848     i.index = (char *) i.data - (char *) S;
   6849     return i;
   6850 }
   6851 
   6852 xcb_atom_t *
   6853 xcb_xkb_set_names_values_groups (const xcb_xkb_set_names_values_t *S)
   6854 {
   6855     return S->groups;
   6856 }
   6857 
   6858 int
   6859 xcb_xkb_set_names_values_groups_length (const xcb_xkb_set_names_request_t *R,
   6860                                         const xcb_xkb_set_names_values_t *S)
   6861 {
   6862     return xcb_popcount(R->groupNames);
   6863 }
   6864 
   6865 xcb_generic_iterator_t
   6866 xcb_xkb_set_names_values_groups_end (const xcb_xkb_set_names_request_t *R,
   6867                                      const xcb_xkb_set_names_values_t *S)
   6868 {
   6869     xcb_generic_iterator_t i;
   6870     i.data = S->groups + xcb_popcount(R->groupNames);
   6871     i.rem = 0;
   6872     i.index = (char *) i.data - (char *) S;
   6873     return i;
   6874 }
   6875 
   6876 xcb_xkb_key_name_t *
   6877 xcb_xkb_set_names_values_key_names (const xcb_xkb_set_names_values_t *S)
   6878 {
   6879     return S->keyNames;
   6880 }
   6881 
   6882 int
   6883 xcb_xkb_set_names_values_key_names_length (const xcb_xkb_set_names_request_t *R,
   6884                                            const xcb_xkb_set_names_values_t *S)
   6885 {
   6886     return R->nKeys;
   6887 }
   6888 
   6889 xcb_xkb_key_name_iterator_t
   6890 xcb_xkb_set_names_values_key_names_iterator (const xcb_xkb_set_names_request_t *R,
   6891                                              const xcb_xkb_set_names_values_t *S)
   6892 {
   6893     xcb_xkb_key_name_iterator_t i;
   6894     i.data = S->keyNames;
   6895     i.rem = R->nKeys;
   6896     i.index = (char *) i.data - (char *) S;
   6897     return i;
   6898 }
   6899 
   6900 xcb_xkb_key_alias_t *
   6901 xcb_xkb_set_names_values_key_aliases (const xcb_xkb_set_names_values_t *S)
   6902 {
   6903     return S->keyAliases;
   6904 }
   6905 
   6906 int
   6907 xcb_xkb_set_names_values_key_aliases_length (const xcb_xkb_set_names_request_t *R,
   6908                                              const xcb_xkb_set_names_values_t *S)
   6909 {
   6910     return R->nKeyAliases;
   6911 }
   6912 
   6913 xcb_xkb_key_alias_iterator_t
   6914 xcb_xkb_set_names_values_key_aliases_iterator (const xcb_xkb_set_names_request_t *R,
   6915                                                const xcb_xkb_set_names_values_t *S)
   6916 {
   6917     xcb_xkb_key_alias_iterator_t i;
   6918     i.data = S->keyAliases;
   6919     i.rem = R->nKeyAliases;
   6920     i.index = (char *) i.data - (char *) S;
   6921     return i;
   6922 }
   6923 
   6924 xcb_atom_t *
   6925 xcb_xkb_set_names_values_radio_group_names (const xcb_xkb_set_names_values_t *S)
   6926 {
   6927     return S->radioGroupNames;
   6928 }
   6929 
   6930 int
   6931 xcb_xkb_set_names_values_radio_group_names_length (const xcb_xkb_set_names_request_t *R,
   6932                                                    const xcb_xkb_set_names_values_t *S)
   6933 {
   6934     return R->nRadioGroups;
   6935 }
   6936 
   6937 xcb_generic_iterator_t
   6938 xcb_xkb_set_names_values_radio_group_names_end (const xcb_xkb_set_names_request_t *R,
   6939                                                 const xcb_xkb_set_names_values_t *S)
   6940 {
   6941     xcb_generic_iterator_t i;
   6942     i.data = S->radioGroupNames + R->nRadioGroups;
   6943     i.rem = 0;
   6944     i.index = (char *) i.data - (char *) S;
   6945     return i;
   6946 }
   6947 
   6948 int
   6949 xcb_xkb_set_names_values_serialize (void                             **_buffer,
   6950                                     uint8_t                            nTypes,
   6951                                     uint32_t                           indicators,
   6952                                     uint16_t                           virtualMods,
   6953                                     uint8_t                            groupNames,
   6954                                     uint8_t                            nKeys,
   6955                                     uint8_t                            nKeyAliases,
   6956                                     uint8_t                            nRadioGroups,
   6957                                     uint32_t                           which,
   6958                                     const xcb_xkb_set_names_values_t  *_aux)
   6959 {
   6960     char *xcb_out = *_buffer;
   6961     unsigned int xcb_buffer_len = 0;
   6962     unsigned int xcb_align_to = 0;
   6963     unsigned int xcb_padding_offset = 0;
   6964 
   6965     int xcb_pre_tmp_1; /* sumof length */
   6966     int xcb_pre_tmp_2; /* sumof loop counter */
   6967     int64_t xcb_pre_tmp_3; /* sumof sum */
   6968     const uint8_t* xcb_pre_tmp_4; /* sumof list ptr */
   6969     unsigned int xcb_pad = 0;
   6970     char xcb_pad0[3] = {0, 0, 0};
   6971     struct iovec xcb_parts[26];
   6972     unsigned int xcb_parts_idx = 0;
   6973     unsigned int xcb_block_len = 0;
   6974     unsigned int i;
   6975     char *xcb_tmp;
   6976 
   6977     if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
   6978         /* xcb_xkb_set_names_values_t.keycodesName */
   6979         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->keycodesName;
   6980         xcb_block_len += sizeof(xcb_atom_t);
   6981         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   6982         xcb_parts_idx++;
   6983         xcb_align_to = ALIGNOF(xcb_atom_t);
   6984     }
   6985     if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
   6986         /* xcb_xkb_set_names_values_t.geometryName */
   6987         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometryName;
   6988         xcb_block_len += sizeof(xcb_atom_t);
   6989         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   6990         xcb_parts_idx++;
   6991         xcb_align_to = ALIGNOF(xcb_atom_t);
   6992     }
   6993     if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
   6994         /* xcb_xkb_set_names_values_t.symbolsName */
   6995         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->symbolsName;
   6996         xcb_block_len += sizeof(xcb_atom_t);
   6997         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   6998         xcb_parts_idx++;
   6999         xcb_align_to = ALIGNOF(xcb_atom_t);
   7000     }
   7001     if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
   7002         /* xcb_xkb_set_names_values_t.physSymbolsName */
   7003         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->physSymbolsName;
   7004         xcb_block_len += sizeof(xcb_atom_t);
   7005         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   7006         xcb_parts_idx++;
   7007         xcb_align_to = ALIGNOF(xcb_atom_t);
   7008     }
   7009     if(which & XCB_XKB_NAME_DETAIL_TYPES) {
   7010         /* xcb_xkb_set_names_values_t.typesName */
   7011         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->typesName;
   7012         xcb_block_len += sizeof(xcb_atom_t);
   7013         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   7014         xcb_parts_idx++;
   7015         xcb_align_to = ALIGNOF(xcb_atom_t);
   7016     }
   7017     if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
   7018         /* xcb_xkb_set_names_values_t.compatName */
   7019         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatName;
   7020         xcb_block_len += sizeof(xcb_atom_t);
   7021         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   7022         xcb_parts_idx++;
   7023         xcb_align_to = ALIGNOF(xcb_atom_t);
   7024     }
   7025     if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
   7026         /* insert padding */
   7027         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7028         xcb_buffer_len += xcb_block_len + xcb_pad;
   7029         if (0 != xcb_pad) {
   7030             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7031             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7032             xcb_parts_idx++;
   7033             xcb_pad = 0;
   7034         }
   7035         xcb_block_len = 0;
   7036         xcb_padding_offset = 0;
   7037         /* typeNames */
   7038         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->typeNames;
   7039         xcb_block_len += nTypes * sizeof(xcb_atom_t);
   7040         xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(xcb_atom_t);
   7041         xcb_parts_idx++;
   7042         xcb_align_to = ALIGNOF(xcb_atom_t);
   7043     }
   7044     if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
   7045         /* insert padding */
   7046         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7047         xcb_buffer_len += xcb_block_len + xcb_pad;
   7048         if (0 != xcb_pad) {
   7049             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7050             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7051             xcb_parts_idx++;
   7052             xcb_pad = 0;
   7053         }
   7054         xcb_block_len = 0;
   7055         xcb_padding_offset = 0;
   7056         /* nLevelsPerType */
   7057         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->nLevelsPerType;
   7058         xcb_block_len += nTypes * sizeof(uint8_t);
   7059         xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(uint8_t);
   7060         xcb_parts_idx++;
   7061         xcb_align_to = ALIGNOF(uint8_t);
   7062         xcb_align_to = 4;
   7063         /* insert padding */
   7064         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7065         xcb_buffer_len += xcb_block_len + xcb_pad;
   7066         if (0 != xcb_pad) {
   7067             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7068             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7069             xcb_parts_idx++;
   7070             xcb_pad = 0;
   7071         }
   7072         xcb_block_len = 0;
   7073         xcb_padding_offset = 0;
   7074         /* insert padding */
   7075         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7076         xcb_buffer_len += xcb_block_len + xcb_pad;
   7077         if (0 != xcb_pad) {
   7078             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7079             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7080             xcb_parts_idx++;
   7081             xcb_pad = 0;
   7082         }
   7083         xcb_block_len = 0;
   7084         xcb_padding_offset = 0;
   7085         /* ktLevelNames */
   7086         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->ktLevelNames;
   7087         /* sumof start */
   7088         xcb_pre_tmp_1 = nTypes;
   7089         xcb_pre_tmp_3 = 0;
   7090         xcb_pre_tmp_4 = _aux->nLevelsPerType;
   7091         for (xcb_pre_tmp_2 = 0; xcb_pre_tmp_2 < xcb_pre_tmp_1; xcb_pre_tmp_2++) {
   7092             xcb_pre_tmp_3 += *xcb_pre_tmp_4;
   7093             xcb_pre_tmp_4++;
   7094         }
   7095         /* sumof end. Result is in xcb_pre_tmp_3 */
   7096         xcb_block_len += xcb_pre_tmp_3 * sizeof(xcb_atom_t);
   7097         xcb_parts[xcb_parts_idx].iov_len = xcb_pre_tmp_3 * sizeof(xcb_atom_t);
   7098         xcb_parts_idx++;
   7099         xcb_align_to = ALIGNOF(xcb_atom_t);
   7100     }
   7101     if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
   7102         /* insert padding */
   7103         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7104         xcb_buffer_len += xcb_block_len + xcb_pad;
   7105         if (0 != xcb_pad) {
   7106             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7107             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7108             xcb_parts_idx++;
   7109             xcb_pad = 0;
   7110         }
   7111         xcb_block_len = 0;
   7112         xcb_padding_offset = 0;
   7113         /* indicatorNames */
   7114         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicatorNames;
   7115         xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
   7116         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(indicators) * sizeof(xcb_atom_t);
   7117         xcb_parts_idx++;
   7118         xcb_align_to = ALIGNOF(xcb_atom_t);
   7119     }
   7120     if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
   7121         /* insert padding */
   7122         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7123         xcb_buffer_len += xcb_block_len + xcb_pad;
   7124         if (0 != xcb_pad) {
   7125             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7126             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7127             xcb_parts_idx++;
   7128             xcb_pad = 0;
   7129         }
   7130         xcb_block_len = 0;
   7131         xcb_padding_offset = 0;
   7132         /* virtualModNames */
   7133         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->virtualModNames;
   7134         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
   7135         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
   7136         xcb_parts_idx++;
   7137         xcb_align_to = ALIGNOF(xcb_atom_t);
   7138     }
   7139     if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
   7140         /* insert padding */
   7141         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7142         xcb_buffer_len += xcb_block_len + xcb_pad;
   7143         if (0 != xcb_pad) {
   7144             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7145             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7146             xcb_parts_idx++;
   7147             xcb_pad = 0;
   7148         }
   7149         xcb_block_len = 0;
   7150         xcb_padding_offset = 0;
   7151         /* groups */
   7152         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->groups;
   7153         xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
   7154         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(groupNames) * sizeof(xcb_atom_t);
   7155         xcb_parts_idx++;
   7156         xcb_align_to = ALIGNOF(xcb_atom_t);
   7157     }
   7158     if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
   7159         /* insert padding */
   7160         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7161         xcb_buffer_len += xcb_block_len + xcb_pad;
   7162         if (0 != xcb_pad) {
   7163             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7164             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7165             xcb_parts_idx++;
   7166             xcb_pad = 0;
   7167         }
   7168         xcb_block_len = 0;
   7169         xcb_padding_offset = 0;
   7170         /* keyNames */
   7171         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyNames;
   7172         xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
   7173         xcb_parts[xcb_parts_idx].iov_len = nKeys * sizeof(xcb_xkb_key_name_t);
   7174         xcb_parts_idx++;
   7175         xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
   7176     }
   7177     if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
   7178         /* insert padding */
   7179         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7180         xcb_buffer_len += xcb_block_len + xcb_pad;
   7181         if (0 != xcb_pad) {
   7182             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7183             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7184             xcb_parts_idx++;
   7185             xcb_pad = 0;
   7186         }
   7187         xcb_block_len = 0;
   7188         xcb_padding_offset = 0;
   7189         /* keyAliases */
   7190         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyAliases;
   7191         xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
   7192         xcb_parts[xcb_parts_idx].iov_len = nKeyAliases * sizeof(xcb_xkb_key_alias_t);
   7193         xcb_parts_idx++;
   7194         xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
   7195     }
   7196     if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
   7197         /* insert padding */
   7198         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7199         xcb_buffer_len += xcb_block_len + xcb_pad;
   7200         if (0 != xcb_pad) {
   7201             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7202             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7203             xcb_parts_idx++;
   7204             xcb_pad = 0;
   7205         }
   7206         xcb_block_len = 0;
   7207         xcb_padding_offset = 0;
   7208         /* radioGroupNames */
   7209         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->radioGroupNames;
   7210         xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
   7211         xcb_parts[xcb_parts_idx].iov_len = nRadioGroups * sizeof(xcb_atom_t);
   7212         xcb_parts_idx++;
   7213         xcb_align_to = ALIGNOF(xcb_atom_t);
   7214     }
   7215     /* insert padding */
   7216     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7217     xcb_buffer_len += xcb_block_len + xcb_pad;
   7218     if (0 != xcb_pad) {
   7219         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   7220         xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   7221         xcb_parts_idx++;
   7222         xcb_pad = 0;
   7223     }
   7224     xcb_block_len = 0;
   7225     xcb_padding_offset = 0;
   7226 
   7227     if (NULL == xcb_out) {
   7228         /* allocate memory */
   7229         xcb_out = malloc(xcb_buffer_len);
   7230         *_buffer = xcb_out;
   7231     }
   7232 
   7233     xcb_tmp = xcb_out;
   7234     for(i=0; i<xcb_parts_idx; i++) {
   7235         if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
   7236             memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
   7237         if (0 != xcb_parts[i].iov_len)
   7238             xcb_tmp += xcb_parts[i].iov_len;
   7239     }
   7240 
   7241     return xcb_buffer_len;
   7242 }
   7243 
   7244 int
   7245 xcb_xkb_set_names_values_unpack (const void                  *_buffer,
   7246                                  uint8_t                      nTypes,
   7247                                  uint32_t                     indicators,
   7248                                  uint16_t                     virtualMods,
   7249                                  uint8_t                      groupNames,
   7250                                  uint8_t                      nKeys,
   7251                                  uint8_t                      nKeyAliases,
   7252                                  uint8_t                      nRadioGroups,
   7253                                  uint32_t                     which,
   7254                                  xcb_xkb_set_names_values_t  *_aux)
   7255 {
   7256     char *xcb_tmp = (char *)_buffer;
   7257     unsigned int xcb_buffer_len = 0;
   7258     unsigned int xcb_block_len = 0;
   7259     unsigned int xcb_pad = 0;
   7260     unsigned int xcb_align_to = 0;
   7261     unsigned int xcb_padding_offset = 0;
   7262 
   7263     int xcb_pre_tmp_1; /* sumof length */
   7264     int xcb_pre_tmp_2; /* sumof loop counter */
   7265     int64_t xcb_pre_tmp_3; /* sumof sum */
   7266     const uint8_t* xcb_pre_tmp_4; /* sumof list ptr */
   7267 
   7268     if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
   7269         /* xcb_xkb_set_names_values_t.keycodesName */
   7270         _aux->keycodesName = *(xcb_atom_t *)xcb_tmp;
   7271         xcb_block_len += sizeof(xcb_atom_t);
   7272         xcb_tmp += sizeof(xcb_atom_t);
   7273         xcb_align_to = ALIGNOF(xcb_atom_t);
   7274     }
   7275     if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
   7276         /* xcb_xkb_set_names_values_t.geometryName */
   7277         _aux->geometryName = *(xcb_atom_t *)xcb_tmp;
   7278         xcb_block_len += sizeof(xcb_atom_t);
   7279         xcb_tmp += sizeof(xcb_atom_t);
   7280         xcb_align_to = ALIGNOF(xcb_atom_t);
   7281     }
   7282     if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
   7283         /* xcb_xkb_set_names_values_t.symbolsName */
   7284         _aux->symbolsName = *(xcb_atom_t *)xcb_tmp;
   7285         xcb_block_len += sizeof(xcb_atom_t);
   7286         xcb_tmp += sizeof(xcb_atom_t);
   7287         xcb_align_to = ALIGNOF(xcb_atom_t);
   7288     }
   7289     if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
   7290         /* xcb_xkb_set_names_values_t.physSymbolsName */
   7291         _aux->physSymbolsName = *(xcb_atom_t *)xcb_tmp;
   7292         xcb_block_len += sizeof(xcb_atom_t);
   7293         xcb_tmp += sizeof(xcb_atom_t);
   7294         xcb_align_to = ALIGNOF(xcb_atom_t);
   7295     }
   7296     if(which & XCB_XKB_NAME_DETAIL_TYPES) {
   7297         /* xcb_xkb_set_names_values_t.typesName */
   7298         _aux->typesName = *(xcb_atom_t *)xcb_tmp;
   7299         xcb_block_len += sizeof(xcb_atom_t);
   7300         xcb_tmp += sizeof(xcb_atom_t);
   7301         xcb_align_to = ALIGNOF(xcb_atom_t);
   7302     }
   7303     if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
   7304         /* xcb_xkb_set_names_values_t.compatName */
   7305         _aux->compatName = *(xcb_atom_t *)xcb_tmp;
   7306         xcb_block_len += sizeof(xcb_atom_t);
   7307         xcb_tmp += sizeof(xcb_atom_t);
   7308         xcb_align_to = ALIGNOF(xcb_atom_t);
   7309     }
   7310     if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
   7311         /* insert padding */
   7312         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7313         xcb_buffer_len += xcb_block_len + xcb_pad;
   7314         if (0 != xcb_pad) {
   7315             xcb_tmp += xcb_pad;
   7316             xcb_pad = 0;
   7317         }
   7318         xcb_block_len = 0;
   7319         xcb_padding_offset = 0;
   7320         /* typeNames */
   7321         _aux->typeNames = (xcb_atom_t *)xcb_tmp;
   7322         xcb_block_len += nTypes * sizeof(xcb_atom_t);
   7323         xcb_tmp += xcb_block_len;
   7324         xcb_align_to = ALIGNOF(xcb_atom_t);
   7325     }
   7326     if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
   7327         /* insert padding */
   7328         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7329         xcb_buffer_len += xcb_block_len + xcb_pad;
   7330         if (0 != xcb_pad) {
   7331             xcb_tmp += xcb_pad;
   7332             xcb_pad = 0;
   7333         }
   7334         xcb_block_len = 0;
   7335         xcb_padding_offset = 0;
   7336         /* nLevelsPerType */
   7337         _aux->nLevelsPerType = (uint8_t *)xcb_tmp;
   7338         xcb_block_len += nTypes * sizeof(uint8_t);
   7339         xcb_tmp += xcb_block_len;
   7340         xcb_align_to = ALIGNOF(uint8_t);
   7341         xcb_align_to = 4;
   7342         /* insert padding */
   7343         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7344         xcb_buffer_len += xcb_block_len + xcb_pad;
   7345         if (0 != xcb_pad) {
   7346             xcb_tmp += xcb_pad;
   7347             xcb_pad = 0;
   7348         }
   7349         xcb_block_len = 0;
   7350         xcb_padding_offset = 0;
   7351         /* insert padding */
   7352         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7353         xcb_buffer_len += xcb_block_len + xcb_pad;
   7354         if (0 != xcb_pad) {
   7355             xcb_tmp += xcb_pad;
   7356             xcb_pad = 0;
   7357         }
   7358         xcb_block_len = 0;
   7359         xcb_padding_offset = 0;
   7360         /* ktLevelNames */
   7361         _aux->ktLevelNames = (xcb_atom_t *)xcb_tmp;
   7362         /* sumof start */
   7363         xcb_pre_tmp_1 = nTypes;
   7364         xcb_pre_tmp_3 = 0;
   7365         xcb_pre_tmp_4 = _aux->nLevelsPerType;
   7366         for (xcb_pre_tmp_2 = 0; xcb_pre_tmp_2 < xcb_pre_tmp_1; xcb_pre_tmp_2++) {
   7367             xcb_pre_tmp_3 += *xcb_pre_tmp_4;
   7368             xcb_pre_tmp_4++;
   7369         }
   7370         /* sumof end. Result is in xcb_pre_tmp_3 */
   7371         xcb_block_len += xcb_pre_tmp_3 * sizeof(xcb_atom_t);
   7372         xcb_tmp += xcb_block_len;
   7373         xcb_align_to = ALIGNOF(xcb_atom_t);
   7374     }
   7375     if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
   7376         /* insert padding */
   7377         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7378         xcb_buffer_len += xcb_block_len + xcb_pad;
   7379         if (0 != xcb_pad) {
   7380             xcb_tmp += xcb_pad;
   7381             xcb_pad = 0;
   7382         }
   7383         xcb_block_len = 0;
   7384         xcb_padding_offset = 0;
   7385         /* indicatorNames */
   7386         _aux->indicatorNames = (xcb_atom_t *)xcb_tmp;
   7387         xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
   7388         xcb_tmp += xcb_block_len;
   7389         xcb_align_to = ALIGNOF(xcb_atom_t);
   7390     }
   7391     if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
   7392         /* insert padding */
   7393         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7394         xcb_buffer_len += xcb_block_len + xcb_pad;
   7395         if (0 != xcb_pad) {
   7396             xcb_tmp += xcb_pad;
   7397             xcb_pad = 0;
   7398         }
   7399         xcb_block_len = 0;
   7400         xcb_padding_offset = 0;
   7401         /* virtualModNames */
   7402         _aux->virtualModNames = (xcb_atom_t *)xcb_tmp;
   7403         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
   7404         xcb_tmp += xcb_block_len;
   7405         xcb_align_to = ALIGNOF(xcb_atom_t);
   7406     }
   7407     if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
   7408         /* insert padding */
   7409         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7410         xcb_buffer_len += xcb_block_len + xcb_pad;
   7411         if (0 != xcb_pad) {
   7412             xcb_tmp += xcb_pad;
   7413             xcb_pad = 0;
   7414         }
   7415         xcb_block_len = 0;
   7416         xcb_padding_offset = 0;
   7417         /* groups */
   7418         _aux->groups = (xcb_atom_t *)xcb_tmp;
   7419         xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
   7420         xcb_tmp += xcb_block_len;
   7421         xcb_align_to = ALIGNOF(xcb_atom_t);
   7422     }
   7423     if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
   7424         /* insert padding */
   7425         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7426         xcb_buffer_len += xcb_block_len + xcb_pad;
   7427         if (0 != xcb_pad) {
   7428             xcb_tmp += xcb_pad;
   7429             xcb_pad = 0;
   7430         }
   7431         xcb_block_len = 0;
   7432         xcb_padding_offset = 0;
   7433         /* keyNames */
   7434         _aux->keyNames = (xcb_xkb_key_name_t *)xcb_tmp;
   7435         xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
   7436         xcb_tmp += xcb_block_len;
   7437         xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
   7438     }
   7439     if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
   7440         /* insert padding */
   7441         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7442         xcb_buffer_len += xcb_block_len + xcb_pad;
   7443         if (0 != xcb_pad) {
   7444             xcb_tmp += xcb_pad;
   7445             xcb_pad = 0;
   7446         }
   7447         xcb_block_len = 0;
   7448         xcb_padding_offset = 0;
   7449         /* keyAliases */
   7450         _aux->keyAliases = (xcb_xkb_key_alias_t *)xcb_tmp;
   7451         xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
   7452         xcb_tmp += xcb_block_len;
   7453         xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
   7454     }
   7455     if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
   7456         /* insert padding */
   7457         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7458         xcb_buffer_len += xcb_block_len + xcb_pad;
   7459         if (0 != xcb_pad) {
   7460             xcb_tmp += xcb_pad;
   7461             xcb_pad = 0;
   7462         }
   7463         xcb_block_len = 0;
   7464         xcb_padding_offset = 0;
   7465         /* radioGroupNames */
   7466         _aux->radioGroupNames = (xcb_atom_t *)xcb_tmp;
   7467         xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
   7468         xcb_tmp += xcb_block_len;
   7469         xcb_align_to = ALIGNOF(xcb_atom_t);
   7470     }
   7471     /* insert padding */
   7472     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   7473     xcb_buffer_len += xcb_block_len + xcb_pad;
   7474     if (0 != xcb_pad) {
   7475         xcb_tmp += xcb_pad;
   7476         xcb_pad = 0;
   7477     }
   7478     xcb_block_len = 0;
   7479     xcb_padding_offset = 0;
   7480 
   7481     return xcb_buffer_len;
   7482 }
   7483 
   7484 int
   7485 xcb_xkb_set_names_values_sizeof (const void  *_buffer,
   7486                                  uint8_t      nTypes,
   7487                                  uint32_t     indicators,
   7488                                  uint16_t     virtualMods,
   7489                                  uint8_t      groupNames,
   7490                                  uint8_t      nKeys,
   7491                                  uint8_t      nKeyAliases,
   7492                                  uint8_t      nRadioGroups,
   7493                                  uint32_t     which)
   7494 {
   7495     xcb_xkb_set_names_values_t _aux;
   7496     return xcb_xkb_set_names_values_unpack(_buffer, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, &_aux);
   7497 }
   7498 
   7499 int
   7500 xcb_xkb_set_names_sizeof (const void  *_buffer)
   7501 {
   7502     char *xcb_tmp = (char *)_buffer;
   7503     const xcb_xkb_set_names_request_t *_aux = (xcb_xkb_set_names_request_t *)_buffer;
   7504     unsigned int xcb_buffer_len = 0;
   7505     unsigned int xcb_block_len = 0;
   7506     unsigned int xcb_pad = 0;
   7507     unsigned int xcb_align_to = 0;
   7508 
   7509 
   7510     xcb_block_len += sizeof(xcb_xkb_set_names_request_t);
   7511     xcb_tmp += xcb_block_len;
   7512     xcb_buffer_len += xcb_block_len;
   7513     xcb_block_len = 0;
   7514     /* values */
   7515     xcb_block_len += xcb_xkb_set_names_values_sizeof(xcb_tmp, _aux->nTypes, _aux->indicators, _aux->virtualMods, _aux->groupNames, _aux->nKeys, _aux->nKeyAliases, _aux->nRadioGroups, _aux->which);
   7516     xcb_tmp += xcb_block_len;
   7517     xcb_align_to = ALIGNOF(char);
   7518     /* insert padding */
   7519     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   7520     xcb_buffer_len += xcb_block_len + xcb_pad;
   7521     if (0 != xcb_pad) {
   7522         xcb_tmp += xcb_pad;
   7523         xcb_pad = 0;
   7524     }
   7525     xcb_block_len = 0;
   7526 
   7527     return xcb_buffer_len;
   7528 }
   7529 
   7530 xcb_void_cookie_t
   7531 xcb_xkb_set_names_checked (xcb_connection_t      *c,
   7532                            xcb_xkb_device_spec_t  deviceSpec,
   7533                            uint16_t               virtualMods,
   7534                            uint32_t               which,
   7535                            uint8_t                firstType,
   7536                            uint8_t                nTypes,
   7537                            uint8_t                firstKTLevelt,
   7538                            uint8_t                nKTLevels,
   7539                            uint32_t               indicators,
   7540                            uint8_t                groupNames,
   7541                            uint8_t                nRadioGroups,
   7542                            xcb_keycode_t          firstKey,
   7543                            uint8_t                nKeys,
   7544                            uint8_t                nKeyAliases,
   7545                            uint16_t               totalKTLevelNames,
   7546                            const void            *values)
   7547 {
   7548     static const xcb_protocol_request_t xcb_req = {
   7549         .count = 3,
   7550         .ext = &xcb_xkb_id,
   7551         .opcode = XCB_XKB_SET_NAMES,
   7552         .isvoid = 1
   7553     };
   7554 
   7555     struct iovec xcb_parts[5];
   7556     xcb_void_cookie_t xcb_ret;
   7557     xcb_xkb_set_names_request_t xcb_out;
   7558 
   7559     xcb_out.deviceSpec = deviceSpec;
   7560     xcb_out.virtualMods = virtualMods;
   7561     xcb_out.which = which;
   7562     xcb_out.firstType = firstType;
   7563     xcb_out.nTypes = nTypes;
   7564     xcb_out.firstKTLevelt = firstKTLevelt;
   7565     xcb_out.nKTLevels = nKTLevels;
   7566     xcb_out.indicators = indicators;
   7567     xcb_out.groupNames = groupNames;
   7568     xcb_out.nRadioGroups = nRadioGroups;
   7569     xcb_out.firstKey = firstKey;
   7570     xcb_out.nKeys = nKeys;
   7571     xcb_out.nKeyAliases = nKeyAliases;
   7572     xcb_out.pad0 = 0;
   7573     xcb_out.totalKTLevelNames = totalKTLevelNames;
   7574 
   7575     xcb_parts[2].iov_base = (char *) &xcb_out;
   7576     xcb_parts[2].iov_len = sizeof(xcb_out);
   7577     xcb_parts[3].iov_base = 0;
   7578     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   7579     /* xcb_xkb_set_names_values_t values */
   7580     xcb_parts[4].iov_base = (char *) values;
   7581     xcb_parts[4].iov_len =
   7582       xcb_xkb_set_names_values_sizeof (values, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which);
   7583 
   7584     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   7585     return xcb_ret;
   7586 }
   7587 
   7588 xcb_void_cookie_t
   7589 xcb_xkb_set_names (xcb_connection_t      *c,
   7590                    xcb_xkb_device_spec_t  deviceSpec,
   7591                    uint16_t               virtualMods,
   7592                    uint32_t               which,
   7593                    uint8_t                firstType,
   7594                    uint8_t                nTypes,
   7595                    uint8_t                firstKTLevelt,
   7596                    uint8_t                nKTLevels,
   7597                    uint32_t               indicators,
   7598                    uint8_t                groupNames,
   7599                    uint8_t                nRadioGroups,
   7600                    xcb_keycode_t          firstKey,
   7601                    uint8_t                nKeys,
   7602                    uint8_t                nKeyAliases,
   7603                    uint16_t               totalKTLevelNames,
   7604                    const void            *values)
   7605 {
   7606     static const xcb_protocol_request_t xcb_req = {
   7607         .count = 3,
   7608         .ext = &xcb_xkb_id,
   7609         .opcode = XCB_XKB_SET_NAMES,
   7610         .isvoid = 1
   7611     };
   7612 
   7613     struct iovec xcb_parts[5];
   7614     xcb_void_cookie_t xcb_ret;
   7615     xcb_xkb_set_names_request_t xcb_out;
   7616 
   7617     xcb_out.deviceSpec = deviceSpec;
   7618     xcb_out.virtualMods = virtualMods;
   7619     xcb_out.which = which;
   7620     xcb_out.firstType = firstType;
   7621     xcb_out.nTypes = nTypes;
   7622     xcb_out.firstKTLevelt = firstKTLevelt;
   7623     xcb_out.nKTLevels = nKTLevels;
   7624     xcb_out.indicators = indicators;
   7625     xcb_out.groupNames = groupNames;
   7626     xcb_out.nRadioGroups = nRadioGroups;
   7627     xcb_out.firstKey = firstKey;
   7628     xcb_out.nKeys = nKeys;
   7629     xcb_out.nKeyAliases = nKeyAliases;
   7630     xcb_out.pad0 = 0;
   7631     xcb_out.totalKTLevelNames = totalKTLevelNames;
   7632 
   7633     xcb_parts[2].iov_base = (char *) &xcb_out;
   7634     xcb_parts[2].iov_len = sizeof(xcb_out);
   7635     xcb_parts[3].iov_base = 0;
   7636     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   7637     /* xcb_xkb_set_names_values_t values */
   7638     xcb_parts[4].iov_base = (char *) values;
   7639     xcb_parts[4].iov_len =
   7640       xcb_xkb_set_names_values_sizeof (values, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which);
   7641 
   7642     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   7643     return xcb_ret;
   7644 }
   7645 
   7646 xcb_void_cookie_t
   7647 xcb_xkb_set_names_aux_checked (xcb_connection_t                 *c,
   7648                                xcb_xkb_device_spec_t             deviceSpec,
   7649                                uint16_t                          virtualMods,
   7650                                uint32_t                          which,
   7651                                uint8_t                           firstType,
   7652                                uint8_t                           nTypes,
   7653                                uint8_t                           firstKTLevelt,
   7654                                uint8_t                           nKTLevels,
   7655                                uint32_t                          indicators,
   7656                                uint8_t                           groupNames,
   7657                                uint8_t                           nRadioGroups,
   7658                                xcb_keycode_t                     firstKey,
   7659                                uint8_t                           nKeys,
   7660                                uint8_t                           nKeyAliases,
   7661                                uint16_t                          totalKTLevelNames,
   7662                                const xcb_xkb_set_names_values_t *values)
   7663 {
   7664     static const xcb_protocol_request_t xcb_req = {
   7665         .count = 3,
   7666         .ext = &xcb_xkb_id,
   7667         .opcode = XCB_XKB_SET_NAMES,
   7668         .isvoid = 1
   7669     };
   7670 
   7671     struct iovec xcb_parts[5];
   7672     xcb_void_cookie_t xcb_ret;
   7673     xcb_xkb_set_names_request_t xcb_out;
   7674     void *xcb_aux0 = 0;
   7675 
   7676     xcb_out.deviceSpec = deviceSpec;
   7677     xcb_out.virtualMods = virtualMods;
   7678     xcb_out.which = which;
   7679     xcb_out.firstType = firstType;
   7680     xcb_out.nTypes = nTypes;
   7681     xcb_out.firstKTLevelt = firstKTLevelt;
   7682     xcb_out.nKTLevels = nKTLevels;
   7683     xcb_out.indicators = indicators;
   7684     xcb_out.groupNames = groupNames;
   7685     xcb_out.nRadioGroups = nRadioGroups;
   7686     xcb_out.firstKey = firstKey;
   7687     xcb_out.nKeys = nKeys;
   7688     xcb_out.nKeyAliases = nKeyAliases;
   7689     xcb_out.pad0 = 0;
   7690     xcb_out.totalKTLevelNames = totalKTLevelNames;
   7691 
   7692     xcb_parts[2].iov_base = (char *) &xcb_out;
   7693     xcb_parts[2].iov_len = sizeof(xcb_out);
   7694     xcb_parts[3].iov_base = 0;
   7695     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   7696     /* xcb_xkb_set_names_values_t values */
   7697     xcb_parts[4].iov_len =
   7698       xcb_xkb_set_names_values_serialize (&xcb_aux0, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, values);
   7699     xcb_parts[4].iov_base = xcb_aux0;
   7700 
   7701     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   7702     free(xcb_aux0);
   7703     return xcb_ret;
   7704 }
   7705 
   7706 xcb_void_cookie_t
   7707 xcb_xkb_set_names_aux (xcb_connection_t                 *c,
   7708                        xcb_xkb_device_spec_t             deviceSpec,
   7709                        uint16_t                          virtualMods,
   7710                        uint32_t                          which,
   7711                        uint8_t                           firstType,
   7712                        uint8_t                           nTypes,
   7713                        uint8_t                           firstKTLevelt,
   7714                        uint8_t                           nKTLevels,
   7715                        uint32_t                          indicators,
   7716                        uint8_t                           groupNames,
   7717                        uint8_t                           nRadioGroups,
   7718                        xcb_keycode_t                     firstKey,
   7719                        uint8_t                           nKeys,
   7720                        uint8_t                           nKeyAliases,
   7721                        uint16_t                          totalKTLevelNames,
   7722                        const xcb_xkb_set_names_values_t *values)
   7723 {
   7724     static const xcb_protocol_request_t xcb_req = {
   7725         .count = 3,
   7726         .ext = &xcb_xkb_id,
   7727         .opcode = XCB_XKB_SET_NAMES,
   7728         .isvoid = 1
   7729     };
   7730 
   7731     struct iovec xcb_parts[5];
   7732     xcb_void_cookie_t xcb_ret;
   7733     xcb_xkb_set_names_request_t xcb_out;
   7734     void *xcb_aux0 = 0;
   7735 
   7736     xcb_out.deviceSpec = deviceSpec;
   7737     xcb_out.virtualMods = virtualMods;
   7738     xcb_out.which = which;
   7739     xcb_out.firstType = firstType;
   7740     xcb_out.nTypes = nTypes;
   7741     xcb_out.firstKTLevelt = firstKTLevelt;
   7742     xcb_out.nKTLevels = nKTLevels;
   7743     xcb_out.indicators = indicators;
   7744     xcb_out.groupNames = groupNames;
   7745     xcb_out.nRadioGroups = nRadioGroups;
   7746     xcb_out.firstKey = firstKey;
   7747     xcb_out.nKeys = nKeys;
   7748     xcb_out.nKeyAliases = nKeyAliases;
   7749     xcb_out.pad0 = 0;
   7750     xcb_out.totalKTLevelNames = totalKTLevelNames;
   7751 
   7752     xcb_parts[2].iov_base = (char *) &xcb_out;
   7753     xcb_parts[2].iov_len = sizeof(xcb_out);
   7754     xcb_parts[3].iov_base = 0;
   7755     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   7756     /* xcb_xkb_set_names_values_t values */
   7757     xcb_parts[4].iov_len =
   7758       xcb_xkb_set_names_values_serialize (&xcb_aux0, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, values);
   7759     xcb_parts[4].iov_base = xcb_aux0;
   7760 
   7761     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   7762     free(xcb_aux0);
   7763     return xcb_ret;
   7764 }
   7765 
   7766 void *
   7767 xcb_xkb_set_names_values (const xcb_xkb_set_names_request_t *R)
   7768 {
   7769     return (void *) (R + 1);
   7770 }
   7771 
   7772 xcb_xkb_per_client_flags_cookie_t
   7773 xcb_xkb_per_client_flags (xcb_connection_t      *c,
   7774                           xcb_xkb_device_spec_t  deviceSpec,
   7775                           uint32_t               change,
   7776                           uint32_t               value,
   7777                           uint32_t               ctrlsToChange,
   7778                           uint32_t               autoCtrls,
   7779                           uint32_t               autoCtrlsValues)
   7780 {
   7781     static const xcb_protocol_request_t xcb_req = {
   7782         .count = 2,
   7783         .ext = &xcb_xkb_id,
   7784         .opcode = XCB_XKB_PER_CLIENT_FLAGS,
   7785         .isvoid = 0
   7786     };
   7787 
   7788     struct iovec xcb_parts[4];
   7789     xcb_xkb_per_client_flags_cookie_t xcb_ret;
   7790     xcb_xkb_per_client_flags_request_t xcb_out;
   7791 
   7792     xcb_out.deviceSpec = deviceSpec;
   7793     memset(xcb_out.pad0, 0, 2);
   7794     xcb_out.change = change;
   7795     xcb_out.value = value;
   7796     xcb_out.ctrlsToChange = ctrlsToChange;
   7797     xcb_out.autoCtrls = autoCtrls;
   7798     xcb_out.autoCtrlsValues = autoCtrlsValues;
   7799 
   7800     xcb_parts[2].iov_base = (char *) &xcb_out;
   7801     xcb_parts[2].iov_len = sizeof(xcb_out);
   7802     xcb_parts[3].iov_base = 0;
   7803     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   7804 
   7805     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   7806     return xcb_ret;
   7807 }
   7808 
   7809 xcb_xkb_per_client_flags_cookie_t
   7810 xcb_xkb_per_client_flags_unchecked (xcb_connection_t      *c,
   7811                                     xcb_xkb_device_spec_t  deviceSpec,
   7812                                     uint32_t               change,
   7813                                     uint32_t               value,
   7814                                     uint32_t               ctrlsToChange,
   7815                                     uint32_t               autoCtrls,
   7816                                     uint32_t               autoCtrlsValues)
   7817 {
   7818     static const xcb_protocol_request_t xcb_req = {
   7819         .count = 2,
   7820         .ext = &xcb_xkb_id,
   7821         .opcode = XCB_XKB_PER_CLIENT_FLAGS,
   7822         .isvoid = 0
   7823     };
   7824 
   7825     struct iovec xcb_parts[4];
   7826     xcb_xkb_per_client_flags_cookie_t xcb_ret;
   7827     xcb_xkb_per_client_flags_request_t xcb_out;
   7828 
   7829     xcb_out.deviceSpec = deviceSpec;
   7830     memset(xcb_out.pad0, 0, 2);
   7831     xcb_out.change = change;
   7832     xcb_out.value = value;
   7833     xcb_out.ctrlsToChange = ctrlsToChange;
   7834     xcb_out.autoCtrls = autoCtrls;
   7835     xcb_out.autoCtrlsValues = autoCtrlsValues;
   7836 
   7837     xcb_parts[2].iov_base = (char *) &xcb_out;
   7838     xcb_parts[2].iov_len = sizeof(xcb_out);
   7839     xcb_parts[3].iov_base = 0;
   7840     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   7841 
   7842     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   7843     return xcb_ret;
   7844 }
   7845 
   7846 xcb_xkb_per_client_flags_reply_t *
   7847 xcb_xkb_per_client_flags_reply (xcb_connection_t                   *c,
   7848                                 xcb_xkb_per_client_flags_cookie_t   cookie  /**< */,
   7849                                 xcb_generic_error_t               **e)
   7850 {
   7851     return (xcb_xkb_per_client_flags_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   7852 }
   7853 
   7854 int
   7855 xcb_xkb_list_components_sizeof (const void  *_buffer)
   7856 {
   7857     char *xcb_tmp = (char *)_buffer;
   7858     const xcb_xkb_list_components_reply_t *_aux = (xcb_xkb_list_components_reply_t *)_buffer;
   7859     unsigned int xcb_buffer_len = 0;
   7860     unsigned int xcb_block_len = 0;
   7861     unsigned int xcb_pad = 0;
   7862     unsigned int xcb_align_to = 0;
   7863 
   7864     unsigned int i;
   7865     unsigned int xcb_tmp_len;
   7866 
   7867     xcb_block_len += sizeof(xcb_xkb_list_components_reply_t);
   7868     xcb_tmp += xcb_block_len;
   7869     xcb_buffer_len += xcb_block_len;
   7870     xcb_block_len = 0;
   7871     /* keymaps */
   7872     for(i=0; i<_aux->nKeymaps; i++) {
   7873         xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
   7874         xcb_block_len += xcb_tmp_len;
   7875         xcb_tmp += xcb_tmp_len;
   7876     }
   7877     xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
   7878     /* insert padding */
   7879     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   7880     xcb_buffer_len += xcb_block_len + xcb_pad;
   7881     if (0 != xcb_pad) {
   7882         xcb_tmp += xcb_pad;
   7883         xcb_pad = 0;
   7884     }
   7885     xcb_block_len = 0;
   7886     /* keycodes */
   7887     for(i=0; i<_aux->nKeycodes; i++) {
   7888         xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
   7889         xcb_block_len += xcb_tmp_len;
   7890         xcb_tmp += xcb_tmp_len;
   7891     }
   7892     xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
   7893     /* insert padding */
   7894     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   7895     xcb_buffer_len += xcb_block_len + xcb_pad;
   7896     if (0 != xcb_pad) {
   7897         xcb_tmp += xcb_pad;
   7898         xcb_pad = 0;
   7899     }
   7900     xcb_block_len = 0;
   7901     /* types */
   7902     for(i=0; i<_aux->nTypes; i++) {
   7903         xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
   7904         xcb_block_len += xcb_tmp_len;
   7905         xcb_tmp += xcb_tmp_len;
   7906     }
   7907     xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
   7908     /* insert padding */
   7909     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   7910     xcb_buffer_len += xcb_block_len + xcb_pad;
   7911     if (0 != xcb_pad) {
   7912         xcb_tmp += xcb_pad;
   7913         xcb_pad = 0;
   7914     }
   7915     xcb_block_len = 0;
   7916     /* compatMaps */
   7917     for(i=0; i<_aux->nCompatMaps; i++) {
   7918         xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
   7919         xcb_block_len += xcb_tmp_len;
   7920         xcb_tmp += xcb_tmp_len;
   7921     }
   7922     xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
   7923     /* insert padding */
   7924     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   7925     xcb_buffer_len += xcb_block_len + xcb_pad;
   7926     if (0 != xcb_pad) {
   7927         xcb_tmp += xcb_pad;
   7928         xcb_pad = 0;
   7929     }
   7930     xcb_block_len = 0;
   7931     /* symbols */
   7932     for(i=0; i<_aux->nSymbols; i++) {
   7933         xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
   7934         xcb_block_len += xcb_tmp_len;
   7935         xcb_tmp += xcb_tmp_len;
   7936     }
   7937     xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
   7938     /* insert padding */
   7939     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   7940     xcb_buffer_len += xcb_block_len + xcb_pad;
   7941     if (0 != xcb_pad) {
   7942         xcb_tmp += xcb_pad;
   7943         xcb_pad = 0;
   7944     }
   7945     xcb_block_len = 0;
   7946     /* geometries */
   7947     for(i=0; i<_aux->nGeometries; i++) {
   7948         xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
   7949         xcb_block_len += xcb_tmp_len;
   7950         xcb_tmp += xcb_tmp_len;
   7951     }
   7952     xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
   7953     /* insert padding */
   7954     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   7955     xcb_buffer_len += xcb_block_len + xcb_pad;
   7956     if (0 != xcb_pad) {
   7957         xcb_tmp += xcb_pad;
   7958         xcb_pad = 0;
   7959     }
   7960     xcb_block_len = 0;
   7961 
   7962     return xcb_buffer_len;
   7963 }
   7964 
   7965 xcb_xkb_list_components_cookie_t
   7966 xcb_xkb_list_components (xcb_connection_t      *c,
   7967                          xcb_xkb_device_spec_t  deviceSpec,
   7968                          uint16_t               maxNames)
   7969 {
   7970     static const xcb_protocol_request_t xcb_req = {
   7971         .count = 2,
   7972         .ext = &xcb_xkb_id,
   7973         .opcode = XCB_XKB_LIST_COMPONENTS,
   7974         .isvoid = 0
   7975     };
   7976 
   7977     struct iovec xcb_parts[4];
   7978     xcb_xkb_list_components_cookie_t xcb_ret;
   7979     xcb_xkb_list_components_request_t xcb_out;
   7980 
   7981     xcb_out.deviceSpec = deviceSpec;
   7982     xcb_out.maxNames = maxNames;
   7983 
   7984     xcb_parts[2].iov_base = (char *) &xcb_out;
   7985     xcb_parts[2].iov_len = sizeof(xcb_out);
   7986     xcb_parts[3].iov_base = 0;
   7987     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   7988 
   7989     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   7990     return xcb_ret;
   7991 }
   7992 
   7993 xcb_xkb_list_components_cookie_t
   7994 xcb_xkb_list_components_unchecked (xcb_connection_t      *c,
   7995                                    xcb_xkb_device_spec_t  deviceSpec,
   7996                                    uint16_t               maxNames)
   7997 {
   7998     static const xcb_protocol_request_t xcb_req = {
   7999         .count = 2,
   8000         .ext = &xcb_xkb_id,
   8001         .opcode = XCB_XKB_LIST_COMPONENTS,
   8002         .isvoid = 0
   8003     };
   8004 
   8005     struct iovec xcb_parts[4];
   8006     xcb_xkb_list_components_cookie_t xcb_ret;
   8007     xcb_xkb_list_components_request_t xcb_out;
   8008 
   8009     xcb_out.deviceSpec = deviceSpec;
   8010     xcb_out.maxNames = maxNames;
   8011 
   8012     xcb_parts[2].iov_base = (char *) &xcb_out;
   8013     xcb_parts[2].iov_len = sizeof(xcb_out);
   8014     xcb_parts[3].iov_base = 0;
   8015     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   8016 
   8017     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   8018     return xcb_ret;
   8019 }
   8020 
   8021 int
   8022 xcb_xkb_list_components_keymaps_length (const xcb_xkb_list_components_reply_t *R)
   8023 {
   8024     return R->nKeymaps;
   8025 }
   8026 
   8027 xcb_xkb_listing_iterator_t
   8028 xcb_xkb_list_components_keymaps_iterator (const xcb_xkb_list_components_reply_t *R)
   8029 {
   8030     xcb_xkb_listing_iterator_t i;
   8031     i.data = (xcb_xkb_listing_t *) (R + 1);
   8032     i.rem = R->nKeymaps;
   8033     i.index = (char *) i.data - (char *) R;
   8034     return i;
   8035 }
   8036 
   8037 int
   8038 xcb_xkb_list_components_keycodes_length (const xcb_xkb_list_components_reply_t *R)
   8039 {
   8040     return R->nKeycodes;
   8041 }
   8042 
   8043 xcb_xkb_listing_iterator_t
   8044 xcb_xkb_list_components_keycodes_iterator (const xcb_xkb_list_components_reply_t *R)
   8045 {
   8046     xcb_xkb_listing_iterator_t i;
   8047     xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_keymaps_iterator(R));
   8048     i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index));
   8049     i.rem = R->nKeycodes;
   8050     i.index = (char *) i.data - (char *) R;
   8051     return i;
   8052 }
   8053 
   8054 int
   8055 xcb_xkb_list_components_types_length (const xcb_xkb_list_components_reply_t *R)
   8056 {
   8057     return R->nTypes;
   8058 }
   8059 
   8060 xcb_xkb_listing_iterator_t
   8061 xcb_xkb_list_components_types_iterator (const xcb_xkb_list_components_reply_t *R)
   8062 {
   8063     xcb_xkb_listing_iterator_t i;
   8064     xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_keycodes_iterator(R));
   8065     i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index));
   8066     i.rem = R->nTypes;
   8067     i.index = (char *) i.data - (char *) R;
   8068     return i;
   8069 }
   8070 
   8071 int
   8072 xcb_xkb_list_components_compat_maps_length (const xcb_xkb_list_components_reply_t *R)
   8073 {
   8074     return R->nCompatMaps;
   8075 }
   8076 
   8077 xcb_xkb_listing_iterator_t
   8078 xcb_xkb_list_components_compat_maps_iterator (const xcb_xkb_list_components_reply_t *R)
   8079 {
   8080     xcb_xkb_listing_iterator_t i;
   8081     xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_types_iterator(R));
   8082     i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index));
   8083     i.rem = R->nCompatMaps;
   8084     i.index = (char *) i.data - (char *) R;
   8085     return i;
   8086 }
   8087 
   8088 int
   8089 xcb_xkb_list_components_symbols_length (const xcb_xkb_list_components_reply_t *R)
   8090 {
   8091     return R->nSymbols;
   8092 }
   8093 
   8094 xcb_xkb_listing_iterator_t
   8095 xcb_xkb_list_components_symbols_iterator (const xcb_xkb_list_components_reply_t *R)
   8096 {
   8097     xcb_xkb_listing_iterator_t i;
   8098     xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_compat_maps_iterator(R));
   8099     i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index));
   8100     i.rem = R->nSymbols;
   8101     i.index = (char *) i.data - (char *) R;
   8102     return i;
   8103 }
   8104 
   8105 int
   8106 xcb_xkb_list_components_geometries_length (const xcb_xkb_list_components_reply_t *R)
   8107 {
   8108     return R->nGeometries;
   8109 }
   8110 
   8111 xcb_xkb_listing_iterator_t
   8112 xcb_xkb_list_components_geometries_iterator (const xcb_xkb_list_components_reply_t *R)
   8113 {
   8114     xcb_xkb_listing_iterator_t i;
   8115     xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_symbols_iterator(R));
   8116     i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index));
   8117     i.rem = R->nGeometries;
   8118     i.index = (char *) i.data - (char *) R;
   8119     return i;
   8120 }
   8121 
   8122 xcb_xkb_list_components_reply_t *
   8123 xcb_xkb_list_components_reply (xcb_connection_t                  *c,
   8124                                xcb_xkb_list_components_cookie_t   cookie  /**< */,
   8125                                xcb_generic_error_t              **e)
   8126 {
   8127     return (xcb_xkb_list_components_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   8128 }
   8129 
   8130 int
   8131 xcb_xkb_get_kbd_by_name_replies_types_map_types_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8132                                                              const xcb_xkb_get_kbd_by_name_replies_t *S)
   8133 {
   8134     return S->types.nTypes;
   8135 }
   8136 
   8137 xcb_xkb_key_type_iterator_t
   8138 xcb_xkb_get_kbd_by_name_replies_types_map_types_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8139                                                                const xcb_xkb_get_kbd_by_name_replies_t *S)
   8140 {
   8141     xcb_xkb_key_type_iterator_t i;
   8142     i.data = S->types.map.types_rtrn;
   8143     i.rem = S->types.nTypes;
   8144     i.index = (char *) i.data - (char *) S;
   8145     return i;
   8146 }
   8147 
   8148 int
   8149 xcb_xkb_get_kbd_by_name_replies_types_map_syms_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8150                                                             const xcb_xkb_get_kbd_by_name_replies_t *S)
   8151 {
   8152     return S->types.nKeySyms;
   8153 }
   8154 
   8155 xcb_xkb_key_sym_map_iterator_t
   8156 xcb_xkb_get_kbd_by_name_replies_types_map_syms_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8157                                                               const xcb_xkb_get_kbd_by_name_replies_t *S)
   8158 {
   8159     xcb_xkb_key_sym_map_iterator_t i;
   8160     i.data = S->types.map.syms_rtrn;
   8161     i.rem = S->types.nKeySyms;
   8162     i.index = (char *) i.data - (char *) S;
   8163     return i;
   8164 }
   8165 
   8166 uint8_t *
   8167 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8168 {
   8169     return S->types.map.acts_rtrn_count;
   8170 }
   8171 
   8172 int
   8173 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8174                                                                   const xcb_xkb_get_kbd_by_name_replies_t *S)
   8175 {
   8176     return S->types.nKeyActions;
   8177 }
   8178 
   8179 xcb_generic_iterator_t
   8180 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count_end (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8181                                                                const xcb_xkb_get_kbd_by_name_replies_t *S)
   8182 {
   8183     xcb_generic_iterator_t i;
   8184     i.data = S->types.map.acts_rtrn_count + S->types.nKeyActions;
   8185     i.rem = 0;
   8186     i.index = (char *) i.data - (char *) S;
   8187     return i;
   8188 }
   8189 
   8190 xcb_xkb_action_t *
   8191 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8192 {
   8193     return S->types.map.acts_rtrn_acts;
   8194 }
   8195 
   8196 int
   8197 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8198                                                                  const xcb_xkb_get_kbd_by_name_replies_t *S)
   8199 {
   8200     return S->types.totalActions;
   8201 }
   8202 
   8203 xcb_xkb_action_iterator_t
   8204 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8205                                                                    const xcb_xkb_get_kbd_by_name_replies_t *S)
   8206 {
   8207     xcb_xkb_action_iterator_t i;
   8208     i.data = S->types.map.acts_rtrn_acts;
   8209     i.rem = S->types.totalActions;
   8210     i.index = (char *) i.data - (char *) S;
   8211     return i;
   8212 }
   8213 
   8214 xcb_xkb_set_behavior_t *
   8215 xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8216 {
   8217     return S->types.map.behaviors_rtrn;
   8218 }
   8219 
   8220 int
   8221 xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8222                                                                  const xcb_xkb_get_kbd_by_name_replies_t *S)
   8223 {
   8224     return S->types.totalKeyBehaviors;
   8225 }
   8226 
   8227 xcb_xkb_set_behavior_iterator_t
   8228 xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8229                                                                    const xcb_xkb_get_kbd_by_name_replies_t *S)
   8230 {
   8231     xcb_xkb_set_behavior_iterator_t i;
   8232     i.data = S->types.map.behaviors_rtrn;
   8233     i.rem = S->types.totalKeyBehaviors;
   8234     i.index = (char *) i.data - (char *) S;
   8235     return i;
   8236 }
   8237 
   8238 uint8_t *
   8239 xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8240 {
   8241     return S->types.map.vmods_rtrn;
   8242 }
   8243 
   8244 int
   8245 xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8246                                                              const xcb_xkb_get_kbd_by_name_replies_t *S)
   8247 {
   8248     return xcb_popcount(S->types.virtualMods);
   8249 }
   8250 
   8251 xcb_generic_iterator_t
   8252 xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn_end (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8253                                                           const xcb_xkb_get_kbd_by_name_replies_t *S)
   8254 {
   8255     xcb_generic_iterator_t i;
   8256     i.data = S->types.map.vmods_rtrn + xcb_popcount(S->types.virtualMods);
   8257     i.rem = 0;
   8258     i.index = (char *) i.data - (char *) S;
   8259     return i;
   8260 }
   8261 
   8262 xcb_xkb_set_explicit_t *
   8263 xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8264 {
   8265     return S->types.map.explicit_rtrn;
   8266 }
   8267 
   8268 int
   8269 xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8270                                                                 const xcb_xkb_get_kbd_by_name_replies_t *S)
   8271 {
   8272     return S->types.totalKeyExplicit;
   8273 }
   8274 
   8275 xcb_xkb_set_explicit_iterator_t
   8276 xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8277                                                                   const xcb_xkb_get_kbd_by_name_replies_t *S)
   8278 {
   8279     xcb_xkb_set_explicit_iterator_t i;
   8280     i.data = S->types.map.explicit_rtrn;
   8281     i.rem = S->types.totalKeyExplicit;
   8282     i.index = (char *) i.data - (char *) S;
   8283     return i;
   8284 }
   8285 
   8286 xcb_xkb_key_mod_map_t *
   8287 xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8288 {
   8289     return S->types.map.modmap_rtrn;
   8290 }
   8291 
   8292 int
   8293 xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8294                                                               const xcb_xkb_get_kbd_by_name_replies_t *S)
   8295 {
   8296     return S->types.totalModMapKeys;
   8297 }
   8298 
   8299 xcb_xkb_key_mod_map_iterator_t
   8300 xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8301                                                                 const xcb_xkb_get_kbd_by_name_replies_t *S)
   8302 {
   8303     xcb_xkb_key_mod_map_iterator_t i;
   8304     i.data = S->types.map.modmap_rtrn;
   8305     i.rem = S->types.totalModMapKeys;
   8306     i.index = (char *) i.data - (char *) S;
   8307     return i;
   8308 }
   8309 
   8310 xcb_xkb_key_v_mod_map_t *
   8311 xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8312 {
   8313     return S->types.map.vmodmap_rtrn;
   8314 }
   8315 
   8316 int
   8317 xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8318                                                                const xcb_xkb_get_kbd_by_name_replies_t *S)
   8319 {
   8320     return S->types.totalVModMapKeys;
   8321 }
   8322 
   8323 xcb_xkb_key_v_mod_map_iterator_t
   8324 xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8325                                                                  const xcb_xkb_get_kbd_by_name_replies_t *S)
   8326 {
   8327     xcb_xkb_key_v_mod_map_iterator_t i;
   8328     i.data = S->types.map.vmodmap_rtrn;
   8329     i.rem = S->types.totalVModMapKeys;
   8330     i.index = (char *) i.data - (char *) S;
   8331     return i;
   8332 }
   8333 
   8334 int
   8335 xcb_xkb_get_kbd_by_name_replies_types_map_serialize (void                                              **_buffer,
   8336                                                      uint8_t                                             nTypes,
   8337                                                      uint8_t                                             nKeySyms,
   8338                                                      uint8_t                                             nKeyActions,
   8339                                                      uint16_t                                            totalActions,
   8340                                                      uint8_t                                             totalKeyBehaviors,
   8341                                                      uint16_t                                            virtualMods,
   8342                                                      uint8_t                                             totalKeyExplicit,
   8343                                                      uint8_t                                             totalModMapKeys,
   8344                                                      uint8_t                                             totalVModMapKeys,
   8345                                                      uint16_t                                            present,
   8346                                                      const xcb_xkb_get_kbd_by_name_replies_types_map_t  *_aux)
   8347 {
   8348     char *xcb_out = *_buffer;
   8349     unsigned int xcb_buffer_len = 0;
   8350     unsigned int xcb_align_to = 0;
   8351     unsigned int xcb_padding_offset = 0;
   8352 
   8353     unsigned int xcb_pad = 0;
   8354     char xcb_pad0[3] = {0, 0, 0};
   8355     struct iovec xcb_parts[23];
   8356     unsigned int xcb_parts_idx = 0;
   8357     unsigned int xcb_block_len = 0;
   8358     unsigned int i;
   8359     char *xcb_tmp;
   8360 
   8361     if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
   8362         /* insert padding */
   8363         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8364         xcb_buffer_len += xcb_block_len + xcb_pad;
   8365         if (0 != xcb_pad) {
   8366             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8367             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8368             xcb_parts_idx++;
   8369             xcb_pad = 0;
   8370         }
   8371         xcb_block_len = 0;
   8372         xcb_padding_offset = 0;
   8373         /* types_rtrn */
   8374         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->types_rtrn;
   8375         xcb_parts[xcb_parts_idx].iov_len = 0;
   8376         xcb_tmp = (char *) _aux->types_rtrn;
   8377         for(i=0; i<nTypes; i++) {
   8378             xcb_block_len = xcb_xkb_key_type_sizeof(xcb_tmp);
   8379             xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
   8380         }
   8381         xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
   8382         xcb_parts_idx++;
   8383         xcb_align_to = ALIGNOF(xcb_xkb_key_type_t);
   8384     }
   8385     if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
   8386         /* insert padding */
   8387         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8388         xcb_buffer_len += xcb_block_len + xcb_pad;
   8389         if (0 != xcb_pad) {
   8390             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8391             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8392             xcb_parts_idx++;
   8393             xcb_pad = 0;
   8394         }
   8395         xcb_block_len = 0;
   8396         xcb_padding_offset = 0;
   8397         /* syms_rtrn */
   8398         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->syms_rtrn;
   8399         xcb_parts[xcb_parts_idx].iov_len = 0;
   8400         xcb_tmp = (char *) _aux->syms_rtrn;
   8401         for(i=0; i<nKeySyms; i++) {
   8402             xcb_block_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
   8403             xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
   8404         }
   8405         xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
   8406         xcb_parts_idx++;
   8407         xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
   8408     }
   8409     if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
   8410         /* insert padding */
   8411         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8412         xcb_buffer_len += xcb_block_len + xcb_pad;
   8413         if (0 != xcb_pad) {
   8414             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8415             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8416             xcb_parts_idx++;
   8417             xcb_pad = 0;
   8418         }
   8419         xcb_block_len = 0;
   8420         xcb_padding_offset = 0;
   8421         /* acts_rtrn_count */
   8422         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_count;
   8423         xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
   8424         xcb_parts[xcb_parts_idx].iov_len = nKeyActions * sizeof(xcb_keycode_t);
   8425         xcb_parts_idx++;
   8426         xcb_align_to = ALIGNOF(uint8_t);
   8427         xcb_align_to = 4;
   8428         /* insert padding */
   8429         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8430         xcb_buffer_len += xcb_block_len + xcb_pad;
   8431         if (0 != xcb_pad) {
   8432             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8433             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8434             xcb_parts_idx++;
   8435             xcb_pad = 0;
   8436         }
   8437         xcb_block_len = 0;
   8438         xcb_padding_offset = 0;
   8439         /* insert padding */
   8440         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8441         xcb_buffer_len += xcb_block_len + xcb_pad;
   8442         if (0 != xcb_pad) {
   8443             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8444             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8445             xcb_parts_idx++;
   8446             xcb_pad = 0;
   8447         }
   8448         xcb_block_len = 0;
   8449         xcb_padding_offset = 0;
   8450         /* acts_rtrn_acts */
   8451         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_acts;
   8452         xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
   8453         xcb_parts[xcb_parts_idx].iov_len = totalActions * sizeof(xcb_xkb_action_t);
   8454         xcb_parts_idx++;
   8455         xcb_align_to = ALIGNOF(xcb_xkb_action_t);
   8456     }
   8457     if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
   8458         /* insert padding */
   8459         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8460         xcb_buffer_len += xcb_block_len + xcb_pad;
   8461         if (0 != xcb_pad) {
   8462             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8463             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8464             xcb_parts_idx++;
   8465             xcb_pad = 0;
   8466         }
   8467         xcb_block_len = 0;
   8468         xcb_padding_offset = 0;
   8469         /* behaviors_rtrn */
   8470         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->behaviors_rtrn;
   8471         xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
   8472         xcb_parts[xcb_parts_idx].iov_len = totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
   8473         xcb_parts_idx++;
   8474         xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
   8475     }
   8476     if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
   8477         /* insert padding */
   8478         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8479         xcb_buffer_len += xcb_block_len + xcb_pad;
   8480         if (0 != xcb_pad) {
   8481             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8482             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8483             xcb_parts_idx++;
   8484             xcb_pad = 0;
   8485         }
   8486         xcb_block_len = 0;
   8487         xcb_padding_offset = 0;
   8488         /* vmods_rtrn */
   8489         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmods_rtrn;
   8490         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
   8491         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
   8492         xcb_parts_idx++;
   8493         xcb_align_to = ALIGNOF(uint8_t);
   8494         xcb_align_to = 4;
   8495         /* insert padding */
   8496         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8497         xcb_buffer_len += xcb_block_len + xcb_pad;
   8498         if (0 != xcb_pad) {
   8499             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8500             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8501             xcb_parts_idx++;
   8502             xcb_pad = 0;
   8503         }
   8504         xcb_block_len = 0;
   8505         xcb_padding_offset = 0;
   8506     }
   8507     if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
   8508         /* insert padding */
   8509         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8510         xcb_buffer_len += xcb_block_len + xcb_pad;
   8511         if (0 != xcb_pad) {
   8512             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8513             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8514             xcb_parts_idx++;
   8515             xcb_pad = 0;
   8516         }
   8517         xcb_block_len = 0;
   8518         xcb_padding_offset = 0;
   8519         /* explicit_rtrn */
   8520         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->explicit_rtrn;
   8521         xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
   8522         xcb_parts[xcb_parts_idx].iov_len = totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
   8523         xcb_parts_idx++;
   8524         xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
   8525         xcb_align_to = 4;
   8526         /* insert padding */
   8527         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8528         xcb_buffer_len += xcb_block_len + xcb_pad;
   8529         if (0 != xcb_pad) {
   8530             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8531             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8532             xcb_parts_idx++;
   8533             xcb_pad = 0;
   8534         }
   8535         xcb_block_len = 0;
   8536         xcb_padding_offset = 0;
   8537     }
   8538     if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
   8539         /* insert padding */
   8540         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8541         xcb_buffer_len += xcb_block_len + xcb_pad;
   8542         if (0 != xcb_pad) {
   8543             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8544             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8545             xcb_parts_idx++;
   8546             xcb_pad = 0;
   8547         }
   8548         xcb_block_len = 0;
   8549         xcb_padding_offset = 0;
   8550         /* modmap_rtrn */
   8551         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->modmap_rtrn;
   8552         xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
   8553         xcb_parts[xcb_parts_idx].iov_len = totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
   8554         xcb_parts_idx++;
   8555         xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
   8556         xcb_align_to = 4;
   8557         /* insert padding */
   8558         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8559         xcb_buffer_len += xcb_block_len + xcb_pad;
   8560         if (0 != xcb_pad) {
   8561             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8562             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8563             xcb_parts_idx++;
   8564             xcb_pad = 0;
   8565         }
   8566         xcb_block_len = 0;
   8567         xcb_padding_offset = 0;
   8568     }
   8569     if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
   8570         /* insert padding */
   8571         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8572         xcb_buffer_len += xcb_block_len + xcb_pad;
   8573         if (0 != xcb_pad) {
   8574             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8575             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8576             xcb_parts_idx++;
   8577             xcb_pad = 0;
   8578         }
   8579         xcb_block_len = 0;
   8580         xcb_padding_offset = 0;
   8581         /* vmodmap_rtrn */
   8582         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmodmap_rtrn;
   8583         xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
   8584         xcb_parts[xcb_parts_idx].iov_len = totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
   8585         xcb_parts_idx++;
   8586         xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
   8587     }
   8588     /* insert padding */
   8589     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8590     xcb_buffer_len += xcb_block_len + xcb_pad;
   8591     if (0 != xcb_pad) {
   8592         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   8593         xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   8594         xcb_parts_idx++;
   8595         xcb_pad = 0;
   8596     }
   8597     xcb_block_len = 0;
   8598     xcb_padding_offset = 0;
   8599 
   8600     if (NULL == xcb_out) {
   8601         /* allocate memory */
   8602         xcb_out = malloc(xcb_buffer_len);
   8603         *_buffer = xcb_out;
   8604     }
   8605 
   8606     xcb_tmp = xcb_out;
   8607     for(i=0; i<xcb_parts_idx; i++) {
   8608         if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
   8609             memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
   8610         if (0 != xcb_parts[i].iov_len)
   8611             xcb_tmp += xcb_parts[i].iov_len;
   8612     }
   8613 
   8614     return xcb_buffer_len;
   8615 }
   8616 
   8617 int
   8618 xcb_xkb_get_kbd_by_name_replies_types_map_unpack (const void                                   *_buffer,
   8619                                                   uint8_t                                       nTypes,
   8620                                                   uint8_t                                       nKeySyms,
   8621                                                   uint8_t                                       nKeyActions,
   8622                                                   uint16_t                                      totalActions,
   8623                                                   uint8_t                                       totalKeyBehaviors,
   8624                                                   uint16_t                                      virtualMods,
   8625                                                   uint8_t                                       totalKeyExplicit,
   8626                                                   uint8_t                                       totalModMapKeys,
   8627                                                   uint8_t                                       totalVModMapKeys,
   8628                                                   uint16_t                                      present,
   8629                                                   xcb_xkb_get_kbd_by_name_replies_types_map_t  *_aux)
   8630 {
   8631     char *xcb_tmp = (char *)_buffer;
   8632     unsigned int xcb_buffer_len = 0;
   8633     unsigned int xcb_block_len = 0;
   8634     unsigned int xcb_pad = 0;
   8635     unsigned int xcb_align_to = 0;
   8636     unsigned int xcb_padding_offset = 0;
   8637 
   8638     unsigned int i;
   8639     unsigned int xcb_tmp_len;
   8640 
   8641     if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
   8642         /* insert padding */
   8643         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8644         xcb_buffer_len += xcb_block_len + xcb_pad;
   8645         if (0 != xcb_pad) {
   8646             xcb_tmp += xcb_pad;
   8647             xcb_pad = 0;
   8648         }
   8649         xcb_block_len = 0;
   8650         xcb_padding_offset = 0;
   8651         /* types_rtrn */
   8652         _aux->types_rtrn = (xcb_xkb_key_type_t *)xcb_tmp;
   8653         for(i=0; i<nTypes; i++) {
   8654             xcb_tmp_len = xcb_xkb_key_type_sizeof(xcb_tmp);
   8655             xcb_block_len += xcb_tmp_len;
   8656             xcb_tmp += xcb_tmp_len;
   8657         }
   8658         xcb_align_to = ALIGNOF(xcb_xkb_key_type_t);
   8659     }
   8660     if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
   8661         /* insert padding */
   8662         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8663         xcb_buffer_len += xcb_block_len + xcb_pad;
   8664         if (0 != xcb_pad) {
   8665             xcb_tmp += xcb_pad;
   8666             xcb_pad = 0;
   8667         }
   8668         xcb_block_len = 0;
   8669         xcb_padding_offset = 0;
   8670         /* syms_rtrn */
   8671         _aux->syms_rtrn = (xcb_xkb_key_sym_map_t *)xcb_tmp;
   8672         for(i=0; i<nKeySyms; i++) {
   8673             xcb_tmp_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
   8674             xcb_block_len += xcb_tmp_len;
   8675             xcb_tmp += xcb_tmp_len;
   8676         }
   8677         xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
   8678     }
   8679     if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
   8680         /* insert padding */
   8681         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8682         xcb_buffer_len += xcb_block_len + xcb_pad;
   8683         if (0 != xcb_pad) {
   8684             xcb_tmp += xcb_pad;
   8685             xcb_pad = 0;
   8686         }
   8687         xcb_block_len = 0;
   8688         xcb_padding_offset = 0;
   8689         /* acts_rtrn_count */
   8690         _aux->acts_rtrn_count = (uint8_t *)xcb_tmp;
   8691         xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
   8692         xcb_tmp += xcb_block_len;
   8693         xcb_align_to = ALIGNOF(uint8_t);
   8694         xcb_align_to = 4;
   8695         /* insert padding */
   8696         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8697         xcb_buffer_len += xcb_block_len + xcb_pad;
   8698         if (0 != xcb_pad) {
   8699             xcb_tmp += xcb_pad;
   8700             xcb_pad = 0;
   8701         }
   8702         xcb_block_len = 0;
   8703         xcb_padding_offset = 0;
   8704         /* insert padding */
   8705         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8706         xcb_buffer_len += xcb_block_len + xcb_pad;
   8707         if (0 != xcb_pad) {
   8708             xcb_tmp += xcb_pad;
   8709             xcb_pad = 0;
   8710         }
   8711         xcb_block_len = 0;
   8712         xcb_padding_offset = 0;
   8713         /* acts_rtrn_acts */
   8714         _aux->acts_rtrn_acts = (xcb_xkb_action_t *)xcb_tmp;
   8715         xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
   8716         xcb_tmp += xcb_block_len;
   8717         xcb_align_to = ALIGNOF(xcb_xkb_action_t);
   8718     }
   8719     if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
   8720         /* insert padding */
   8721         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8722         xcb_buffer_len += xcb_block_len + xcb_pad;
   8723         if (0 != xcb_pad) {
   8724             xcb_tmp += xcb_pad;
   8725             xcb_pad = 0;
   8726         }
   8727         xcb_block_len = 0;
   8728         xcb_padding_offset = 0;
   8729         /* behaviors_rtrn */
   8730         _aux->behaviors_rtrn = (xcb_xkb_set_behavior_t *)xcb_tmp;
   8731         xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
   8732         xcb_tmp += xcb_block_len;
   8733         xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
   8734     }
   8735     if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
   8736         /* insert padding */
   8737         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8738         xcb_buffer_len += xcb_block_len + xcb_pad;
   8739         if (0 != xcb_pad) {
   8740             xcb_tmp += xcb_pad;
   8741             xcb_pad = 0;
   8742         }
   8743         xcb_block_len = 0;
   8744         xcb_padding_offset = 0;
   8745         /* vmods_rtrn */
   8746         _aux->vmods_rtrn = (uint8_t *)xcb_tmp;
   8747         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
   8748         xcb_tmp += xcb_block_len;
   8749         xcb_align_to = ALIGNOF(uint8_t);
   8750         xcb_align_to = 4;
   8751         /* insert padding */
   8752         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8753         xcb_buffer_len += xcb_block_len + xcb_pad;
   8754         if (0 != xcb_pad) {
   8755             xcb_tmp += xcb_pad;
   8756             xcb_pad = 0;
   8757         }
   8758         xcb_block_len = 0;
   8759         xcb_padding_offset = 0;
   8760     }
   8761     if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
   8762         /* insert padding */
   8763         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8764         xcb_buffer_len += xcb_block_len + xcb_pad;
   8765         if (0 != xcb_pad) {
   8766             xcb_tmp += xcb_pad;
   8767             xcb_pad = 0;
   8768         }
   8769         xcb_block_len = 0;
   8770         xcb_padding_offset = 0;
   8771         /* explicit_rtrn */
   8772         _aux->explicit_rtrn = (xcb_xkb_set_explicit_t *)xcb_tmp;
   8773         xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
   8774         xcb_tmp += xcb_block_len;
   8775         xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
   8776         xcb_align_to = 4;
   8777         /* insert padding */
   8778         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8779         xcb_buffer_len += xcb_block_len + xcb_pad;
   8780         if (0 != xcb_pad) {
   8781             xcb_tmp += xcb_pad;
   8782             xcb_pad = 0;
   8783         }
   8784         xcb_block_len = 0;
   8785         xcb_padding_offset = 0;
   8786     }
   8787     if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
   8788         /* insert padding */
   8789         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8790         xcb_buffer_len += xcb_block_len + xcb_pad;
   8791         if (0 != xcb_pad) {
   8792             xcb_tmp += xcb_pad;
   8793             xcb_pad = 0;
   8794         }
   8795         xcb_block_len = 0;
   8796         xcb_padding_offset = 0;
   8797         /* modmap_rtrn */
   8798         _aux->modmap_rtrn = (xcb_xkb_key_mod_map_t *)xcb_tmp;
   8799         xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
   8800         xcb_tmp += xcb_block_len;
   8801         xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
   8802         xcb_align_to = 4;
   8803         /* insert padding */
   8804         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8805         xcb_buffer_len += xcb_block_len + xcb_pad;
   8806         if (0 != xcb_pad) {
   8807             xcb_tmp += xcb_pad;
   8808             xcb_pad = 0;
   8809         }
   8810         xcb_block_len = 0;
   8811         xcb_padding_offset = 0;
   8812     }
   8813     if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
   8814         /* insert padding */
   8815         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8816         xcb_buffer_len += xcb_block_len + xcb_pad;
   8817         if (0 != xcb_pad) {
   8818             xcb_tmp += xcb_pad;
   8819             xcb_pad = 0;
   8820         }
   8821         xcb_block_len = 0;
   8822         xcb_padding_offset = 0;
   8823         /* vmodmap_rtrn */
   8824         _aux->vmodmap_rtrn = (xcb_xkb_key_v_mod_map_t *)xcb_tmp;
   8825         xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
   8826         xcb_tmp += xcb_block_len;
   8827         xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
   8828     }
   8829     /* insert padding */
   8830     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   8831     xcb_buffer_len += xcb_block_len + xcb_pad;
   8832     if (0 != xcb_pad) {
   8833         xcb_tmp += xcb_pad;
   8834         xcb_pad = 0;
   8835     }
   8836     xcb_block_len = 0;
   8837     xcb_padding_offset = 0;
   8838 
   8839     return xcb_buffer_len;
   8840 }
   8841 
   8842 int
   8843 xcb_xkb_get_kbd_by_name_replies_types_map_sizeof (const void  *_buffer,
   8844                                                   uint8_t      nTypes,
   8845                                                   uint8_t      nKeySyms,
   8846                                                   uint8_t      nKeyActions,
   8847                                                   uint16_t     totalActions,
   8848                                                   uint8_t      totalKeyBehaviors,
   8849                                                   uint16_t     virtualMods,
   8850                                                   uint8_t      totalKeyExplicit,
   8851                                                   uint8_t      totalModMapKeys,
   8852                                                   uint8_t      totalVModMapKeys,
   8853                                                   uint16_t     present)
   8854 {
   8855     xcb_xkb_get_kbd_by_name_replies_types_map_t _aux;
   8856     return xcb_xkb_get_kbd_by_name_replies_types_map_unpack(_buffer, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, &_aux);
   8857 }
   8858 
   8859 xcb_atom_t *
   8860 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8861 {
   8862     return S->key_names.valueList.typeNames;
   8863 }
   8864 
   8865 int
   8866 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8867                                                                         const xcb_xkb_get_kbd_by_name_replies_t *S)
   8868 {
   8869     return S->key_names.nTypes;
   8870 }
   8871 
   8872 xcb_generic_iterator_t
   8873 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8874                                                                      const xcb_xkb_get_kbd_by_name_replies_t *S)
   8875 {
   8876     xcb_generic_iterator_t i;
   8877     i.data = S->key_names.valueList.typeNames + S->key_names.nTypes;
   8878     i.rem = 0;
   8879     i.index = (char *) i.data - (char *) S;
   8880     return i;
   8881 }
   8882 
   8883 uint8_t *
   8884 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8885 {
   8886     return S->key_names.valueList.nLevelsPerType;
   8887 }
   8888 
   8889 int
   8890 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8891                                                                                const xcb_xkb_get_kbd_by_name_replies_t *S)
   8892 {
   8893     return S->key_names.nTypes;
   8894 }
   8895 
   8896 xcb_generic_iterator_t
   8897 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type_end (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8898                                                                             const xcb_xkb_get_kbd_by_name_replies_t *S)
   8899 {
   8900     xcb_generic_iterator_t i;
   8901     i.data = S->key_names.valueList.nLevelsPerType + S->key_names.nTypes;
   8902     i.rem = 0;
   8903     i.index = (char *) i.data - (char *) S;
   8904     return i;
   8905 }
   8906 
   8907 xcb_atom_t *
   8908 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8909 {
   8910     return S->key_names.valueList.ktLevelNames;
   8911 }
   8912 
   8913 int
   8914 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8915                                                                             const xcb_xkb_get_kbd_by_name_replies_t *S)
   8916 {
   8917     int xcb_pre_tmp_1; /* sumof length */
   8918     int xcb_pre_tmp_2; /* sumof loop counter */
   8919     int64_t xcb_pre_tmp_3; /* sumof sum */
   8920     const uint8_t* xcb_pre_tmp_4; /* sumof list ptr */
   8921     /* sumof start */
   8922     xcb_pre_tmp_1 = S->key_names.nTypes;
   8923     xcb_pre_tmp_3 = 0;
   8924     xcb_pre_tmp_4 = S->key_names.valueList.nLevelsPerType;
   8925     for (xcb_pre_tmp_2 = 0; xcb_pre_tmp_2 < xcb_pre_tmp_1; xcb_pre_tmp_2++) {
   8926         xcb_pre_tmp_3 += *xcb_pre_tmp_4;
   8927         xcb_pre_tmp_4++;
   8928     }
   8929     /* sumof end. Result is in xcb_pre_tmp_3 */
   8930     return xcb_pre_tmp_3;
   8931 }
   8932 
   8933 xcb_generic_iterator_t
   8934 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8935                                                                          const xcb_xkb_get_kbd_by_name_replies_t *S)
   8936 {
   8937     xcb_generic_iterator_t i;
   8938     int xcb_pre_tmp_5; /* sumof length */
   8939     int xcb_pre_tmp_6; /* sumof loop counter */
   8940     int64_t xcb_pre_tmp_7; /* sumof sum */
   8941     const uint8_t* xcb_pre_tmp_8; /* sumof list ptr */
   8942     /* sumof start */
   8943     xcb_pre_tmp_5 = S->key_names.nTypes;
   8944     xcb_pre_tmp_7 = 0;
   8945     xcb_pre_tmp_8 = S->key_names.valueList.nLevelsPerType;
   8946     for (xcb_pre_tmp_6 = 0; xcb_pre_tmp_6 < xcb_pre_tmp_5; xcb_pre_tmp_6++) {
   8947         xcb_pre_tmp_7 += *xcb_pre_tmp_8;
   8948         xcb_pre_tmp_8++;
   8949     }
   8950     /* sumof end. Result is in xcb_pre_tmp_7 */
   8951     i.data = S->key_names.valueList.ktLevelNames + xcb_pre_tmp_7;
   8952     i.rem = 0;
   8953     i.index = (char *) i.data - (char *) S;
   8954     return i;
   8955 }
   8956 
   8957 xcb_atom_t *
   8958 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8959 {
   8960     return S->key_names.valueList.indicatorNames;
   8961 }
   8962 
   8963 int
   8964 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8965                                                                              const xcb_xkb_get_kbd_by_name_replies_t *S)
   8966 {
   8967     return xcb_popcount(S->key_names.indicators);
   8968 }
   8969 
   8970 xcb_generic_iterator_t
   8971 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8972                                                                           const xcb_xkb_get_kbd_by_name_replies_t *S)
   8973 {
   8974     xcb_generic_iterator_t i;
   8975     i.data = S->key_names.valueList.indicatorNames + xcb_popcount(S->key_names.indicators);
   8976     i.rem = 0;
   8977     i.index = (char *) i.data - (char *) S;
   8978     return i;
   8979 }
   8980 
   8981 xcb_atom_t *
   8982 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names (const xcb_xkb_get_kbd_by_name_replies_t *S)
   8983 {
   8984     return S->key_names.valueList.virtualModNames;
   8985 }
   8986 
   8987 int
   8988 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8989                                                                                const xcb_xkb_get_kbd_by_name_replies_t *S)
   8990 {
   8991     return xcb_popcount(S->key_names.virtualMods);
   8992 }
   8993 
   8994 xcb_generic_iterator_t
   8995 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R,
   8996                                                                             const xcb_xkb_get_kbd_by_name_replies_t *S)
   8997 {
   8998     xcb_generic_iterator_t i;
   8999     i.data = S->key_names.valueList.virtualModNames + xcb_popcount(S->key_names.virtualMods);
   9000     i.rem = 0;
   9001     i.index = (char *) i.data - (char *) S;
   9002     return i;
   9003 }
   9004 
   9005 xcb_atom_t *
   9006 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups (const xcb_xkb_get_kbd_by_name_replies_t *S)
   9007 {
   9008     return S->key_names.valueList.groups;
   9009 }
   9010 
   9011 int
   9012 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9013                                                                     const xcb_xkb_get_kbd_by_name_replies_t *S)
   9014 {
   9015     return xcb_popcount(S->key_names.groupNames);
   9016 }
   9017 
   9018 xcb_generic_iterator_t
   9019 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups_end (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9020                                                                  const xcb_xkb_get_kbd_by_name_replies_t *S)
   9021 {
   9022     xcb_generic_iterator_t i;
   9023     i.data = S->key_names.valueList.groups + xcb_popcount(S->key_names.groupNames);
   9024     i.rem = 0;
   9025     i.index = (char *) i.data - (char *) S;
   9026     return i;
   9027 }
   9028 
   9029 xcb_xkb_key_name_t *
   9030 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names (const xcb_xkb_get_kbd_by_name_replies_t *S)
   9031 {
   9032     return S->key_names.valueList.keyNames;
   9033 }
   9034 
   9035 int
   9036 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9037                                                                        const xcb_xkb_get_kbd_by_name_replies_t *S)
   9038 {
   9039     return S->key_names.nKeys;
   9040 }
   9041 
   9042 xcb_xkb_key_name_iterator_t
   9043 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9044                                                                          const xcb_xkb_get_kbd_by_name_replies_t *S)
   9045 {
   9046     xcb_xkb_key_name_iterator_t i;
   9047     i.data = S->key_names.valueList.keyNames;
   9048     i.rem = S->key_names.nKeys;
   9049     i.index = (char *) i.data - (char *) S;
   9050     return i;
   9051 }
   9052 
   9053 xcb_xkb_key_alias_t *
   9054 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases (const xcb_xkb_get_kbd_by_name_replies_t *S)
   9055 {
   9056     return S->key_names.valueList.keyAliases;
   9057 }
   9058 
   9059 int
   9060 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9061                                                                          const xcb_xkb_get_kbd_by_name_replies_t *S)
   9062 {
   9063     return S->key_names.nKeyAliases;
   9064 }
   9065 
   9066 xcb_xkb_key_alias_iterator_t
   9067 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9068                                                                            const xcb_xkb_get_kbd_by_name_replies_t *S)
   9069 {
   9070     xcb_xkb_key_alias_iterator_t i;
   9071     i.data = S->key_names.valueList.keyAliases;
   9072     i.rem = S->key_names.nKeyAliases;
   9073     i.index = (char *) i.data - (char *) S;
   9074     return i;
   9075 }
   9076 
   9077 xcb_atom_t *
   9078 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names (const xcb_xkb_get_kbd_by_name_replies_t *S)
   9079 {
   9080     return S->key_names.valueList.radioGroupNames;
   9081 }
   9082 
   9083 int
   9084 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9085                                                                                const xcb_xkb_get_kbd_by_name_replies_t *S)
   9086 {
   9087     return S->key_names.nRadioGroups;
   9088 }
   9089 
   9090 xcb_generic_iterator_t
   9091 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9092                                                                             const xcb_xkb_get_kbd_by_name_replies_t *S)
   9093 {
   9094     xcb_generic_iterator_t i;
   9095     i.data = S->key_names.valueList.radioGroupNames + S->key_names.nRadioGroups;
   9096     i.rem = 0;
   9097     i.index = (char *) i.data - (char *) S;
   9098     return i;
   9099 }
   9100 
   9101 int
   9102 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_serialize (void                                                         **_buffer,
   9103                                                                 uint8_t                                                        nTypes,
   9104                                                                 uint32_t                                                       indicators,
   9105                                                                 uint16_t                                                       virtualMods,
   9106                                                                 uint8_t                                                        groupNames,
   9107                                                                 uint8_t                                                        nKeys,
   9108                                                                 uint8_t                                                        nKeyAliases,
   9109                                                                 uint8_t                                                        nRadioGroups,
   9110                                                                 uint32_t                                                       which,
   9111                                                                 const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t  *_aux)
   9112 {
   9113     char *xcb_out = *_buffer;
   9114     unsigned int xcb_buffer_len = 0;
   9115     unsigned int xcb_align_to = 0;
   9116     unsigned int xcb_padding_offset = 0;
   9117 
   9118     int xcb_pre_tmp_1; /* sumof length */
   9119     int xcb_pre_tmp_2; /* sumof loop counter */
   9120     int64_t xcb_pre_tmp_3; /* sumof sum */
   9121     const uint8_t* xcb_pre_tmp_4; /* sumof list ptr */
   9122     unsigned int xcb_pad = 0;
   9123     char xcb_pad0[3] = {0, 0, 0};
   9124     struct iovec xcb_parts[26];
   9125     unsigned int xcb_parts_idx = 0;
   9126     unsigned int xcb_block_len = 0;
   9127     unsigned int i;
   9128     char *xcb_tmp;
   9129 
   9130     if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
   9131         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.keycodesName */
   9132         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->keycodesName;
   9133         xcb_block_len += sizeof(xcb_atom_t);
   9134         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   9135         xcb_parts_idx++;
   9136         xcb_align_to = ALIGNOF(xcb_atom_t);
   9137     }
   9138     if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
   9139         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.geometryName */
   9140         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometryName;
   9141         xcb_block_len += sizeof(xcb_atom_t);
   9142         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   9143         xcb_parts_idx++;
   9144         xcb_align_to = ALIGNOF(xcb_atom_t);
   9145     }
   9146     if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
   9147         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.symbolsName */
   9148         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->symbolsName;
   9149         xcb_block_len += sizeof(xcb_atom_t);
   9150         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   9151         xcb_parts_idx++;
   9152         xcb_align_to = ALIGNOF(xcb_atom_t);
   9153     }
   9154     if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
   9155         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.physSymbolsName */
   9156         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->physSymbolsName;
   9157         xcb_block_len += sizeof(xcb_atom_t);
   9158         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   9159         xcb_parts_idx++;
   9160         xcb_align_to = ALIGNOF(xcb_atom_t);
   9161     }
   9162     if(which & XCB_XKB_NAME_DETAIL_TYPES) {
   9163         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.typesName */
   9164         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->typesName;
   9165         xcb_block_len += sizeof(xcb_atom_t);
   9166         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   9167         xcb_parts_idx++;
   9168         xcb_align_to = ALIGNOF(xcb_atom_t);
   9169     }
   9170     if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
   9171         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.compatName */
   9172         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatName;
   9173         xcb_block_len += sizeof(xcb_atom_t);
   9174         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   9175         xcb_parts_idx++;
   9176         xcb_align_to = ALIGNOF(xcb_atom_t);
   9177     }
   9178     if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
   9179         /* insert padding */
   9180         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9181         xcb_buffer_len += xcb_block_len + xcb_pad;
   9182         if (0 != xcb_pad) {
   9183             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9184             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9185             xcb_parts_idx++;
   9186             xcb_pad = 0;
   9187         }
   9188         xcb_block_len = 0;
   9189         xcb_padding_offset = 0;
   9190         /* typeNames */
   9191         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->typeNames;
   9192         xcb_block_len += nTypes * sizeof(xcb_atom_t);
   9193         xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(xcb_atom_t);
   9194         xcb_parts_idx++;
   9195         xcb_align_to = ALIGNOF(xcb_atom_t);
   9196     }
   9197     if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
   9198         /* insert padding */
   9199         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9200         xcb_buffer_len += xcb_block_len + xcb_pad;
   9201         if (0 != xcb_pad) {
   9202             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9203             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9204             xcb_parts_idx++;
   9205             xcb_pad = 0;
   9206         }
   9207         xcb_block_len = 0;
   9208         xcb_padding_offset = 0;
   9209         /* nLevelsPerType */
   9210         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->nLevelsPerType;
   9211         xcb_block_len += nTypes * sizeof(uint8_t);
   9212         xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(uint8_t);
   9213         xcb_parts_idx++;
   9214         xcb_align_to = ALIGNOF(uint8_t);
   9215         xcb_align_to = 4;
   9216         /* insert padding */
   9217         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9218         xcb_buffer_len += xcb_block_len + xcb_pad;
   9219         if (0 != xcb_pad) {
   9220             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9221             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9222             xcb_parts_idx++;
   9223             xcb_pad = 0;
   9224         }
   9225         xcb_block_len = 0;
   9226         xcb_padding_offset = 0;
   9227         /* insert padding */
   9228         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9229         xcb_buffer_len += xcb_block_len + xcb_pad;
   9230         if (0 != xcb_pad) {
   9231             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9232             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9233             xcb_parts_idx++;
   9234             xcb_pad = 0;
   9235         }
   9236         xcb_block_len = 0;
   9237         xcb_padding_offset = 0;
   9238         /* ktLevelNames */
   9239         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->ktLevelNames;
   9240         /* sumof start */
   9241         xcb_pre_tmp_1 = nTypes;
   9242         xcb_pre_tmp_3 = 0;
   9243         xcb_pre_tmp_4 = _aux->nLevelsPerType;
   9244         for (xcb_pre_tmp_2 = 0; xcb_pre_tmp_2 < xcb_pre_tmp_1; xcb_pre_tmp_2++) {
   9245             xcb_pre_tmp_3 += *xcb_pre_tmp_4;
   9246             xcb_pre_tmp_4++;
   9247         }
   9248         /* sumof end. Result is in xcb_pre_tmp_3 */
   9249         xcb_block_len += xcb_pre_tmp_3 * sizeof(xcb_atom_t);
   9250         xcb_parts[xcb_parts_idx].iov_len = xcb_pre_tmp_3 * sizeof(xcb_atom_t);
   9251         xcb_parts_idx++;
   9252         xcb_align_to = ALIGNOF(xcb_atom_t);
   9253     }
   9254     if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
   9255         /* insert padding */
   9256         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9257         xcb_buffer_len += xcb_block_len + xcb_pad;
   9258         if (0 != xcb_pad) {
   9259             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9260             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9261             xcb_parts_idx++;
   9262             xcb_pad = 0;
   9263         }
   9264         xcb_block_len = 0;
   9265         xcb_padding_offset = 0;
   9266         /* indicatorNames */
   9267         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicatorNames;
   9268         xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
   9269         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(indicators) * sizeof(xcb_atom_t);
   9270         xcb_parts_idx++;
   9271         xcb_align_to = ALIGNOF(xcb_atom_t);
   9272     }
   9273     if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
   9274         /* insert padding */
   9275         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9276         xcb_buffer_len += xcb_block_len + xcb_pad;
   9277         if (0 != xcb_pad) {
   9278             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9279             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9280             xcb_parts_idx++;
   9281             xcb_pad = 0;
   9282         }
   9283         xcb_block_len = 0;
   9284         xcb_padding_offset = 0;
   9285         /* virtualModNames */
   9286         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->virtualModNames;
   9287         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
   9288         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
   9289         xcb_parts_idx++;
   9290         xcb_align_to = ALIGNOF(xcb_atom_t);
   9291     }
   9292     if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
   9293         /* insert padding */
   9294         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9295         xcb_buffer_len += xcb_block_len + xcb_pad;
   9296         if (0 != xcb_pad) {
   9297             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9298             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9299             xcb_parts_idx++;
   9300             xcb_pad = 0;
   9301         }
   9302         xcb_block_len = 0;
   9303         xcb_padding_offset = 0;
   9304         /* groups */
   9305         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->groups;
   9306         xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
   9307         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(groupNames) * sizeof(xcb_atom_t);
   9308         xcb_parts_idx++;
   9309         xcb_align_to = ALIGNOF(xcb_atom_t);
   9310     }
   9311     if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
   9312         /* insert padding */
   9313         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9314         xcb_buffer_len += xcb_block_len + xcb_pad;
   9315         if (0 != xcb_pad) {
   9316             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9317             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9318             xcb_parts_idx++;
   9319             xcb_pad = 0;
   9320         }
   9321         xcb_block_len = 0;
   9322         xcb_padding_offset = 0;
   9323         /* keyNames */
   9324         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyNames;
   9325         xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
   9326         xcb_parts[xcb_parts_idx].iov_len = nKeys * sizeof(xcb_xkb_key_name_t);
   9327         xcb_parts_idx++;
   9328         xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
   9329     }
   9330     if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
   9331         /* insert padding */
   9332         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9333         xcb_buffer_len += xcb_block_len + xcb_pad;
   9334         if (0 != xcb_pad) {
   9335             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9336             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9337             xcb_parts_idx++;
   9338             xcb_pad = 0;
   9339         }
   9340         xcb_block_len = 0;
   9341         xcb_padding_offset = 0;
   9342         /* keyAliases */
   9343         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyAliases;
   9344         xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
   9345         xcb_parts[xcb_parts_idx].iov_len = nKeyAliases * sizeof(xcb_xkb_key_alias_t);
   9346         xcb_parts_idx++;
   9347         xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
   9348     }
   9349     if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
   9350         /* insert padding */
   9351         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9352         xcb_buffer_len += xcb_block_len + xcb_pad;
   9353         if (0 != xcb_pad) {
   9354             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9355             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9356             xcb_parts_idx++;
   9357             xcb_pad = 0;
   9358         }
   9359         xcb_block_len = 0;
   9360         xcb_padding_offset = 0;
   9361         /* radioGroupNames */
   9362         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->radioGroupNames;
   9363         xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
   9364         xcb_parts[xcb_parts_idx].iov_len = nRadioGroups * sizeof(xcb_atom_t);
   9365         xcb_parts_idx++;
   9366         xcb_align_to = ALIGNOF(xcb_atom_t);
   9367     }
   9368     /* insert padding */
   9369     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9370     xcb_buffer_len += xcb_block_len + xcb_pad;
   9371     if (0 != xcb_pad) {
   9372         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9373         xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9374         xcb_parts_idx++;
   9375         xcb_pad = 0;
   9376     }
   9377     xcb_block_len = 0;
   9378     xcb_padding_offset = 0;
   9379 
   9380     if (NULL == xcb_out) {
   9381         /* allocate memory */
   9382         xcb_out = malloc(xcb_buffer_len);
   9383         *_buffer = xcb_out;
   9384     }
   9385 
   9386     xcb_tmp = xcb_out;
   9387     for(i=0; i<xcb_parts_idx; i++) {
   9388         if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
   9389             memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
   9390         if (0 != xcb_parts[i].iov_len)
   9391             xcb_tmp += xcb_parts[i].iov_len;
   9392     }
   9393 
   9394     return xcb_buffer_len;
   9395 }
   9396 
   9397 int
   9398 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_unpack (const void                                              *_buffer,
   9399                                                              uint8_t                                                  nTypes,
   9400                                                              uint32_t                                                 indicators,
   9401                                                              uint16_t                                                 virtualMods,
   9402                                                              uint8_t                                                  groupNames,
   9403                                                              uint8_t                                                  nKeys,
   9404                                                              uint8_t                                                  nKeyAliases,
   9405                                                              uint8_t                                                  nRadioGroups,
   9406                                                              uint32_t                                                 which,
   9407                                                              xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t  *_aux)
   9408 {
   9409     char *xcb_tmp = (char *)_buffer;
   9410     unsigned int xcb_buffer_len = 0;
   9411     unsigned int xcb_block_len = 0;
   9412     unsigned int xcb_pad = 0;
   9413     unsigned int xcb_align_to = 0;
   9414     unsigned int xcb_padding_offset = 0;
   9415 
   9416     int xcb_pre_tmp_1; /* sumof length */
   9417     int xcb_pre_tmp_2; /* sumof loop counter */
   9418     int64_t xcb_pre_tmp_3; /* sumof sum */
   9419     const uint8_t* xcb_pre_tmp_4; /* sumof list ptr */
   9420 
   9421     if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
   9422         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.keycodesName */
   9423         _aux->keycodesName = *(xcb_atom_t *)xcb_tmp;
   9424         xcb_block_len += sizeof(xcb_atom_t);
   9425         xcb_tmp += sizeof(xcb_atom_t);
   9426         xcb_align_to = ALIGNOF(xcb_atom_t);
   9427     }
   9428     if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
   9429         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.geometryName */
   9430         _aux->geometryName = *(xcb_atom_t *)xcb_tmp;
   9431         xcb_block_len += sizeof(xcb_atom_t);
   9432         xcb_tmp += sizeof(xcb_atom_t);
   9433         xcb_align_to = ALIGNOF(xcb_atom_t);
   9434     }
   9435     if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
   9436         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.symbolsName */
   9437         _aux->symbolsName = *(xcb_atom_t *)xcb_tmp;
   9438         xcb_block_len += sizeof(xcb_atom_t);
   9439         xcb_tmp += sizeof(xcb_atom_t);
   9440         xcb_align_to = ALIGNOF(xcb_atom_t);
   9441     }
   9442     if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
   9443         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.physSymbolsName */
   9444         _aux->physSymbolsName = *(xcb_atom_t *)xcb_tmp;
   9445         xcb_block_len += sizeof(xcb_atom_t);
   9446         xcb_tmp += sizeof(xcb_atom_t);
   9447         xcb_align_to = ALIGNOF(xcb_atom_t);
   9448     }
   9449     if(which & XCB_XKB_NAME_DETAIL_TYPES) {
   9450         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.typesName */
   9451         _aux->typesName = *(xcb_atom_t *)xcb_tmp;
   9452         xcb_block_len += sizeof(xcb_atom_t);
   9453         xcb_tmp += sizeof(xcb_atom_t);
   9454         xcb_align_to = ALIGNOF(xcb_atom_t);
   9455     }
   9456     if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
   9457         /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.compatName */
   9458         _aux->compatName = *(xcb_atom_t *)xcb_tmp;
   9459         xcb_block_len += sizeof(xcb_atom_t);
   9460         xcb_tmp += sizeof(xcb_atom_t);
   9461         xcb_align_to = ALIGNOF(xcb_atom_t);
   9462     }
   9463     if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
   9464         /* insert padding */
   9465         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9466         xcb_buffer_len += xcb_block_len + xcb_pad;
   9467         if (0 != xcb_pad) {
   9468             xcb_tmp += xcb_pad;
   9469             xcb_pad = 0;
   9470         }
   9471         xcb_block_len = 0;
   9472         xcb_padding_offset = 0;
   9473         /* typeNames */
   9474         _aux->typeNames = (xcb_atom_t *)xcb_tmp;
   9475         xcb_block_len += nTypes * sizeof(xcb_atom_t);
   9476         xcb_tmp += xcb_block_len;
   9477         xcb_align_to = ALIGNOF(xcb_atom_t);
   9478     }
   9479     if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
   9480         /* insert padding */
   9481         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9482         xcb_buffer_len += xcb_block_len + xcb_pad;
   9483         if (0 != xcb_pad) {
   9484             xcb_tmp += xcb_pad;
   9485             xcb_pad = 0;
   9486         }
   9487         xcb_block_len = 0;
   9488         xcb_padding_offset = 0;
   9489         /* nLevelsPerType */
   9490         _aux->nLevelsPerType = (uint8_t *)xcb_tmp;
   9491         xcb_block_len += nTypes * sizeof(uint8_t);
   9492         xcb_tmp += xcb_block_len;
   9493         xcb_align_to = ALIGNOF(uint8_t);
   9494         xcb_align_to = 4;
   9495         /* insert padding */
   9496         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9497         xcb_buffer_len += xcb_block_len + xcb_pad;
   9498         if (0 != xcb_pad) {
   9499             xcb_tmp += xcb_pad;
   9500             xcb_pad = 0;
   9501         }
   9502         xcb_block_len = 0;
   9503         xcb_padding_offset = 0;
   9504         /* insert padding */
   9505         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9506         xcb_buffer_len += xcb_block_len + xcb_pad;
   9507         if (0 != xcb_pad) {
   9508             xcb_tmp += xcb_pad;
   9509             xcb_pad = 0;
   9510         }
   9511         xcb_block_len = 0;
   9512         xcb_padding_offset = 0;
   9513         /* ktLevelNames */
   9514         _aux->ktLevelNames = (xcb_atom_t *)xcb_tmp;
   9515         /* sumof start */
   9516         xcb_pre_tmp_1 = nTypes;
   9517         xcb_pre_tmp_3 = 0;
   9518         xcb_pre_tmp_4 = _aux->nLevelsPerType;
   9519         for (xcb_pre_tmp_2 = 0; xcb_pre_tmp_2 < xcb_pre_tmp_1; xcb_pre_tmp_2++) {
   9520             xcb_pre_tmp_3 += *xcb_pre_tmp_4;
   9521             xcb_pre_tmp_4++;
   9522         }
   9523         /* sumof end. Result is in xcb_pre_tmp_3 */
   9524         xcb_block_len += xcb_pre_tmp_3 * sizeof(xcb_atom_t);
   9525         xcb_tmp += xcb_block_len;
   9526         xcb_align_to = ALIGNOF(xcb_atom_t);
   9527     }
   9528     if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
   9529         /* insert padding */
   9530         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9531         xcb_buffer_len += xcb_block_len + xcb_pad;
   9532         if (0 != xcb_pad) {
   9533             xcb_tmp += xcb_pad;
   9534             xcb_pad = 0;
   9535         }
   9536         xcb_block_len = 0;
   9537         xcb_padding_offset = 0;
   9538         /* indicatorNames */
   9539         _aux->indicatorNames = (xcb_atom_t *)xcb_tmp;
   9540         xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
   9541         xcb_tmp += xcb_block_len;
   9542         xcb_align_to = ALIGNOF(xcb_atom_t);
   9543     }
   9544     if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
   9545         /* insert padding */
   9546         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9547         xcb_buffer_len += xcb_block_len + xcb_pad;
   9548         if (0 != xcb_pad) {
   9549             xcb_tmp += xcb_pad;
   9550             xcb_pad = 0;
   9551         }
   9552         xcb_block_len = 0;
   9553         xcb_padding_offset = 0;
   9554         /* virtualModNames */
   9555         _aux->virtualModNames = (xcb_atom_t *)xcb_tmp;
   9556         xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
   9557         xcb_tmp += xcb_block_len;
   9558         xcb_align_to = ALIGNOF(xcb_atom_t);
   9559     }
   9560     if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
   9561         /* insert padding */
   9562         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9563         xcb_buffer_len += xcb_block_len + xcb_pad;
   9564         if (0 != xcb_pad) {
   9565             xcb_tmp += xcb_pad;
   9566             xcb_pad = 0;
   9567         }
   9568         xcb_block_len = 0;
   9569         xcb_padding_offset = 0;
   9570         /* groups */
   9571         _aux->groups = (xcb_atom_t *)xcb_tmp;
   9572         xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
   9573         xcb_tmp += xcb_block_len;
   9574         xcb_align_to = ALIGNOF(xcb_atom_t);
   9575     }
   9576     if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
   9577         /* insert padding */
   9578         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9579         xcb_buffer_len += xcb_block_len + xcb_pad;
   9580         if (0 != xcb_pad) {
   9581             xcb_tmp += xcb_pad;
   9582             xcb_pad = 0;
   9583         }
   9584         xcb_block_len = 0;
   9585         xcb_padding_offset = 0;
   9586         /* keyNames */
   9587         _aux->keyNames = (xcb_xkb_key_name_t *)xcb_tmp;
   9588         xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
   9589         xcb_tmp += xcb_block_len;
   9590         xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
   9591     }
   9592     if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
   9593         /* insert padding */
   9594         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9595         xcb_buffer_len += xcb_block_len + xcb_pad;
   9596         if (0 != xcb_pad) {
   9597             xcb_tmp += xcb_pad;
   9598             xcb_pad = 0;
   9599         }
   9600         xcb_block_len = 0;
   9601         xcb_padding_offset = 0;
   9602         /* keyAliases */
   9603         _aux->keyAliases = (xcb_xkb_key_alias_t *)xcb_tmp;
   9604         xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
   9605         xcb_tmp += xcb_block_len;
   9606         xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
   9607     }
   9608     if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
   9609         /* insert padding */
   9610         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9611         xcb_buffer_len += xcb_block_len + xcb_pad;
   9612         if (0 != xcb_pad) {
   9613             xcb_tmp += xcb_pad;
   9614             xcb_pad = 0;
   9615         }
   9616         xcb_block_len = 0;
   9617         xcb_padding_offset = 0;
   9618         /* radioGroupNames */
   9619         _aux->radioGroupNames = (xcb_atom_t *)xcb_tmp;
   9620         xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
   9621         xcb_tmp += xcb_block_len;
   9622         xcb_align_to = ALIGNOF(xcb_atom_t);
   9623     }
   9624     /* insert padding */
   9625     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9626     xcb_buffer_len += xcb_block_len + xcb_pad;
   9627     if (0 != xcb_pad) {
   9628         xcb_tmp += xcb_pad;
   9629         xcb_pad = 0;
   9630     }
   9631     xcb_block_len = 0;
   9632     xcb_padding_offset = 0;
   9633 
   9634     return xcb_buffer_len;
   9635 }
   9636 
   9637 int
   9638 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_sizeof (const void  *_buffer,
   9639                                                              uint8_t      nTypes,
   9640                                                              uint32_t     indicators,
   9641                                                              uint16_t     virtualMods,
   9642                                                              uint8_t      groupNames,
   9643                                                              uint8_t      nKeys,
   9644                                                              uint8_t      nKeyAliases,
   9645                                                              uint8_t      nRadioGroups,
   9646                                                              uint32_t     which)
   9647 {
   9648     xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t _aux;
   9649     return xcb_xkb_get_kbd_by_name_replies_key_names_value_list_unpack(_buffer, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, &_aux);
   9650 }
   9651 
   9652 xcb_xkb_get_kbd_by_name_replies_types_map_t *
   9653 xcb_xkb_get_kbd_by_name_replies_types_map (const xcb_xkb_get_kbd_by_name_replies_t *R)
   9654 {
   9655     return (xcb_xkb_get_kbd_by_name_replies_types_map_t *) (R + 1);
   9656 }
   9657 
   9658 xcb_xkb_sym_interpret_t *
   9659 xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S)
   9660 {
   9661     return S->compat_map.si_rtrn;
   9662 }
   9663 
   9664 int
   9665 xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9666                                                            const xcb_xkb_get_kbd_by_name_replies_t *S)
   9667 {
   9668     return S->compat_map.nSIRtrn;
   9669 }
   9670 
   9671 xcb_xkb_sym_interpret_iterator_t
   9672 xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9673                                                              const xcb_xkb_get_kbd_by_name_replies_t *S)
   9674 {
   9675     xcb_xkb_sym_interpret_iterator_t i;
   9676     i.data = S->compat_map.si_rtrn;
   9677     i.rem = S->compat_map.nSIRtrn;
   9678     i.index = (char *) i.data - (char *) S;
   9679     return i;
   9680 }
   9681 
   9682 xcb_xkb_mod_def_t *
   9683 xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S)
   9684 {
   9685     return S->compat_map.group_rtrn;
   9686 }
   9687 
   9688 int
   9689 xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9690                                                               const xcb_xkb_get_kbd_by_name_replies_t *S)
   9691 {
   9692     return xcb_popcount(S->compat_map.groupsRtrn);
   9693 }
   9694 
   9695 xcb_xkb_mod_def_iterator_t
   9696 xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9697                                                                 const xcb_xkb_get_kbd_by_name_replies_t *S)
   9698 {
   9699     xcb_xkb_mod_def_iterator_t i;
   9700     i.data = S->compat_map.group_rtrn;
   9701     i.rem = xcb_popcount(S->compat_map.groupsRtrn);
   9702     i.index = (char *) i.data - (char *) S;
   9703     return i;
   9704 }
   9705 
   9706 xcb_xkb_indicator_map_t *
   9707 xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps (const xcb_xkb_get_kbd_by_name_replies_t *S)
   9708 {
   9709     return S->indicator_maps.maps;
   9710 }
   9711 
   9712 int
   9713 xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps_length (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9714                                                             const xcb_xkb_get_kbd_by_name_replies_t *S)
   9715 {
   9716     return S->indicator_maps.nIndicators;
   9717 }
   9718 
   9719 xcb_xkb_indicator_map_iterator_t
   9720 xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R,
   9721                                                               const xcb_xkb_get_kbd_by_name_replies_t *S)
   9722 {
   9723     xcb_xkb_indicator_map_iterator_t i;
   9724     i.data = S->indicator_maps.maps;
   9725     i.rem = S->indicator_maps.nIndicators;
   9726     i.index = (char *) i.data - (char *) S;
   9727     return i;
   9728 }
   9729 
   9730 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *
   9731 xcb_xkb_get_kbd_by_name_replies_key_names_value_list (const xcb_xkb_get_kbd_by_name_replies_t *R)
   9732 {
   9733     return (xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *) (R + 1);
   9734 }
   9735 
   9736 xcb_xkb_counted_string_16_t *
   9737 xcb_xkb_get_kbd_by_name_replies_geometry_label_font (const xcb_xkb_get_kbd_by_name_replies_t *R)
   9738 {
   9739     return (xcb_xkb_counted_string_16_t *) (R + 1);
   9740 }
   9741 
   9742 int
   9743 xcb_xkb_get_kbd_by_name_replies_serialize (void                                    **_buffer,
   9744                                            uint16_t                                  reported,
   9745                                            const xcb_xkb_get_kbd_by_name_replies_t  *_aux)
   9746 {
   9747     char *xcb_out = *_buffer;
   9748     unsigned int xcb_buffer_len = 0;
   9749     unsigned int xcb_align_to = 0;
   9750     unsigned int xcb_padding_offset = 0;
   9751 
   9752     unsigned int xcb_pad = 0;
   9753     char xcb_pad0[3] = {0, 0, 0};
   9754     struct iovec xcb_parts[96];
   9755     unsigned int xcb_parts_idx = 0;
   9756     unsigned int xcb_block_len = 0;
   9757     unsigned int i;
   9758     char *xcb_tmp;
   9759 
   9760     if((reported & XCB_XKB_GBN_DETAIL_TYPES) ||
   9761        (reported & XCB_XKB_GBN_DETAIL_CLIENT_SYMBOLS) ||
   9762        (reported & XCB_XKB_GBN_DETAIL_SERVER_SYMBOLS)) {
   9763         /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_type */
   9764         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.getmap_type;
   9765         xcb_block_len += sizeof(uint8_t);
   9766         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9767         xcb_parts_idx++;
   9768         xcb_align_to = ALIGNOF(uint8_t);
   9769         /* xcb_xkb_get_kbd_by_name_replies_t.types.typeDeviceID */
   9770         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.typeDeviceID;
   9771         xcb_block_len += sizeof(uint8_t);
   9772         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9773         xcb_parts_idx++;
   9774         xcb_align_to = ALIGNOF(uint8_t);
   9775         /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_sequence */
   9776         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.getmap_sequence;
   9777         xcb_block_len += sizeof(uint16_t);
   9778         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   9779         xcb_parts_idx++;
   9780         xcb_align_to = ALIGNOF(uint16_t);
   9781         /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_length */
   9782         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.getmap_length;
   9783         xcb_block_len += sizeof(uint32_t);
   9784         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   9785         xcb_parts_idx++;
   9786         xcb_align_to = ALIGNOF(uint32_t);
   9787         /* xcb_xkb_get_kbd_by_name_replies_t.types.pad1 */
   9788         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9789         xcb_block_len += sizeof(uint8_t)*2;
   9790         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*2;
   9791         xcb_parts_idx++;
   9792         xcb_align_to = ALIGNOF(uint8_t);
   9793         /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMinKeyCode */
   9794         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.typeMinKeyCode;
   9795         xcb_block_len += sizeof(xcb_keycode_t);
   9796         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   9797         xcb_parts_idx++;
   9798         xcb_align_to = ALIGNOF(xcb_keycode_t);
   9799         /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMaxKeyCode */
   9800         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.typeMaxKeyCode;
   9801         xcb_block_len += sizeof(xcb_keycode_t);
   9802         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   9803         xcb_parts_idx++;
   9804         xcb_align_to = ALIGNOF(xcb_keycode_t);
   9805         /* xcb_xkb_get_kbd_by_name_replies_t.types.present */
   9806         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.present;
   9807         xcb_block_len += sizeof(uint16_t);
   9808         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   9809         xcb_parts_idx++;
   9810         xcb_align_to = ALIGNOF(uint16_t);
   9811         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstType */
   9812         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstType;
   9813         xcb_block_len += sizeof(uint8_t);
   9814         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9815         xcb_parts_idx++;
   9816         xcb_align_to = ALIGNOF(uint8_t);
   9817         /* xcb_xkb_get_kbd_by_name_replies_t.types.nTypes */
   9818         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nTypes;
   9819         xcb_block_len += sizeof(uint8_t);
   9820         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9821         xcb_parts_idx++;
   9822         xcb_align_to = ALIGNOF(uint8_t);
   9823         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalTypes */
   9824         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalTypes;
   9825         xcb_block_len += sizeof(uint8_t);
   9826         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9827         xcb_parts_idx++;
   9828         xcb_align_to = ALIGNOF(uint8_t);
   9829         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeySym */
   9830         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeySym;
   9831         xcb_block_len += sizeof(xcb_keycode_t);
   9832         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   9833         xcb_parts_idx++;
   9834         xcb_align_to = ALIGNOF(xcb_keycode_t);
   9835         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalSyms */
   9836         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalSyms;
   9837         xcb_block_len += sizeof(uint16_t);
   9838         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   9839         xcb_parts_idx++;
   9840         xcb_align_to = ALIGNOF(uint16_t);
   9841         /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeySyms */
   9842         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeySyms;
   9843         xcb_block_len += sizeof(uint8_t);
   9844         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9845         xcb_parts_idx++;
   9846         xcb_align_to = ALIGNOF(uint8_t);
   9847         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyAction */
   9848         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeyAction;
   9849         xcb_block_len += sizeof(xcb_keycode_t);
   9850         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   9851         xcb_parts_idx++;
   9852         xcb_align_to = ALIGNOF(xcb_keycode_t);
   9853         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalActions */
   9854         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalActions;
   9855         xcb_block_len += sizeof(uint16_t);
   9856         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   9857         xcb_parts_idx++;
   9858         xcb_align_to = ALIGNOF(uint16_t);
   9859         /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyActions */
   9860         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeyActions;
   9861         xcb_block_len += sizeof(uint8_t);
   9862         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9863         xcb_parts_idx++;
   9864         xcb_align_to = ALIGNOF(uint8_t);
   9865         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyBehavior */
   9866         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeyBehavior;
   9867         xcb_block_len += sizeof(xcb_keycode_t);
   9868         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   9869         xcb_parts_idx++;
   9870         xcb_align_to = ALIGNOF(xcb_keycode_t);
   9871         /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyBehaviors */
   9872         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeyBehaviors;
   9873         xcb_block_len += sizeof(uint8_t);
   9874         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9875         xcb_parts_idx++;
   9876         xcb_align_to = ALIGNOF(uint8_t);
   9877         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyBehaviors */
   9878         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalKeyBehaviors;
   9879         xcb_block_len += sizeof(uint8_t);
   9880         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9881         xcb_parts_idx++;
   9882         xcb_align_to = ALIGNOF(uint8_t);
   9883         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyExplicit */
   9884         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeyExplicit;
   9885         xcb_block_len += sizeof(xcb_keycode_t);
   9886         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   9887         xcb_parts_idx++;
   9888         xcb_align_to = ALIGNOF(xcb_keycode_t);
   9889         /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyExplicit */
   9890         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeyExplicit;
   9891         xcb_block_len += sizeof(uint8_t);
   9892         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9893         xcb_parts_idx++;
   9894         xcb_align_to = ALIGNOF(uint8_t);
   9895         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyExplicit */
   9896         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalKeyExplicit;
   9897         xcb_block_len += sizeof(uint8_t);
   9898         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9899         xcb_parts_idx++;
   9900         xcb_align_to = ALIGNOF(uint8_t);
   9901         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstModMapKey */
   9902         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstModMapKey;
   9903         xcb_block_len += sizeof(xcb_keycode_t);
   9904         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   9905         xcb_parts_idx++;
   9906         xcb_align_to = ALIGNOF(xcb_keycode_t);
   9907         /* xcb_xkb_get_kbd_by_name_replies_t.types.nModMapKeys */
   9908         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nModMapKeys;
   9909         xcb_block_len += sizeof(uint8_t);
   9910         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9911         xcb_parts_idx++;
   9912         xcb_align_to = ALIGNOF(uint8_t);
   9913         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalModMapKeys */
   9914         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalModMapKeys;
   9915         xcb_block_len += sizeof(uint8_t);
   9916         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9917         xcb_parts_idx++;
   9918         xcb_align_to = ALIGNOF(uint8_t);
   9919         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstVModMapKey */
   9920         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstVModMapKey;
   9921         xcb_block_len += sizeof(xcb_keycode_t);
   9922         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   9923         xcb_parts_idx++;
   9924         xcb_align_to = ALIGNOF(xcb_keycode_t);
   9925         /* xcb_xkb_get_kbd_by_name_replies_t.types.nVModMapKeys */
   9926         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nVModMapKeys;
   9927         xcb_block_len += sizeof(uint8_t);
   9928         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9929         xcb_parts_idx++;
   9930         xcb_align_to = ALIGNOF(uint8_t);
   9931         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalVModMapKeys */
   9932         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalVModMapKeys;
   9933         xcb_block_len += sizeof(uint8_t);
   9934         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9935         xcb_parts_idx++;
   9936         xcb_align_to = ALIGNOF(uint8_t);
   9937         /* xcb_xkb_get_kbd_by_name_replies_t.types.pad2 */
   9938         xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad;
   9939         xcb_block_len += sizeof(uint8_t);
   9940         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9941         xcb_parts_idx++;
   9942         xcb_align_to = ALIGNOF(uint8_t);
   9943         /* xcb_xkb_get_kbd_by_name_replies_t.types.virtualMods */
   9944         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.virtualMods;
   9945         xcb_block_len += sizeof(uint16_t);
   9946         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   9947         xcb_parts_idx++;
   9948         xcb_align_to = ALIGNOF(uint16_t);
   9949         /* insert padding */
   9950         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   9951         xcb_buffer_len += xcb_block_len + xcb_pad;
   9952         if (0 != xcb_pad) {
   9953             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   9954             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   9955             xcb_parts_idx++;
   9956             xcb_pad = 0;
   9957         }
   9958         xcb_block_len = 0;
   9959         xcb_padding_offset = 0;
   9960         /* map */
   9961         xcb_parts[xcb_parts_idx].iov_base = (char *)0;
   9962         xcb_block_len += xcb_xkb_get_kbd_by_name_replies_types_map_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->types.nTypes, _aux->types.nKeySyms, _aux->types.nKeyActions, _aux->types.totalActions, _aux->types.totalKeyBehaviors, _aux->types.virtualMods, _aux->types.totalKeyExplicit, _aux->types.totalModMapKeys, _aux->types.totalVModMapKeys, _aux->types.present, &_aux->types.map);
   9963         xcb_parts[xcb_parts_idx].iov_len = xcb_xkb_get_kbd_by_name_replies_types_map_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->types.nTypes, _aux->types.nKeySyms, _aux->types.nKeyActions, _aux->types.totalActions, _aux->types.totalKeyBehaviors, _aux->types.virtualMods, _aux->types.totalKeyExplicit, _aux->types.totalModMapKeys, _aux->types.totalVModMapKeys, _aux->types.present, &_aux->types.map);
   9964         xcb_parts_idx++;
   9965         xcb_align_to = ALIGNOF(char);
   9966     }
   9967     if(reported & XCB_XKB_GBN_DETAIL_COMPAT_MAP) {
   9968         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_type */
   9969         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatmap_type;
   9970         xcb_block_len += sizeof(uint8_t);
   9971         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9972         xcb_parts_idx++;
   9973         xcb_align_to = ALIGNOF(uint8_t);
   9974         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatDeviceID */
   9975         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatDeviceID;
   9976         xcb_block_len += sizeof(uint8_t);
   9977         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9978         xcb_parts_idx++;
   9979         xcb_align_to = ALIGNOF(uint8_t);
   9980         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_sequence */
   9981         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatmap_sequence;
   9982         xcb_block_len += sizeof(uint16_t);
   9983         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   9984         xcb_parts_idx++;
   9985         xcb_align_to = ALIGNOF(uint16_t);
   9986         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_length */
   9987         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatmap_length;
   9988         xcb_block_len += sizeof(uint32_t);
   9989         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   9990         xcb_parts_idx++;
   9991         xcb_align_to = ALIGNOF(uint32_t);
   9992         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.groupsRtrn */
   9993         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.groupsRtrn;
   9994         xcb_block_len += sizeof(uint8_t);
   9995         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   9996         xcb_parts_idx++;
   9997         xcb_align_to = ALIGNOF(uint8_t);
   9998         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad7 */
   9999         xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad;
   10000         xcb_block_len += sizeof(uint8_t);
   10001         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10002         xcb_parts_idx++;
   10003         xcb_align_to = ALIGNOF(uint8_t);
   10004         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.firstSIRtrn */
   10005         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.firstSIRtrn;
   10006         xcb_block_len += sizeof(uint16_t);
   10007         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10008         xcb_parts_idx++;
   10009         xcb_align_to = ALIGNOF(uint16_t);
   10010         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nSIRtrn */
   10011         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.nSIRtrn;
   10012         xcb_block_len += sizeof(uint16_t);
   10013         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10014         xcb_parts_idx++;
   10015         xcb_align_to = ALIGNOF(uint16_t);
   10016         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nTotalSI */
   10017         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.nTotalSI;
   10018         xcb_block_len += sizeof(uint16_t);
   10019         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10020         xcb_parts_idx++;
   10021         xcb_align_to = ALIGNOF(uint16_t);
   10022         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad8 */
   10023         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   10024         xcb_block_len += sizeof(uint8_t)*16;
   10025         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*16;
   10026         xcb_parts_idx++;
   10027         xcb_align_to = ALIGNOF(uint8_t);
   10028         /* insert padding */
   10029         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10030         xcb_buffer_len += xcb_block_len + xcb_pad;
   10031         if (0 != xcb_pad) {
   10032             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   10033             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   10034             xcb_parts_idx++;
   10035             xcb_pad = 0;
   10036         }
   10037         xcb_block_len = 0;
   10038         xcb_padding_offset = 0;
   10039         /* si_rtrn */
   10040         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->compat_map.si_rtrn;
   10041         xcb_block_len += _aux->compat_map.nSIRtrn * sizeof(xcb_xkb_sym_interpret_t);
   10042         xcb_parts[xcb_parts_idx].iov_len = _aux->compat_map.nSIRtrn * sizeof(xcb_xkb_sym_interpret_t);
   10043         xcb_parts_idx++;
   10044         xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t);
   10045         /* insert padding */
   10046         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10047         xcb_buffer_len += xcb_block_len + xcb_pad;
   10048         if (0 != xcb_pad) {
   10049             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   10050             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   10051             xcb_parts_idx++;
   10052             xcb_pad = 0;
   10053         }
   10054         xcb_block_len = 0;
   10055         xcb_padding_offset = 0;
   10056         /* group_rtrn */
   10057         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->compat_map.group_rtrn;
   10058         xcb_block_len += xcb_popcount(_aux->compat_map.groupsRtrn) * sizeof(xcb_xkb_mod_def_t);
   10059         xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(_aux->compat_map.groupsRtrn) * sizeof(xcb_xkb_mod_def_t);
   10060         xcb_parts_idx++;
   10061         xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t);
   10062     }
   10063     if(reported & XCB_XKB_GBN_DETAIL_INDICATOR_MAPS) {
   10064         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_type */
   10065         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatormap_type;
   10066         xcb_block_len += sizeof(uint8_t);
   10067         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10068         xcb_parts_idx++;
   10069         xcb_align_to = ALIGNOF(uint8_t);
   10070         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatorDeviceID */
   10071         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatorDeviceID;
   10072         xcb_block_len += sizeof(uint8_t);
   10073         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10074         xcb_parts_idx++;
   10075         xcb_align_to = ALIGNOF(uint8_t);
   10076         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_sequence */
   10077         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatormap_sequence;
   10078         xcb_block_len += sizeof(uint16_t);
   10079         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10080         xcb_parts_idx++;
   10081         xcb_align_to = ALIGNOF(uint16_t);
   10082         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_length */
   10083         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatormap_length;
   10084         xcb_block_len += sizeof(uint32_t);
   10085         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   10086         xcb_parts_idx++;
   10087         xcb_align_to = ALIGNOF(uint32_t);
   10088         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.which */
   10089         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.which;
   10090         xcb_block_len += sizeof(uint32_t);
   10091         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   10092         xcb_parts_idx++;
   10093         xcb_align_to = ALIGNOF(uint32_t);
   10094         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.realIndicators */
   10095         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.realIndicators;
   10096         xcb_block_len += sizeof(uint32_t);
   10097         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   10098         xcb_parts_idx++;
   10099         xcb_align_to = ALIGNOF(uint32_t);
   10100         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.nIndicators */
   10101         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.nIndicators;
   10102         xcb_block_len += sizeof(uint8_t);
   10103         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10104         xcb_parts_idx++;
   10105         xcb_align_to = ALIGNOF(uint8_t);
   10106         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.pad9 */
   10107         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   10108         xcb_block_len += sizeof(uint8_t)*15;
   10109         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*15;
   10110         xcb_parts_idx++;
   10111         xcb_align_to = ALIGNOF(uint8_t);
   10112         /* insert padding */
   10113         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10114         xcb_buffer_len += xcb_block_len + xcb_pad;
   10115         if (0 != xcb_pad) {
   10116             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   10117             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   10118             xcb_parts_idx++;
   10119             xcb_pad = 0;
   10120         }
   10121         xcb_block_len = 0;
   10122         xcb_padding_offset = 0;
   10123         /* maps */
   10124         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicator_maps.maps;
   10125         xcb_block_len += _aux->indicator_maps.nIndicators * sizeof(xcb_xkb_indicator_map_t);
   10126         xcb_parts[xcb_parts_idx].iov_len = _aux->indicator_maps.nIndicators * sizeof(xcb_xkb_indicator_map_t);
   10127         xcb_parts_idx++;
   10128         xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
   10129     }
   10130     if((reported & XCB_XKB_GBN_DETAIL_KEY_NAMES) ||
   10131        (reported & XCB_XKB_GBN_DETAIL_OTHER_NAMES)) {
   10132         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_type */
   10133         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyname_type;
   10134         xcb_block_len += sizeof(uint8_t);
   10135         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10136         xcb_parts_idx++;
   10137         xcb_align_to = ALIGNOF(uint8_t);
   10138         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyDeviceID */
   10139         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyDeviceID;
   10140         xcb_block_len += sizeof(uint8_t);
   10141         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10142         xcb_parts_idx++;
   10143         xcb_align_to = ALIGNOF(uint8_t);
   10144         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_sequence */
   10145         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyname_sequence;
   10146         xcb_block_len += sizeof(uint16_t);
   10147         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10148         xcb_parts_idx++;
   10149         xcb_align_to = ALIGNOF(uint16_t);
   10150         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_length */
   10151         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyname_length;
   10152         xcb_block_len += sizeof(uint32_t);
   10153         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   10154         xcb_parts_idx++;
   10155         xcb_align_to = ALIGNOF(uint32_t);
   10156         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.which */
   10157         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.which;
   10158         xcb_block_len += sizeof(uint32_t);
   10159         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   10160         xcb_parts_idx++;
   10161         xcb_align_to = ALIGNOF(uint32_t);
   10162         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMinKeyCode */
   10163         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyMinKeyCode;
   10164         xcb_block_len += sizeof(xcb_keycode_t);
   10165         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   10166         xcb_parts_idx++;
   10167         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10168         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMaxKeyCode */
   10169         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyMaxKeyCode;
   10170         xcb_block_len += sizeof(xcb_keycode_t);
   10171         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   10172         xcb_parts_idx++;
   10173         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10174         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nTypes */
   10175         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nTypes;
   10176         xcb_block_len += sizeof(uint8_t);
   10177         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10178         xcb_parts_idx++;
   10179         xcb_align_to = ALIGNOF(uint8_t);
   10180         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.groupNames */
   10181         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.groupNames;
   10182         xcb_block_len += sizeof(uint8_t);
   10183         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10184         xcb_parts_idx++;
   10185         xcb_align_to = ALIGNOF(uint8_t);
   10186         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.virtualMods */
   10187         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.virtualMods;
   10188         xcb_block_len += sizeof(uint16_t);
   10189         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10190         xcb_parts_idx++;
   10191         xcb_align_to = ALIGNOF(uint16_t);
   10192         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.firstKey */
   10193         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.firstKey;
   10194         xcb_block_len += sizeof(xcb_keycode_t);
   10195         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
   10196         xcb_parts_idx++;
   10197         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10198         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeys */
   10199         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nKeys;
   10200         xcb_block_len += sizeof(uint8_t);
   10201         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10202         xcb_parts_idx++;
   10203         xcb_align_to = ALIGNOF(uint8_t);
   10204         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.indicators */
   10205         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.indicators;
   10206         xcb_block_len += sizeof(uint32_t);
   10207         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   10208         xcb_parts_idx++;
   10209         xcb_align_to = ALIGNOF(uint32_t);
   10210         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nRadioGroups */
   10211         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nRadioGroups;
   10212         xcb_block_len += sizeof(uint8_t);
   10213         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10214         xcb_parts_idx++;
   10215         xcb_align_to = ALIGNOF(uint8_t);
   10216         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeyAliases */
   10217         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nKeyAliases;
   10218         xcb_block_len += sizeof(uint8_t);
   10219         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10220         xcb_parts_idx++;
   10221         xcb_align_to = ALIGNOF(uint8_t);
   10222         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKTLevels */
   10223         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nKTLevels;
   10224         xcb_block_len += sizeof(uint16_t);
   10225         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10226         xcb_parts_idx++;
   10227         xcb_align_to = ALIGNOF(uint16_t);
   10228         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.pad10 */
   10229         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   10230         xcb_block_len += sizeof(uint8_t)*4;
   10231         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*4;
   10232         xcb_parts_idx++;
   10233         xcb_align_to = ALIGNOF(uint8_t);
   10234         /* insert padding */
   10235         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10236         xcb_buffer_len += xcb_block_len + xcb_pad;
   10237         if (0 != xcb_pad) {
   10238             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   10239             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   10240             xcb_parts_idx++;
   10241             xcb_pad = 0;
   10242         }
   10243         xcb_block_len = 0;
   10244         xcb_padding_offset = 0;
   10245         /* valueList */
   10246         xcb_parts[xcb_parts_idx].iov_base = (char *)0;
   10247         xcb_block_len += xcb_xkb_get_kbd_by_name_replies_key_names_value_list_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->key_names.nTypes, _aux->key_names.indicators, _aux->key_names.virtualMods, _aux->key_names.groupNames, _aux->key_names.nKeys, _aux->key_names.nKeyAliases, _aux->key_names.nRadioGroups, _aux->key_names.which, &_aux->key_names.valueList);
   10248         xcb_parts[xcb_parts_idx].iov_len = xcb_xkb_get_kbd_by_name_replies_key_names_value_list_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->key_names.nTypes, _aux->key_names.indicators, _aux->key_names.virtualMods, _aux->key_names.groupNames, _aux->key_names.nKeys, _aux->key_names.nKeyAliases, _aux->key_names.nRadioGroups, _aux->key_names.which, &_aux->key_names.valueList);
   10249         xcb_parts_idx++;
   10250         xcb_align_to = ALIGNOF(char);
   10251     }
   10252     if(reported & XCB_XKB_GBN_DETAIL_GEOMETRY) {
   10253         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_type */
   10254         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometry_type;
   10255         xcb_block_len += sizeof(uint8_t);
   10256         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10257         xcb_parts_idx++;
   10258         xcb_align_to = ALIGNOF(uint8_t);
   10259         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryDeviceID */
   10260         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometryDeviceID;
   10261         xcb_block_len += sizeof(uint8_t);
   10262         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10263         xcb_parts_idx++;
   10264         xcb_align_to = ALIGNOF(uint8_t);
   10265         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_sequence */
   10266         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometry_sequence;
   10267         xcb_block_len += sizeof(uint16_t);
   10268         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10269         xcb_parts_idx++;
   10270         xcb_align_to = ALIGNOF(uint16_t);
   10271         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_length */
   10272         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometry_length;
   10273         xcb_block_len += sizeof(uint32_t);
   10274         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
   10275         xcb_parts_idx++;
   10276         xcb_align_to = ALIGNOF(uint32_t);
   10277         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.name */
   10278         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.name;
   10279         xcb_block_len += sizeof(xcb_atom_t);
   10280         xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
   10281         xcb_parts_idx++;
   10282         xcb_align_to = ALIGNOF(xcb_atom_t);
   10283         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryFound */
   10284         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometryFound;
   10285         xcb_block_len += sizeof(uint8_t);
   10286         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10287         xcb_parts_idx++;
   10288         xcb_align_to = ALIGNOF(uint8_t);
   10289         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.pad12 */
   10290         xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad;
   10291         xcb_block_len += sizeof(uint8_t);
   10292         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10293         xcb_parts_idx++;
   10294         xcb_align_to = ALIGNOF(uint8_t);
   10295         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.widthMM */
   10296         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.widthMM;
   10297         xcb_block_len += sizeof(uint16_t);
   10298         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10299         xcb_parts_idx++;
   10300         xcb_align_to = ALIGNOF(uint16_t);
   10301         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.heightMM */
   10302         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.heightMM;
   10303         xcb_block_len += sizeof(uint16_t);
   10304         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10305         xcb_parts_idx++;
   10306         xcb_align_to = ALIGNOF(uint16_t);
   10307         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nProperties */
   10308         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nProperties;
   10309         xcb_block_len += sizeof(uint16_t);
   10310         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10311         xcb_parts_idx++;
   10312         xcb_align_to = ALIGNOF(uint16_t);
   10313         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nColors */
   10314         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nColors;
   10315         xcb_block_len += sizeof(uint16_t);
   10316         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10317         xcb_parts_idx++;
   10318         xcb_align_to = ALIGNOF(uint16_t);
   10319         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nShapes */
   10320         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nShapes;
   10321         xcb_block_len += sizeof(uint16_t);
   10322         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10323         xcb_parts_idx++;
   10324         xcb_align_to = ALIGNOF(uint16_t);
   10325         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nSections */
   10326         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nSections;
   10327         xcb_block_len += sizeof(uint16_t);
   10328         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10329         xcb_parts_idx++;
   10330         xcb_align_to = ALIGNOF(uint16_t);
   10331         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nDoodads */
   10332         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nDoodads;
   10333         xcb_block_len += sizeof(uint16_t);
   10334         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10335         xcb_parts_idx++;
   10336         xcb_align_to = ALIGNOF(uint16_t);
   10337         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nKeyAliases */
   10338         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nKeyAliases;
   10339         xcb_block_len += sizeof(uint16_t);
   10340         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
   10341         xcb_parts_idx++;
   10342         xcb_align_to = ALIGNOF(uint16_t);
   10343         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.baseColorNdx */
   10344         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.baseColorNdx;
   10345         xcb_block_len += sizeof(uint8_t);
   10346         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10347         xcb_parts_idx++;
   10348         xcb_align_to = ALIGNOF(uint8_t);
   10349         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.labelColorNdx */
   10350         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.labelColorNdx;
   10351         xcb_block_len += sizeof(uint8_t);
   10352         xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
   10353         xcb_parts_idx++;
   10354         xcb_align_to = ALIGNOF(uint8_t);
   10355         /* insert padding */
   10356         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10357         xcb_buffer_len += xcb_block_len + xcb_pad;
   10358         if (0 != xcb_pad) {
   10359             xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   10360             xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   10361             xcb_parts_idx++;
   10362             xcb_pad = 0;
   10363         }
   10364         xcb_block_len = 0;
   10365         xcb_padding_offset = 0;
   10366         /* labelFont */
   10367         xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->geometry.labelFont;
   10368         xcb_block_len += xcb_xkb_counted_string_16_sizeof(_aux->geometry.labelFont);
   10369         xcb_parts[xcb_parts_idx].iov_len = xcb_xkb_counted_string_16_sizeof(_aux->geometry.labelFont);
   10370         xcb_parts_idx++;
   10371         xcb_align_to = ALIGNOF(xcb_xkb_counted_string_16_t);
   10372     }
   10373     /* insert padding */
   10374     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10375     xcb_buffer_len += xcb_block_len + xcb_pad;
   10376     if (0 != xcb_pad) {
   10377         xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
   10378         xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
   10379         xcb_parts_idx++;
   10380         xcb_pad = 0;
   10381     }
   10382     xcb_block_len = 0;
   10383     xcb_padding_offset = 0;
   10384 
   10385     if (NULL == xcb_out) {
   10386         /* allocate memory */
   10387         xcb_out = malloc(xcb_buffer_len);
   10388         *_buffer = xcb_out;
   10389     }
   10390 
   10391     xcb_tmp = xcb_out;
   10392     for(i=0; i<xcb_parts_idx; i++) {
   10393         if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
   10394             memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
   10395         if (0 != xcb_parts[i].iov_len)
   10396             xcb_tmp += xcb_parts[i].iov_len;
   10397     }
   10398 
   10399     return xcb_buffer_len;
   10400 }
   10401 
   10402 int
   10403 xcb_xkb_get_kbd_by_name_replies_unpack (const void                         *_buffer,
   10404                                         uint16_t                            reported,
   10405                                         xcb_xkb_get_kbd_by_name_replies_t  *_aux)
   10406 {
   10407     char *xcb_tmp = (char *)_buffer;
   10408     unsigned int xcb_buffer_len = 0;
   10409     unsigned int xcb_block_len = 0;
   10410     unsigned int xcb_pad = 0;
   10411     unsigned int xcb_align_to = 0;
   10412     unsigned int xcb_padding_offset = 0;
   10413 
   10414 
   10415     if((reported & XCB_XKB_GBN_DETAIL_TYPES) ||
   10416        (reported & XCB_XKB_GBN_DETAIL_CLIENT_SYMBOLS) ||
   10417        (reported & XCB_XKB_GBN_DETAIL_SERVER_SYMBOLS)) {
   10418         /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_type */
   10419         _aux->types.getmap_type = *(uint8_t *)xcb_tmp;
   10420         xcb_block_len += sizeof(uint8_t);
   10421         xcb_tmp += sizeof(uint8_t);
   10422         xcb_align_to = ALIGNOF(uint8_t);
   10423         /* xcb_xkb_get_kbd_by_name_replies_t.types.typeDeviceID */
   10424         _aux->types.typeDeviceID = *(uint8_t *)xcb_tmp;
   10425         xcb_block_len += sizeof(uint8_t);
   10426         xcb_tmp += sizeof(uint8_t);
   10427         xcb_align_to = ALIGNOF(uint8_t);
   10428         /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_sequence */
   10429         _aux->types.getmap_sequence = *(uint16_t *)xcb_tmp;
   10430         xcb_block_len += sizeof(uint16_t);
   10431         xcb_tmp += sizeof(uint16_t);
   10432         xcb_align_to = ALIGNOF(uint16_t);
   10433         /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_length */
   10434         _aux->types.getmap_length = *(uint32_t *)xcb_tmp;
   10435         xcb_block_len += sizeof(uint32_t);
   10436         xcb_tmp += sizeof(uint32_t);
   10437         xcb_align_to = ALIGNOF(uint32_t);
   10438         /* xcb_xkb_get_kbd_by_name_replies_t.types.pad1 */
   10439         _aux->types.pad1[0] = *(uint8_t *)xcb_tmp;
   10440         _aux->types.pad1[1] = *(uint8_t *)xcb_tmp;
   10441         xcb_block_len += sizeof(uint8_t) * 2;
   10442         xcb_tmp += sizeof(uint8_t) * 2;
   10443         xcb_align_to = ALIGNOF(uint8_t);
   10444         /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMinKeyCode */
   10445         _aux->types.typeMinKeyCode = *(xcb_keycode_t *)xcb_tmp;
   10446         xcb_block_len += sizeof(xcb_keycode_t);
   10447         xcb_tmp += sizeof(xcb_keycode_t);
   10448         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10449         /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMaxKeyCode */
   10450         _aux->types.typeMaxKeyCode = *(xcb_keycode_t *)xcb_tmp;
   10451         xcb_block_len += sizeof(xcb_keycode_t);
   10452         xcb_tmp += sizeof(xcb_keycode_t);
   10453         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10454         /* xcb_xkb_get_kbd_by_name_replies_t.types.present */
   10455         _aux->types.present = *(uint16_t *)xcb_tmp;
   10456         xcb_block_len += sizeof(uint16_t);
   10457         xcb_tmp += sizeof(uint16_t);
   10458         xcb_align_to = ALIGNOF(uint16_t);
   10459         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstType */
   10460         _aux->types.firstType = *(uint8_t *)xcb_tmp;
   10461         xcb_block_len += sizeof(uint8_t);
   10462         xcb_tmp += sizeof(uint8_t);
   10463         xcb_align_to = ALIGNOF(uint8_t);
   10464         /* xcb_xkb_get_kbd_by_name_replies_t.types.nTypes */
   10465         _aux->types.nTypes = *(uint8_t *)xcb_tmp;
   10466         xcb_block_len += sizeof(uint8_t);
   10467         xcb_tmp += sizeof(uint8_t);
   10468         xcb_align_to = ALIGNOF(uint8_t);
   10469         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalTypes */
   10470         _aux->types.totalTypes = *(uint8_t *)xcb_tmp;
   10471         xcb_block_len += sizeof(uint8_t);
   10472         xcb_tmp += sizeof(uint8_t);
   10473         xcb_align_to = ALIGNOF(uint8_t);
   10474         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeySym */
   10475         _aux->types.firstKeySym = *(xcb_keycode_t *)xcb_tmp;
   10476         xcb_block_len += sizeof(xcb_keycode_t);
   10477         xcb_tmp += sizeof(xcb_keycode_t);
   10478         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10479         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalSyms */
   10480         _aux->types.totalSyms = *(uint16_t *)xcb_tmp;
   10481         xcb_block_len += sizeof(uint16_t);
   10482         xcb_tmp += sizeof(uint16_t);
   10483         xcb_align_to = ALIGNOF(uint16_t);
   10484         /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeySyms */
   10485         _aux->types.nKeySyms = *(uint8_t *)xcb_tmp;
   10486         xcb_block_len += sizeof(uint8_t);
   10487         xcb_tmp += sizeof(uint8_t);
   10488         xcb_align_to = ALIGNOF(uint8_t);
   10489         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyAction */
   10490         _aux->types.firstKeyAction = *(xcb_keycode_t *)xcb_tmp;
   10491         xcb_block_len += sizeof(xcb_keycode_t);
   10492         xcb_tmp += sizeof(xcb_keycode_t);
   10493         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10494         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalActions */
   10495         _aux->types.totalActions = *(uint16_t *)xcb_tmp;
   10496         xcb_block_len += sizeof(uint16_t);
   10497         xcb_tmp += sizeof(uint16_t);
   10498         xcb_align_to = ALIGNOF(uint16_t);
   10499         /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyActions */
   10500         _aux->types.nKeyActions = *(uint8_t *)xcb_tmp;
   10501         xcb_block_len += sizeof(uint8_t);
   10502         xcb_tmp += sizeof(uint8_t);
   10503         xcb_align_to = ALIGNOF(uint8_t);
   10504         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyBehavior */
   10505         _aux->types.firstKeyBehavior = *(xcb_keycode_t *)xcb_tmp;
   10506         xcb_block_len += sizeof(xcb_keycode_t);
   10507         xcb_tmp += sizeof(xcb_keycode_t);
   10508         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10509         /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyBehaviors */
   10510         _aux->types.nKeyBehaviors = *(uint8_t *)xcb_tmp;
   10511         xcb_block_len += sizeof(uint8_t);
   10512         xcb_tmp += sizeof(uint8_t);
   10513         xcb_align_to = ALIGNOF(uint8_t);
   10514         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyBehaviors */
   10515         _aux->types.totalKeyBehaviors = *(uint8_t *)xcb_tmp;
   10516         xcb_block_len += sizeof(uint8_t);
   10517         xcb_tmp += sizeof(uint8_t);
   10518         xcb_align_to = ALIGNOF(uint8_t);
   10519         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyExplicit */
   10520         _aux->types.firstKeyExplicit = *(xcb_keycode_t *)xcb_tmp;
   10521         xcb_block_len += sizeof(xcb_keycode_t);
   10522         xcb_tmp += sizeof(xcb_keycode_t);
   10523         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10524         /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyExplicit */
   10525         _aux->types.nKeyExplicit = *(uint8_t *)xcb_tmp;
   10526         xcb_block_len += sizeof(uint8_t);
   10527         xcb_tmp += sizeof(uint8_t);
   10528         xcb_align_to = ALIGNOF(uint8_t);
   10529         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyExplicit */
   10530         _aux->types.totalKeyExplicit = *(uint8_t *)xcb_tmp;
   10531         xcb_block_len += sizeof(uint8_t);
   10532         xcb_tmp += sizeof(uint8_t);
   10533         xcb_align_to = ALIGNOF(uint8_t);
   10534         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstModMapKey */
   10535         _aux->types.firstModMapKey = *(xcb_keycode_t *)xcb_tmp;
   10536         xcb_block_len += sizeof(xcb_keycode_t);
   10537         xcb_tmp += sizeof(xcb_keycode_t);
   10538         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10539         /* xcb_xkb_get_kbd_by_name_replies_t.types.nModMapKeys */
   10540         _aux->types.nModMapKeys = *(uint8_t *)xcb_tmp;
   10541         xcb_block_len += sizeof(uint8_t);
   10542         xcb_tmp += sizeof(uint8_t);
   10543         xcb_align_to = ALIGNOF(uint8_t);
   10544         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalModMapKeys */
   10545         _aux->types.totalModMapKeys = *(uint8_t *)xcb_tmp;
   10546         xcb_block_len += sizeof(uint8_t);
   10547         xcb_tmp += sizeof(uint8_t);
   10548         xcb_align_to = ALIGNOF(uint8_t);
   10549         /* xcb_xkb_get_kbd_by_name_replies_t.types.firstVModMapKey */
   10550         _aux->types.firstVModMapKey = *(xcb_keycode_t *)xcb_tmp;
   10551         xcb_block_len += sizeof(xcb_keycode_t);
   10552         xcb_tmp += sizeof(xcb_keycode_t);
   10553         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10554         /* xcb_xkb_get_kbd_by_name_replies_t.types.nVModMapKeys */
   10555         _aux->types.nVModMapKeys = *(uint8_t *)xcb_tmp;
   10556         xcb_block_len += sizeof(uint8_t);
   10557         xcb_tmp += sizeof(uint8_t);
   10558         xcb_align_to = ALIGNOF(uint8_t);
   10559         /* xcb_xkb_get_kbd_by_name_replies_t.types.totalVModMapKeys */
   10560         _aux->types.totalVModMapKeys = *(uint8_t *)xcb_tmp;
   10561         xcb_block_len += sizeof(uint8_t);
   10562         xcb_tmp += sizeof(uint8_t);
   10563         xcb_align_to = ALIGNOF(uint8_t);
   10564         /* xcb_xkb_get_kbd_by_name_replies_t.types.pad2 */
   10565         _aux->types.pad2 = *(uint8_t *)xcb_tmp;
   10566         xcb_block_len += sizeof(uint8_t);
   10567         xcb_tmp += sizeof(uint8_t);
   10568         xcb_align_to = ALIGNOF(uint8_t);
   10569         /* xcb_xkb_get_kbd_by_name_replies_t.types.virtualMods */
   10570         _aux->types.virtualMods = *(uint16_t *)xcb_tmp;
   10571         xcb_block_len += sizeof(uint16_t);
   10572         xcb_tmp += sizeof(uint16_t);
   10573         xcb_align_to = ALIGNOF(uint16_t);
   10574         /* insert padding */
   10575         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10576         xcb_buffer_len += xcb_block_len + xcb_pad;
   10577         if (0 != xcb_pad) {
   10578             xcb_tmp += xcb_pad;
   10579             xcb_pad = 0;
   10580         }
   10581         xcb_block_len = 0;
   10582         xcb_padding_offset = 0;
   10583         /* map */
   10584         xcb_block_len += xcb_xkb_get_kbd_by_name_replies_types_map_unpack(xcb_tmp, _aux->types.nTypes, _aux->types.nKeySyms, _aux->types.nKeyActions, _aux->types.totalActions, _aux->types.totalKeyBehaviors, _aux->types.virtualMods, _aux->types.totalKeyExplicit, _aux->types.totalModMapKeys, _aux->types.totalVModMapKeys, _aux->types.present, &_aux->types.map);
   10585         xcb_tmp += xcb_block_len;
   10586         xcb_align_to = ALIGNOF(char);
   10587     }
   10588     if(reported & XCB_XKB_GBN_DETAIL_COMPAT_MAP) {
   10589         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_type */
   10590         _aux->compat_map.compatmap_type = *(uint8_t *)xcb_tmp;
   10591         xcb_block_len += sizeof(uint8_t);
   10592         xcb_tmp += sizeof(uint8_t);
   10593         xcb_align_to = ALIGNOF(uint8_t);
   10594         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatDeviceID */
   10595         _aux->compat_map.compatDeviceID = *(uint8_t *)xcb_tmp;
   10596         xcb_block_len += sizeof(uint8_t);
   10597         xcb_tmp += sizeof(uint8_t);
   10598         xcb_align_to = ALIGNOF(uint8_t);
   10599         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_sequence */
   10600         _aux->compat_map.compatmap_sequence = *(uint16_t *)xcb_tmp;
   10601         xcb_block_len += sizeof(uint16_t);
   10602         xcb_tmp += sizeof(uint16_t);
   10603         xcb_align_to = ALIGNOF(uint16_t);
   10604         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_length */
   10605         _aux->compat_map.compatmap_length = *(uint32_t *)xcb_tmp;
   10606         xcb_block_len += sizeof(uint32_t);
   10607         xcb_tmp += sizeof(uint32_t);
   10608         xcb_align_to = ALIGNOF(uint32_t);
   10609         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.groupsRtrn */
   10610         _aux->compat_map.groupsRtrn = *(uint8_t *)xcb_tmp;
   10611         xcb_block_len += sizeof(uint8_t);
   10612         xcb_tmp += sizeof(uint8_t);
   10613         xcb_align_to = ALIGNOF(uint8_t);
   10614         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad7 */
   10615         _aux->compat_map.pad7 = *(uint8_t *)xcb_tmp;
   10616         xcb_block_len += sizeof(uint8_t);
   10617         xcb_tmp += sizeof(uint8_t);
   10618         xcb_align_to = ALIGNOF(uint8_t);
   10619         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.firstSIRtrn */
   10620         _aux->compat_map.firstSIRtrn = *(uint16_t *)xcb_tmp;
   10621         xcb_block_len += sizeof(uint16_t);
   10622         xcb_tmp += sizeof(uint16_t);
   10623         xcb_align_to = ALIGNOF(uint16_t);
   10624         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nSIRtrn */
   10625         _aux->compat_map.nSIRtrn = *(uint16_t *)xcb_tmp;
   10626         xcb_block_len += sizeof(uint16_t);
   10627         xcb_tmp += sizeof(uint16_t);
   10628         xcb_align_to = ALIGNOF(uint16_t);
   10629         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nTotalSI */
   10630         _aux->compat_map.nTotalSI = *(uint16_t *)xcb_tmp;
   10631         xcb_block_len += sizeof(uint16_t);
   10632         xcb_tmp += sizeof(uint16_t);
   10633         xcb_align_to = ALIGNOF(uint16_t);
   10634         /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad8 */
   10635         _aux->compat_map.pad8[0] = *(uint8_t *)xcb_tmp;
   10636         _aux->compat_map.pad8[1] = *(uint8_t *)xcb_tmp;
   10637         _aux->compat_map.pad8[2] = *(uint8_t *)xcb_tmp;
   10638         _aux->compat_map.pad8[3] = *(uint8_t *)xcb_tmp;
   10639         _aux->compat_map.pad8[4] = *(uint8_t *)xcb_tmp;
   10640         _aux->compat_map.pad8[5] = *(uint8_t *)xcb_tmp;
   10641         _aux->compat_map.pad8[6] = *(uint8_t *)xcb_tmp;
   10642         _aux->compat_map.pad8[7] = *(uint8_t *)xcb_tmp;
   10643         _aux->compat_map.pad8[8] = *(uint8_t *)xcb_tmp;
   10644         _aux->compat_map.pad8[9] = *(uint8_t *)xcb_tmp;
   10645         _aux->compat_map.pad8[10] = *(uint8_t *)xcb_tmp;
   10646         _aux->compat_map.pad8[11] = *(uint8_t *)xcb_tmp;
   10647         _aux->compat_map.pad8[12] = *(uint8_t *)xcb_tmp;
   10648         _aux->compat_map.pad8[13] = *(uint8_t *)xcb_tmp;
   10649         _aux->compat_map.pad8[14] = *(uint8_t *)xcb_tmp;
   10650         _aux->compat_map.pad8[15] = *(uint8_t *)xcb_tmp;
   10651         xcb_block_len += sizeof(uint8_t) * 16;
   10652         xcb_tmp += sizeof(uint8_t) * 16;
   10653         xcb_align_to = ALIGNOF(uint8_t);
   10654         /* insert padding */
   10655         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10656         xcb_buffer_len += xcb_block_len + xcb_pad;
   10657         if (0 != xcb_pad) {
   10658             xcb_tmp += xcb_pad;
   10659             xcb_pad = 0;
   10660         }
   10661         xcb_block_len = 0;
   10662         xcb_padding_offset = 0;
   10663         /* si_rtrn */
   10664         _aux->compat_map.si_rtrn = (xcb_xkb_sym_interpret_t *)xcb_tmp;
   10665         xcb_block_len += _aux->compat_map.nSIRtrn * sizeof(xcb_xkb_sym_interpret_t);
   10666         xcb_tmp += xcb_block_len;
   10667         xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t);
   10668         /* insert padding */
   10669         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10670         xcb_buffer_len += xcb_block_len + xcb_pad;
   10671         if (0 != xcb_pad) {
   10672             xcb_tmp += xcb_pad;
   10673             xcb_pad = 0;
   10674         }
   10675         xcb_block_len = 0;
   10676         xcb_padding_offset = 0;
   10677         /* group_rtrn */
   10678         _aux->compat_map.group_rtrn = (xcb_xkb_mod_def_t *)xcb_tmp;
   10679         xcb_block_len += xcb_popcount(_aux->compat_map.groupsRtrn) * sizeof(xcb_xkb_mod_def_t);
   10680         xcb_tmp += xcb_block_len;
   10681         xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t);
   10682     }
   10683     if(reported & XCB_XKB_GBN_DETAIL_INDICATOR_MAPS) {
   10684         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_type */
   10685         _aux->indicator_maps.indicatormap_type = *(uint8_t *)xcb_tmp;
   10686         xcb_block_len += sizeof(uint8_t);
   10687         xcb_tmp += sizeof(uint8_t);
   10688         xcb_align_to = ALIGNOF(uint8_t);
   10689         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatorDeviceID */
   10690         _aux->indicator_maps.indicatorDeviceID = *(uint8_t *)xcb_tmp;
   10691         xcb_block_len += sizeof(uint8_t);
   10692         xcb_tmp += sizeof(uint8_t);
   10693         xcb_align_to = ALIGNOF(uint8_t);
   10694         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_sequence */
   10695         _aux->indicator_maps.indicatormap_sequence = *(uint16_t *)xcb_tmp;
   10696         xcb_block_len += sizeof(uint16_t);
   10697         xcb_tmp += sizeof(uint16_t);
   10698         xcb_align_to = ALIGNOF(uint16_t);
   10699         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_length */
   10700         _aux->indicator_maps.indicatormap_length = *(uint32_t *)xcb_tmp;
   10701         xcb_block_len += sizeof(uint32_t);
   10702         xcb_tmp += sizeof(uint32_t);
   10703         xcb_align_to = ALIGNOF(uint32_t);
   10704         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.which */
   10705         _aux->indicator_maps.which = *(uint32_t *)xcb_tmp;
   10706         xcb_block_len += sizeof(uint32_t);
   10707         xcb_tmp += sizeof(uint32_t);
   10708         xcb_align_to = ALIGNOF(uint32_t);
   10709         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.realIndicators */
   10710         _aux->indicator_maps.realIndicators = *(uint32_t *)xcb_tmp;
   10711         xcb_block_len += sizeof(uint32_t);
   10712         xcb_tmp += sizeof(uint32_t);
   10713         xcb_align_to = ALIGNOF(uint32_t);
   10714         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.nIndicators */
   10715         _aux->indicator_maps.nIndicators = *(uint8_t *)xcb_tmp;
   10716         xcb_block_len += sizeof(uint8_t);
   10717         xcb_tmp += sizeof(uint8_t);
   10718         xcb_align_to = ALIGNOF(uint8_t);
   10719         /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.pad9 */
   10720         _aux->indicator_maps.pad9[0] = *(uint8_t *)xcb_tmp;
   10721         _aux->indicator_maps.pad9[1] = *(uint8_t *)xcb_tmp;
   10722         _aux->indicator_maps.pad9[2] = *(uint8_t *)xcb_tmp;
   10723         _aux->indicator_maps.pad9[3] = *(uint8_t *)xcb_tmp;
   10724         _aux->indicator_maps.pad9[4] = *(uint8_t *)xcb_tmp;
   10725         _aux->indicator_maps.pad9[5] = *(uint8_t *)xcb_tmp;
   10726         _aux->indicator_maps.pad9[6] = *(uint8_t *)xcb_tmp;
   10727         _aux->indicator_maps.pad9[7] = *(uint8_t *)xcb_tmp;
   10728         _aux->indicator_maps.pad9[8] = *(uint8_t *)xcb_tmp;
   10729         _aux->indicator_maps.pad9[9] = *(uint8_t *)xcb_tmp;
   10730         _aux->indicator_maps.pad9[10] = *(uint8_t *)xcb_tmp;
   10731         _aux->indicator_maps.pad9[11] = *(uint8_t *)xcb_tmp;
   10732         _aux->indicator_maps.pad9[12] = *(uint8_t *)xcb_tmp;
   10733         _aux->indicator_maps.pad9[13] = *(uint8_t *)xcb_tmp;
   10734         _aux->indicator_maps.pad9[14] = *(uint8_t *)xcb_tmp;
   10735         xcb_block_len += sizeof(uint8_t) * 15;
   10736         xcb_tmp += sizeof(uint8_t) * 15;
   10737         xcb_align_to = ALIGNOF(uint8_t);
   10738         /* insert padding */
   10739         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10740         xcb_buffer_len += xcb_block_len + xcb_pad;
   10741         if (0 != xcb_pad) {
   10742             xcb_tmp += xcb_pad;
   10743             xcb_pad = 0;
   10744         }
   10745         xcb_block_len = 0;
   10746         xcb_padding_offset = 0;
   10747         /* maps */
   10748         _aux->indicator_maps.maps = (xcb_xkb_indicator_map_t *)xcb_tmp;
   10749         xcb_block_len += _aux->indicator_maps.nIndicators * sizeof(xcb_xkb_indicator_map_t);
   10750         xcb_tmp += xcb_block_len;
   10751         xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
   10752     }
   10753     if((reported & XCB_XKB_GBN_DETAIL_KEY_NAMES) ||
   10754        (reported & XCB_XKB_GBN_DETAIL_OTHER_NAMES)) {
   10755         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_type */
   10756         _aux->key_names.keyname_type = *(uint8_t *)xcb_tmp;
   10757         xcb_block_len += sizeof(uint8_t);
   10758         xcb_tmp += sizeof(uint8_t);
   10759         xcb_align_to = ALIGNOF(uint8_t);
   10760         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyDeviceID */
   10761         _aux->key_names.keyDeviceID = *(uint8_t *)xcb_tmp;
   10762         xcb_block_len += sizeof(uint8_t);
   10763         xcb_tmp += sizeof(uint8_t);
   10764         xcb_align_to = ALIGNOF(uint8_t);
   10765         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_sequence */
   10766         _aux->key_names.keyname_sequence = *(uint16_t *)xcb_tmp;
   10767         xcb_block_len += sizeof(uint16_t);
   10768         xcb_tmp += sizeof(uint16_t);
   10769         xcb_align_to = ALIGNOF(uint16_t);
   10770         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_length */
   10771         _aux->key_names.keyname_length = *(uint32_t *)xcb_tmp;
   10772         xcb_block_len += sizeof(uint32_t);
   10773         xcb_tmp += sizeof(uint32_t);
   10774         xcb_align_to = ALIGNOF(uint32_t);
   10775         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.which */
   10776         _aux->key_names.which = *(uint32_t *)xcb_tmp;
   10777         xcb_block_len += sizeof(uint32_t);
   10778         xcb_tmp += sizeof(uint32_t);
   10779         xcb_align_to = ALIGNOF(uint32_t);
   10780         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMinKeyCode */
   10781         _aux->key_names.keyMinKeyCode = *(xcb_keycode_t *)xcb_tmp;
   10782         xcb_block_len += sizeof(xcb_keycode_t);
   10783         xcb_tmp += sizeof(xcb_keycode_t);
   10784         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10785         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMaxKeyCode */
   10786         _aux->key_names.keyMaxKeyCode = *(xcb_keycode_t *)xcb_tmp;
   10787         xcb_block_len += sizeof(xcb_keycode_t);
   10788         xcb_tmp += sizeof(xcb_keycode_t);
   10789         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10790         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nTypes */
   10791         _aux->key_names.nTypes = *(uint8_t *)xcb_tmp;
   10792         xcb_block_len += sizeof(uint8_t);
   10793         xcb_tmp += sizeof(uint8_t);
   10794         xcb_align_to = ALIGNOF(uint8_t);
   10795         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.groupNames */
   10796         _aux->key_names.groupNames = *(uint8_t *)xcb_tmp;
   10797         xcb_block_len += sizeof(uint8_t);
   10798         xcb_tmp += sizeof(uint8_t);
   10799         xcb_align_to = ALIGNOF(uint8_t);
   10800         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.virtualMods */
   10801         _aux->key_names.virtualMods = *(uint16_t *)xcb_tmp;
   10802         xcb_block_len += sizeof(uint16_t);
   10803         xcb_tmp += sizeof(uint16_t);
   10804         xcb_align_to = ALIGNOF(uint16_t);
   10805         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.firstKey */
   10806         _aux->key_names.firstKey = *(xcb_keycode_t *)xcb_tmp;
   10807         xcb_block_len += sizeof(xcb_keycode_t);
   10808         xcb_tmp += sizeof(xcb_keycode_t);
   10809         xcb_align_to = ALIGNOF(xcb_keycode_t);
   10810         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeys */
   10811         _aux->key_names.nKeys = *(uint8_t *)xcb_tmp;
   10812         xcb_block_len += sizeof(uint8_t);
   10813         xcb_tmp += sizeof(uint8_t);
   10814         xcb_align_to = ALIGNOF(uint8_t);
   10815         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.indicators */
   10816         _aux->key_names.indicators = *(uint32_t *)xcb_tmp;
   10817         xcb_block_len += sizeof(uint32_t);
   10818         xcb_tmp += sizeof(uint32_t);
   10819         xcb_align_to = ALIGNOF(uint32_t);
   10820         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nRadioGroups */
   10821         _aux->key_names.nRadioGroups = *(uint8_t *)xcb_tmp;
   10822         xcb_block_len += sizeof(uint8_t);
   10823         xcb_tmp += sizeof(uint8_t);
   10824         xcb_align_to = ALIGNOF(uint8_t);
   10825         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeyAliases */
   10826         _aux->key_names.nKeyAliases = *(uint8_t *)xcb_tmp;
   10827         xcb_block_len += sizeof(uint8_t);
   10828         xcb_tmp += sizeof(uint8_t);
   10829         xcb_align_to = ALIGNOF(uint8_t);
   10830         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKTLevels */
   10831         _aux->key_names.nKTLevels = *(uint16_t *)xcb_tmp;
   10832         xcb_block_len += sizeof(uint16_t);
   10833         xcb_tmp += sizeof(uint16_t);
   10834         xcb_align_to = ALIGNOF(uint16_t);
   10835         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.pad10 */
   10836         _aux->key_names.pad10[0] = *(uint8_t *)xcb_tmp;
   10837         _aux->key_names.pad10[1] = *(uint8_t *)xcb_tmp;
   10838         _aux->key_names.pad10[2] = *(uint8_t *)xcb_tmp;
   10839         _aux->key_names.pad10[3] = *(uint8_t *)xcb_tmp;
   10840         xcb_block_len += sizeof(uint8_t) * 4;
   10841         xcb_tmp += sizeof(uint8_t) * 4;
   10842         xcb_align_to = ALIGNOF(uint8_t);
   10843         /* insert padding */
   10844         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10845         xcb_buffer_len += xcb_block_len + xcb_pad;
   10846         if (0 != xcb_pad) {
   10847             xcb_tmp += xcb_pad;
   10848             xcb_pad = 0;
   10849         }
   10850         xcb_block_len = 0;
   10851         xcb_padding_offset = 0;
   10852         /* valueList */
   10853         xcb_block_len += xcb_xkb_get_kbd_by_name_replies_key_names_value_list_unpack(xcb_tmp, _aux->key_names.nTypes, _aux->key_names.indicators, _aux->key_names.virtualMods, _aux->key_names.groupNames, _aux->key_names.nKeys, _aux->key_names.nKeyAliases, _aux->key_names.nRadioGroups, _aux->key_names.which, &_aux->key_names.valueList);
   10854         xcb_tmp += xcb_block_len;
   10855         xcb_align_to = ALIGNOF(char);
   10856     }
   10857     if(reported & XCB_XKB_GBN_DETAIL_GEOMETRY) {
   10858         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_type */
   10859         _aux->geometry.geometry_type = *(uint8_t *)xcb_tmp;
   10860         xcb_block_len += sizeof(uint8_t);
   10861         xcb_tmp += sizeof(uint8_t);
   10862         xcb_align_to = ALIGNOF(uint8_t);
   10863         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryDeviceID */
   10864         _aux->geometry.geometryDeviceID = *(uint8_t *)xcb_tmp;
   10865         xcb_block_len += sizeof(uint8_t);
   10866         xcb_tmp += sizeof(uint8_t);
   10867         xcb_align_to = ALIGNOF(uint8_t);
   10868         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_sequence */
   10869         _aux->geometry.geometry_sequence = *(uint16_t *)xcb_tmp;
   10870         xcb_block_len += sizeof(uint16_t);
   10871         xcb_tmp += sizeof(uint16_t);
   10872         xcb_align_to = ALIGNOF(uint16_t);
   10873         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_length */
   10874         _aux->geometry.geometry_length = *(uint32_t *)xcb_tmp;
   10875         xcb_block_len += sizeof(uint32_t);
   10876         xcb_tmp += sizeof(uint32_t);
   10877         xcb_align_to = ALIGNOF(uint32_t);
   10878         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.name */
   10879         _aux->geometry.name = *(xcb_atom_t *)xcb_tmp;
   10880         xcb_block_len += sizeof(xcb_atom_t);
   10881         xcb_tmp += sizeof(xcb_atom_t);
   10882         xcb_align_to = ALIGNOF(xcb_atom_t);
   10883         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryFound */
   10884         _aux->geometry.geometryFound = *(uint8_t *)xcb_tmp;
   10885         xcb_block_len += sizeof(uint8_t);
   10886         xcb_tmp += sizeof(uint8_t);
   10887         xcb_align_to = ALIGNOF(uint8_t);
   10888         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.pad12 */
   10889         _aux->geometry.pad12 = *(uint8_t *)xcb_tmp;
   10890         xcb_block_len += sizeof(uint8_t);
   10891         xcb_tmp += sizeof(uint8_t);
   10892         xcb_align_to = ALIGNOF(uint8_t);
   10893         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.widthMM */
   10894         _aux->geometry.widthMM = *(uint16_t *)xcb_tmp;
   10895         xcb_block_len += sizeof(uint16_t);
   10896         xcb_tmp += sizeof(uint16_t);
   10897         xcb_align_to = ALIGNOF(uint16_t);
   10898         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.heightMM */
   10899         _aux->geometry.heightMM = *(uint16_t *)xcb_tmp;
   10900         xcb_block_len += sizeof(uint16_t);
   10901         xcb_tmp += sizeof(uint16_t);
   10902         xcb_align_to = ALIGNOF(uint16_t);
   10903         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nProperties */
   10904         _aux->geometry.nProperties = *(uint16_t *)xcb_tmp;
   10905         xcb_block_len += sizeof(uint16_t);
   10906         xcb_tmp += sizeof(uint16_t);
   10907         xcb_align_to = ALIGNOF(uint16_t);
   10908         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nColors */
   10909         _aux->geometry.nColors = *(uint16_t *)xcb_tmp;
   10910         xcb_block_len += sizeof(uint16_t);
   10911         xcb_tmp += sizeof(uint16_t);
   10912         xcb_align_to = ALIGNOF(uint16_t);
   10913         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nShapes */
   10914         _aux->geometry.nShapes = *(uint16_t *)xcb_tmp;
   10915         xcb_block_len += sizeof(uint16_t);
   10916         xcb_tmp += sizeof(uint16_t);
   10917         xcb_align_to = ALIGNOF(uint16_t);
   10918         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nSections */
   10919         _aux->geometry.nSections = *(uint16_t *)xcb_tmp;
   10920         xcb_block_len += sizeof(uint16_t);
   10921         xcb_tmp += sizeof(uint16_t);
   10922         xcb_align_to = ALIGNOF(uint16_t);
   10923         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nDoodads */
   10924         _aux->geometry.nDoodads = *(uint16_t *)xcb_tmp;
   10925         xcb_block_len += sizeof(uint16_t);
   10926         xcb_tmp += sizeof(uint16_t);
   10927         xcb_align_to = ALIGNOF(uint16_t);
   10928         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nKeyAliases */
   10929         _aux->geometry.nKeyAliases = *(uint16_t *)xcb_tmp;
   10930         xcb_block_len += sizeof(uint16_t);
   10931         xcb_tmp += sizeof(uint16_t);
   10932         xcb_align_to = ALIGNOF(uint16_t);
   10933         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.baseColorNdx */
   10934         _aux->geometry.baseColorNdx = *(uint8_t *)xcb_tmp;
   10935         xcb_block_len += sizeof(uint8_t);
   10936         xcb_tmp += sizeof(uint8_t);
   10937         xcb_align_to = ALIGNOF(uint8_t);
   10938         /* xcb_xkb_get_kbd_by_name_replies_t.geometry.labelColorNdx */
   10939         _aux->geometry.labelColorNdx = *(uint8_t *)xcb_tmp;
   10940         xcb_block_len += sizeof(uint8_t);
   10941         xcb_tmp += sizeof(uint8_t);
   10942         xcb_align_to = ALIGNOF(uint8_t);
   10943         /* insert padding */
   10944         xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10945         xcb_buffer_len += xcb_block_len + xcb_pad;
   10946         if (0 != xcb_pad) {
   10947             xcb_tmp += xcb_pad;
   10948             xcb_pad = 0;
   10949         }
   10950         xcb_block_len = 0;
   10951         xcb_padding_offset = 0;
   10952         /* labelFont */
   10953         _aux->geometry.labelFont = (xcb_xkb_counted_string_16_t *)xcb_tmp;
   10954         xcb_block_len += xcb_xkb_counted_string_16_sizeof(xcb_tmp);
   10955         xcb_tmp += xcb_block_len;
   10956         xcb_align_to = ALIGNOF(xcb_xkb_counted_string_16_t);
   10957     }
   10958     /* insert padding */
   10959     xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);
   10960     xcb_buffer_len += xcb_block_len + xcb_pad;
   10961     if (0 != xcb_pad) {
   10962         xcb_tmp += xcb_pad;
   10963         xcb_pad = 0;
   10964     }
   10965     xcb_block_len = 0;
   10966     xcb_padding_offset = 0;
   10967 
   10968     return xcb_buffer_len;
   10969 }
   10970 
   10971 int
   10972 xcb_xkb_get_kbd_by_name_replies_sizeof (const void  *_buffer,
   10973                                         uint16_t     reported)
   10974 {
   10975     xcb_xkb_get_kbd_by_name_replies_t _aux;
   10976     return xcb_xkb_get_kbd_by_name_replies_unpack(_buffer, reported, &_aux);
   10977 }
   10978 
   10979 int
   10980 xcb_xkb_get_kbd_by_name_sizeof (const void  *_buffer)
   10981 {
   10982     char *xcb_tmp = (char *)_buffer;
   10983     const xcb_xkb_get_kbd_by_name_reply_t *_aux = (xcb_xkb_get_kbd_by_name_reply_t *)_buffer;
   10984     unsigned int xcb_buffer_len = 0;
   10985     unsigned int xcb_block_len = 0;
   10986     unsigned int xcb_pad = 0;
   10987     unsigned int xcb_align_to = 0;
   10988 
   10989 
   10990     xcb_block_len += sizeof(xcb_xkb_get_kbd_by_name_reply_t);
   10991     xcb_tmp += xcb_block_len;
   10992     xcb_buffer_len += xcb_block_len;
   10993     xcb_block_len = 0;
   10994     /* replies */
   10995     xcb_block_len += xcb_xkb_get_kbd_by_name_replies_sizeof(xcb_tmp, _aux->reported);
   10996     xcb_tmp += xcb_block_len;
   10997     xcb_align_to = ALIGNOF(char);
   10998     /* insert padding */
   10999     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   11000     xcb_buffer_len += xcb_block_len + xcb_pad;
   11001     if (0 != xcb_pad) {
   11002         xcb_tmp += xcb_pad;
   11003         xcb_pad = 0;
   11004     }
   11005     xcb_block_len = 0;
   11006 
   11007     return xcb_buffer_len;
   11008 }
   11009 
   11010 xcb_xkb_get_kbd_by_name_cookie_t
   11011 xcb_xkb_get_kbd_by_name (xcb_connection_t      *c,
   11012                          xcb_xkb_device_spec_t  deviceSpec,
   11013                          uint16_t               need,
   11014                          uint16_t               want,
   11015                          uint8_t                load)
   11016 {
   11017     static const xcb_protocol_request_t xcb_req = {
   11018         .count = 2,
   11019         .ext = &xcb_xkb_id,
   11020         .opcode = XCB_XKB_GET_KBD_BY_NAME,
   11021         .isvoid = 0
   11022     };
   11023 
   11024     struct iovec xcb_parts[4];
   11025     xcb_xkb_get_kbd_by_name_cookie_t xcb_ret;
   11026     xcb_xkb_get_kbd_by_name_request_t xcb_out;
   11027 
   11028     xcb_out.deviceSpec = deviceSpec;
   11029     xcb_out.need = need;
   11030     xcb_out.want = want;
   11031     xcb_out.load = load;
   11032     xcb_out.pad0 = 0;
   11033 
   11034     xcb_parts[2].iov_base = (char *) &xcb_out;
   11035     xcb_parts[2].iov_len = sizeof(xcb_out);
   11036     xcb_parts[3].iov_base = 0;
   11037     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   11038 
   11039     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   11040     return xcb_ret;
   11041 }
   11042 
   11043 xcb_xkb_get_kbd_by_name_cookie_t
   11044 xcb_xkb_get_kbd_by_name_unchecked (xcb_connection_t      *c,
   11045                                    xcb_xkb_device_spec_t  deviceSpec,
   11046                                    uint16_t               need,
   11047                                    uint16_t               want,
   11048                                    uint8_t                load)
   11049 {
   11050     static const xcb_protocol_request_t xcb_req = {
   11051         .count = 2,
   11052         .ext = &xcb_xkb_id,
   11053         .opcode = XCB_XKB_GET_KBD_BY_NAME,
   11054         .isvoid = 0
   11055     };
   11056 
   11057     struct iovec xcb_parts[4];
   11058     xcb_xkb_get_kbd_by_name_cookie_t xcb_ret;
   11059     xcb_xkb_get_kbd_by_name_request_t xcb_out;
   11060 
   11061     xcb_out.deviceSpec = deviceSpec;
   11062     xcb_out.need = need;
   11063     xcb_out.want = want;
   11064     xcb_out.load = load;
   11065     xcb_out.pad0 = 0;
   11066 
   11067     xcb_parts[2].iov_base = (char *) &xcb_out;
   11068     xcb_parts[2].iov_len = sizeof(xcb_out);
   11069     xcb_parts[3].iov_base = 0;
   11070     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   11071 
   11072     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   11073     return xcb_ret;
   11074 }
   11075 
   11076 void *
   11077 xcb_xkb_get_kbd_by_name_replies (const xcb_xkb_get_kbd_by_name_reply_t *R)
   11078 {
   11079     return (void *) (R + 1);
   11080 }
   11081 
   11082 xcb_xkb_get_kbd_by_name_reply_t *
   11083 xcb_xkb_get_kbd_by_name_reply (xcb_connection_t                  *c,
   11084                                xcb_xkb_get_kbd_by_name_cookie_t   cookie  /**< */,
   11085                                xcb_generic_error_t              **e)
   11086 {
   11087     return (xcb_xkb_get_kbd_by_name_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   11088 }
   11089 
   11090 int
   11091 xcb_xkb_get_device_info_sizeof (const void  *_buffer)
   11092 {
   11093     char *xcb_tmp = (char *)_buffer;
   11094     const xcb_xkb_get_device_info_reply_t *_aux = (xcb_xkb_get_device_info_reply_t *)_buffer;
   11095     unsigned int xcb_buffer_len = 0;
   11096     unsigned int xcb_block_len = 0;
   11097     unsigned int xcb_pad = 0;
   11098     unsigned int xcb_align_to = 0;
   11099 
   11100     unsigned int i;
   11101     unsigned int xcb_tmp_len;
   11102 
   11103     xcb_block_len += sizeof(xcb_xkb_get_device_info_reply_t);
   11104     xcb_tmp += xcb_block_len;
   11105     xcb_buffer_len += xcb_block_len;
   11106     xcb_block_len = 0;
   11107     /* name */
   11108     xcb_block_len += _aux->nameLen * sizeof(xcb_xkb_string8_t);
   11109     xcb_tmp += xcb_block_len;
   11110     xcb_align_to = ALIGNOF(xcb_xkb_string8_t);
   11111     xcb_align_to = 4;
   11112     /* insert padding */
   11113     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   11114     xcb_buffer_len += xcb_block_len + xcb_pad;
   11115     if (0 != xcb_pad) {
   11116         xcb_tmp += xcb_pad;
   11117         xcb_pad = 0;
   11118     }
   11119     xcb_block_len = 0;
   11120     /* insert padding */
   11121     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   11122     xcb_buffer_len += xcb_block_len + xcb_pad;
   11123     if (0 != xcb_pad) {
   11124         xcb_tmp += xcb_pad;
   11125         xcb_pad = 0;
   11126     }
   11127     xcb_block_len = 0;
   11128     /* btnActions */
   11129     xcb_block_len += _aux->nBtnsRtrn * sizeof(xcb_xkb_action_t);
   11130     xcb_tmp += xcb_block_len;
   11131     xcb_align_to = ALIGNOF(xcb_xkb_action_t);
   11132     /* insert padding */
   11133     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   11134     xcb_buffer_len += xcb_block_len + xcb_pad;
   11135     if (0 != xcb_pad) {
   11136         xcb_tmp += xcb_pad;
   11137         xcb_pad = 0;
   11138     }
   11139     xcb_block_len = 0;
   11140     /* leds */
   11141     for(i=0; i<_aux->nDeviceLedFBs; i++) {
   11142         xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp);
   11143         xcb_block_len += xcb_tmp_len;
   11144         xcb_tmp += xcb_tmp_len;
   11145     }
   11146     xcb_align_to = ALIGNOF(xcb_xkb_device_led_info_t);
   11147     /* insert padding */
   11148     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   11149     xcb_buffer_len += xcb_block_len + xcb_pad;
   11150     if (0 != xcb_pad) {
   11151         xcb_tmp += xcb_pad;
   11152         xcb_pad = 0;
   11153     }
   11154     xcb_block_len = 0;
   11155 
   11156     return xcb_buffer_len;
   11157 }
   11158 
   11159 xcb_xkb_get_device_info_cookie_t
   11160 xcb_xkb_get_device_info (xcb_connection_t         *c,
   11161                          xcb_xkb_device_spec_t     deviceSpec,
   11162                          uint16_t                  wanted,
   11163                          uint8_t                   allButtons,
   11164                          uint8_t                   firstButton,
   11165                          uint8_t                   nButtons,
   11166                          xcb_xkb_led_class_spec_t  ledClass,
   11167                          xcb_xkb_id_spec_t         ledID)
   11168 {
   11169     static const xcb_protocol_request_t xcb_req = {
   11170         .count = 2,
   11171         .ext = &xcb_xkb_id,
   11172         .opcode = XCB_XKB_GET_DEVICE_INFO,
   11173         .isvoid = 0
   11174     };
   11175 
   11176     struct iovec xcb_parts[4];
   11177     xcb_xkb_get_device_info_cookie_t xcb_ret;
   11178     xcb_xkb_get_device_info_request_t xcb_out;
   11179 
   11180     xcb_out.deviceSpec = deviceSpec;
   11181     xcb_out.wanted = wanted;
   11182     xcb_out.allButtons = allButtons;
   11183     xcb_out.firstButton = firstButton;
   11184     xcb_out.nButtons = nButtons;
   11185     xcb_out.pad0 = 0;
   11186     xcb_out.ledClass = ledClass;
   11187     xcb_out.ledID = ledID;
   11188 
   11189     xcb_parts[2].iov_base = (char *) &xcb_out;
   11190     xcb_parts[2].iov_len = sizeof(xcb_out);
   11191     xcb_parts[3].iov_base = 0;
   11192     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   11193 
   11194     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   11195     return xcb_ret;
   11196 }
   11197 
   11198 xcb_xkb_get_device_info_cookie_t
   11199 xcb_xkb_get_device_info_unchecked (xcb_connection_t         *c,
   11200                                    xcb_xkb_device_spec_t     deviceSpec,
   11201                                    uint16_t                  wanted,
   11202                                    uint8_t                   allButtons,
   11203                                    uint8_t                   firstButton,
   11204                                    uint8_t                   nButtons,
   11205                                    xcb_xkb_led_class_spec_t  ledClass,
   11206                                    xcb_xkb_id_spec_t         ledID)
   11207 {
   11208     static const xcb_protocol_request_t xcb_req = {
   11209         .count = 2,
   11210         .ext = &xcb_xkb_id,
   11211         .opcode = XCB_XKB_GET_DEVICE_INFO,
   11212         .isvoid = 0
   11213     };
   11214 
   11215     struct iovec xcb_parts[4];
   11216     xcb_xkb_get_device_info_cookie_t xcb_ret;
   11217     xcb_xkb_get_device_info_request_t xcb_out;
   11218 
   11219     xcb_out.deviceSpec = deviceSpec;
   11220     xcb_out.wanted = wanted;
   11221     xcb_out.allButtons = allButtons;
   11222     xcb_out.firstButton = firstButton;
   11223     xcb_out.nButtons = nButtons;
   11224     xcb_out.pad0 = 0;
   11225     xcb_out.ledClass = ledClass;
   11226     xcb_out.ledID = ledID;
   11227 
   11228     xcb_parts[2].iov_base = (char *) &xcb_out;
   11229     xcb_parts[2].iov_len = sizeof(xcb_out);
   11230     xcb_parts[3].iov_base = 0;
   11231     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   11232 
   11233     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   11234     return xcb_ret;
   11235 }
   11236 
   11237 xcb_xkb_string8_t *
   11238 xcb_xkb_get_device_info_name (const xcb_xkb_get_device_info_reply_t *R)
   11239 {
   11240     return (xcb_xkb_string8_t *) (R + 1);
   11241 }
   11242 
   11243 int
   11244 xcb_xkb_get_device_info_name_length (const xcb_xkb_get_device_info_reply_t *R)
   11245 {
   11246     return R->nameLen;
   11247 }
   11248 
   11249 xcb_generic_iterator_t
   11250 xcb_xkb_get_device_info_name_end (const xcb_xkb_get_device_info_reply_t *R)
   11251 {
   11252     xcb_generic_iterator_t i;
   11253     i.data = ((xcb_xkb_string8_t *) (R + 1)) + (R->nameLen);
   11254     i.rem = 0;
   11255     i.index = (char *) i.data - (char *) R;
   11256     return i;
   11257 }
   11258 
   11259 xcb_xkb_action_t *
   11260 xcb_xkb_get_device_info_btn_actions (const xcb_xkb_get_device_info_reply_t *R)
   11261 {
   11262     xcb_generic_iterator_t prev = xcb_xkb_get_device_info_name_end(R);
   11263     return (xcb_xkb_action_t *) ((char *) prev.data + ((-prev.index) & (4 - 1)) + 0);
   11264 }
   11265 
   11266 int
   11267 xcb_xkb_get_device_info_btn_actions_length (const xcb_xkb_get_device_info_reply_t *R)
   11268 {
   11269     return R->nBtnsRtrn;
   11270 }
   11271 
   11272 xcb_xkb_action_iterator_t
   11273 xcb_xkb_get_device_info_btn_actions_iterator (const xcb_xkb_get_device_info_reply_t *R)
   11274 {
   11275     xcb_xkb_action_iterator_t i;
   11276     xcb_generic_iterator_t prev = xcb_xkb_get_device_info_name_end(R);
   11277     i.data = (xcb_xkb_action_t *) ((char *) prev.data + ((-prev.index) & (4 - 1)));
   11278     i.rem = R->nBtnsRtrn;
   11279     i.index = (char *) i.data - (char *) R;
   11280     return i;
   11281 }
   11282 
   11283 int
   11284 xcb_xkb_get_device_info_leds_length (const xcb_xkb_get_device_info_reply_t *R)
   11285 {
   11286     return R->nDeviceLedFBs;
   11287 }
   11288 
   11289 xcb_xkb_device_led_info_iterator_t
   11290 xcb_xkb_get_device_info_leds_iterator (const xcb_xkb_get_device_info_reply_t *R)
   11291 {
   11292     xcb_xkb_device_led_info_iterator_t i;
   11293     xcb_generic_iterator_t prev = xcb_xkb_action_end(xcb_xkb_get_device_info_btn_actions_iterator(R));
   11294     i.data = (xcb_xkb_device_led_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_device_led_info_t, prev.index));
   11295     i.rem = R->nDeviceLedFBs;
   11296     i.index = (char *) i.data - (char *) R;
   11297     return i;
   11298 }
   11299 
   11300 xcb_xkb_get_device_info_reply_t *
   11301 xcb_xkb_get_device_info_reply (xcb_connection_t                  *c,
   11302                                xcb_xkb_get_device_info_cookie_t   cookie  /**< */,
   11303                                xcb_generic_error_t              **e)
   11304 {
   11305     return (xcb_xkb_get_device_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   11306 }
   11307 
   11308 int
   11309 xcb_xkb_set_device_info_sizeof (const void  *_buffer)
   11310 {
   11311     char *xcb_tmp = (char *)_buffer;
   11312     const xcb_xkb_set_device_info_request_t *_aux = (xcb_xkb_set_device_info_request_t *)_buffer;
   11313     unsigned int xcb_buffer_len = 0;
   11314     unsigned int xcb_block_len = 0;
   11315     unsigned int xcb_pad = 0;
   11316     unsigned int xcb_align_to = 0;
   11317 
   11318     unsigned int i;
   11319     unsigned int xcb_tmp_len;
   11320 
   11321     xcb_block_len += sizeof(xcb_xkb_set_device_info_request_t);
   11322     xcb_tmp += xcb_block_len;
   11323     xcb_buffer_len += xcb_block_len;
   11324     xcb_block_len = 0;
   11325     /* btnActions */
   11326     xcb_block_len += _aux->nBtns * sizeof(xcb_xkb_action_t);
   11327     xcb_tmp += xcb_block_len;
   11328     xcb_align_to = ALIGNOF(xcb_xkb_action_t);
   11329     /* insert padding */
   11330     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   11331     xcb_buffer_len += xcb_block_len + xcb_pad;
   11332     if (0 != xcb_pad) {
   11333         xcb_tmp += xcb_pad;
   11334         xcb_pad = 0;
   11335     }
   11336     xcb_block_len = 0;
   11337     /* leds */
   11338     for(i=0; i<_aux->nDeviceLedFBs; i++) {
   11339         xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp);
   11340         xcb_block_len += xcb_tmp_len;
   11341         xcb_tmp += xcb_tmp_len;
   11342     }
   11343     xcb_align_to = ALIGNOF(xcb_xkb_device_led_info_t);
   11344     /* insert padding */
   11345     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   11346     xcb_buffer_len += xcb_block_len + xcb_pad;
   11347     if (0 != xcb_pad) {
   11348         xcb_tmp += xcb_pad;
   11349         xcb_pad = 0;
   11350     }
   11351     xcb_block_len = 0;
   11352 
   11353     return xcb_buffer_len;
   11354 }
   11355 
   11356 xcb_void_cookie_t
   11357 xcb_xkb_set_device_info_checked (xcb_connection_t                *c,
   11358                                  xcb_xkb_device_spec_t            deviceSpec,
   11359                                  uint8_t                          firstBtn,
   11360                                  uint8_t                          nBtns,
   11361                                  uint16_t                         change,
   11362                                  uint16_t                         nDeviceLedFBs,
   11363                                  const xcb_xkb_action_t          *btnActions,
   11364                                  const xcb_xkb_device_led_info_t *leds)
   11365 {
   11366     static const xcb_protocol_request_t xcb_req = {
   11367         .count = 6,
   11368         .ext = &xcb_xkb_id,
   11369         .opcode = XCB_XKB_SET_DEVICE_INFO,
   11370         .isvoid = 1
   11371     };
   11372 
   11373     struct iovec xcb_parts[8];
   11374     xcb_void_cookie_t xcb_ret;
   11375     xcb_xkb_set_device_info_request_t xcb_out;
   11376     unsigned int i;
   11377     unsigned int xcb_tmp_len;
   11378     char *xcb_tmp;
   11379 
   11380     xcb_out.deviceSpec = deviceSpec;
   11381     xcb_out.firstBtn = firstBtn;
   11382     xcb_out.nBtns = nBtns;
   11383     xcb_out.change = change;
   11384     xcb_out.nDeviceLedFBs = nDeviceLedFBs;
   11385 
   11386     xcb_parts[2].iov_base = (char *) &xcb_out;
   11387     xcb_parts[2].iov_len = sizeof(xcb_out);
   11388     xcb_parts[3].iov_base = 0;
   11389     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   11390     /* xcb_xkb_action_t btnActions */
   11391     xcb_parts[4].iov_base = (char *) btnActions;
   11392     xcb_parts[4].iov_len = nBtns * sizeof(xcb_xkb_action_t);
   11393     xcb_parts[5].iov_base = 0;
   11394     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   11395     /* xcb_xkb_device_led_info_t leds */
   11396     xcb_parts[6].iov_base = (char *) leds;
   11397     xcb_parts[6].iov_len = 0;
   11398     xcb_tmp = (char *)leds;
   11399     for(i=0; i<nDeviceLedFBs; i++) {
   11400         xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp);
   11401         xcb_parts[6].iov_len += xcb_tmp_len;
   11402         xcb_tmp += xcb_tmp_len;
   11403     }
   11404     xcb_parts[7].iov_base = 0;
   11405     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
   11406 
   11407     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   11408     return xcb_ret;
   11409 }
   11410 
   11411 xcb_void_cookie_t
   11412 xcb_xkb_set_device_info (xcb_connection_t                *c,
   11413                          xcb_xkb_device_spec_t            deviceSpec,
   11414                          uint8_t                          firstBtn,
   11415                          uint8_t                          nBtns,
   11416                          uint16_t                         change,
   11417                          uint16_t                         nDeviceLedFBs,
   11418                          const xcb_xkb_action_t          *btnActions,
   11419                          const xcb_xkb_device_led_info_t *leds)
   11420 {
   11421     static const xcb_protocol_request_t xcb_req = {
   11422         .count = 6,
   11423         .ext = &xcb_xkb_id,
   11424         .opcode = XCB_XKB_SET_DEVICE_INFO,
   11425         .isvoid = 1
   11426     };
   11427 
   11428     struct iovec xcb_parts[8];
   11429     xcb_void_cookie_t xcb_ret;
   11430     xcb_xkb_set_device_info_request_t xcb_out;
   11431     unsigned int i;
   11432     unsigned int xcb_tmp_len;
   11433     char *xcb_tmp;
   11434 
   11435     xcb_out.deviceSpec = deviceSpec;
   11436     xcb_out.firstBtn = firstBtn;
   11437     xcb_out.nBtns = nBtns;
   11438     xcb_out.change = change;
   11439     xcb_out.nDeviceLedFBs = nDeviceLedFBs;
   11440 
   11441     xcb_parts[2].iov_base = (char *) &xcb_out;
   11442     xcb_parts[2].iov_len = sizeof(xcb_out);
   11443     xcb_parts[3].iov_base = 0;
   11444     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   11445     /* xcb_xkb_action_t btnActions */
   11446     xcb_parts[4].iov_base = (char *) btnActions;
   11447     xcb_parts[4].iov_len = nBtns * sizeof(xcb_xkb_action_t);
   11448     xcb_parts[5].iov_base = 0;
   11449     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   11450     /* xcb_xkb_device_led_info_t leds */
   11451     xcb_parts[6].iov_base = (char *) leds;
   11452     xcb_parts[6].iov_len = 0;
   11453     xcb_tmp = (char *)leds;
   11454     for(i=0; i<nDeviceLedFBs; i++) {
   11455         xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp);
   11456         xcb_parts[6].iov_len += xcb_tmp_len;
   11457         xcb_tmp += xcb_tmp_len;
   11458     }
   11459     xcb_parts[7].iov_base = 0;
   11460     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
   11461 
   11462     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   11463     return xcb_ret;
   11464 }
   11465 
   11466 xcb_xkb_action_t *
   11467 xcb_xkb_set_device_info_btn_actions (const xcb_xkb_set_device_info_request_t *R)
   11468 {
   11469     return (xcb_xkb_action_t *) (R + 1);
   11470 }
   11471 
   11472 int
   11473 xcb_xkb_set_device_info_btn_actions_length (const xcb_xkb_set_device_info_request_t *R)
   11474 {
   11475     return R->nBtns;
   11476 }
   11477 
   11478 xcb_xkb_action_iterator_t
   11479 xcb_xkb_set_device_info_btn_actions_iterator (const xcb_xkb_set_device_info_request_t *R)
   11480 {
   11481     xcb_xkb_action_iterator_t i;
   11482     i.data = (xcb_xkb_action_t *) (R + 1);
   11483     i.rem = R->nBtns;
   11484     i.index = (char *) i.data - (char *) R;
   11485     return i;
   11486 }
   11487 
   11488 int
   11489 xcb_xkb_set_device_info_leds_length (const xcb_xkb_set_device_info_request_t *R)
   11490 {
   11491     return R->nDeviceLedFBs;
   11492 }
   11493 
   11494 xcb_xkb_device_led_info_iterator_t
   11495 xcb_xkb_set_device_info_leds_iterator (const xcb_xkb_set_device_info_request_t *R)
   11496 {
   11497     xcb_xkb_device_led_info_iterator_t i;
   11498     xcb_generic_iterator_t prev = xcb_xkb_action_end(xcb_xkb_set_device_info_btn_actions_iterator(R));
   11499     i.data = (xcb_xkb_device_led_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_device_led_info_t, prev.index));
   11500     i.rem = R->nDeviceLedFBs;
   11501     i.index = (char *) i.data - (char *) R;
   11502     return i;
   11503 }
   11504 
   11505 int
   11506 xcb_xkb_set_debugging_flags_sizeof (const void  *_buffer)
   11507 {
   11508     char *xcb_tmp = (char *)_buffer;
   11509     const xcb_xkb_set_debugging_flags_request_t *_aux = (xcb_xkb_set_debugging_flags_request_t *)_buffer;
   11510     unsigned int xcb_buffer_len = 0;
   11511     unsigned int xcb_block_len = 0;
   11512     unsigned int xcb_pad = 0;
   11513     unsigned int xcb_align_to = 0;
   11514 
   11515 
   11516     xcb_block_len += sizeof(xcb_xkb_set_debugging_flags_request_t);
   11517     xcb_tmp += xcb_block_len;
   11518     xcb_buffer_len += xcb_block_len;
   11519     xcb_block_len = 0;
   11520     /* message */
   11521     xcb_block_len += _aux->msgLength * sizeof(xcb_xkb_string8_t);
   11522     xcb_tmp += xcb_block_len;
   11523     xcb_align_to = ALIGNOF(xcb_xkb_string8_t);
   11524     /* insert padding */
   11525     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   11526     xcb_buffer_len += xcb_block_len + xcb_pad;
   11527     if (0 != xcb_pad) {
   11528         xcb_tmp += xcb_pad;
   11529         xcb_pad = 0;
   11530     }
   11531     xcb_block_len = 0;
   11532 
   11533     return xcb_buffer_len;
   11534 }
   11535 
   11536 xcb_xkb_set_debugging_flags_cookie_t
   11537 xcb_xkb_set_debugging_flags (xcb_connection_t        *c,
   11538                              uint16_t                 msgLength,
   11539                              uint32_t                 affectFlags,
   11540                              uint32_t                 flags,
   11541                              uint32_t                 affectCtrls,
   11542                              uint32_t                 ctrls,
   11543                              const xcb_xkb_string8_t *message)
   11544 {
   11545     static const xcb_protocol_request_t xcb_req = {
   11546         .count = 4,
   11547         .ext = &xcb_xkb_id,
   11548         .opcode = XCB_XKB_SET_DEBUGGING_FLAGS,
   11549         .isvoid = 0
   11550     };
   11551 
   11552     struct iovec xcb_parts[6];
   11553     xcb_xkb_set_debugging_flags_cookie_t xcb_ret;
   11554     xcb_xkb_set_debugging_flags_request_t xcb_out;
   11555 
   11556     xcb_out.msgLength = msgLength;
   11557     memset(xcb_out.pad0, 0, 2);
   11558     xcb_out.affectFlags = affectFlags;
   11559     xcb_out.flags = flags;
   11560     xcb_out.affectCtrls = affectCtrls;
   11561     xcb_out.ctrls = ctrls;
   11562 
   11563     xcb_parts[2].iov_base = (char *) &xcb_out;
   11564     xcb_parts[2].iov_len = sizeof(xcb_out);
   11565     xcb_parts[3].iov_base = 0;
   11566     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   11567     /* xcb_xkb_string8_t message */
   11568     xcb_parts[4].iov_base = (char *) message;
   11569     xcb_parts[4].iov_len = msgLength * sizeof(xcb_xkb_string8_t);
   11570     xcb_parts[5].iov_base = 0;
   11571     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   11572 
   11573     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   11574     return xcb_ret;
   11575 }
   11576 
   11577 xcb_xkb_set_debugging_flags_cookie_t
   11578 xcb_xkb_set_debugging_flags_unchecked (xcb_connection_t        *c,
   11579                                        uint16_t                 msgLength,
   11580                                        uint32_t                 affectFlags,
   11581                                        uint32_t                 flags,
   11582                                        uint32_t                 affectCtrls,
   11583                                        uint32_t                 ctrls,
   11584                                        const xcb_xkb_string8_t *message)
   11585 {
   11586     static const xcb_protocol_request_t xcb_req = {
   11587         .count = 4,
   11588         .ext = &xcb_xkb_id,
   11589         .opcode = XCB_XKB_SET_DEBUGGING_FLAGS,
   11590         .isvoid = 0
   11591     };
   11592 
   11593     struct iovec xcb_parts[6];
   11594     xcb_xkb_set_debugging_flags_cookie_t xcb_ret;
   11595     xcb_xkb_set_debugging_flags_request_t xcb_out;
   11596 
   11597     xcb_out.msgLength = msgLength;
   11598     memset(xcb_out.pad0, 0, 2);
   11599     xcb_out.affectFlags = affectFlags;
   11600     xcb_out.flags = flags;
   11601     xcb_out.affectCtrls = affectCtrls;
   11602     xcb_out.ctrls = ctrls;
   11603 
   11604     xcb_parts[2].iov_base = (char *) &xcb_out;
   11605     xcb_parts[2].iov_len = sizeof(xcb_out);
   11606     xcb_parts[3].iov_base = 0;
   11607     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   11608     /* xcb_xkb_string8_t message */
   11609     xcb_parts[4].iov_base = (char *) message;
   11610     xcb_parts[4].iov_len = msgLength * sizeof(xcb_xkb_string8_t);
   11611     xcb_parts[5].iov_base = 0;
   11612     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   11613 
   11614     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   11615     return xcb_ret;
   11616 }
   11617 
   11618 xcb_xkb_set_debugging_flags_reply_t *
   11619 xcb_xkb_set_debugging_flags_reply (xcb_connection_t                      *c,
   11620                                    xcb_xkb_set_debugging_flags_cookie_t   cookie  /**< */,
   11621                                    xcb_generic_error_t                  **e)
   11622 {
   11623     return (xcb_xkb_set_debugging_flags_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   11624 }
   11625 
   11626