etc/protocols - sync with NetBSD-8
[minix.git] / external / mit / xorg / lib / libxcb / files / res.c
blob6f1bba51756028b620e41ded073bf8ebd5c75277
1 /*
2 * This file generated automatically from res.xml by c_client.py.
3 * Edit at your peril.
4 */
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 "res.h"
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
19 xcb_extension_t xcb_res_id = { "X-Resource", 0 };
21 void
22 xcb_res_client_next (xcb_res_client_iterator_t *i /**< */)
24 --i->rem;
25 ++i->data;
26 i->index += sizeof(xcb_res_client_t);
29 xcb_generic_iterator_t
30 xcb_res_client_end (xcb_res_client_iterator_t i /**< */)
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;
39 void
40 xcb_res_type_next (xcb_res_type_iterator_t *i /**< */)
42 --i->rem;
43 ++i->data;
44 i->index += sizeof(xcb_res_type_t);
47 xcb_generic_iterator_t
48 xcb_res_type_end (xcb_res_type_iterator_t i /**< */)
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;
57 void
58 xcb_res_client_id_spec_next (xcb_res_client_id_spec_iterator_t *i /**< */)
60 --i->rem;
61 ++i->data;
62 i->index += sizeof(xcb_res_client_id_spec_t);
65 xcb_generic_iterator_t
66 xcb_res_client_id_spec_end (xcb_res_client_id_spec_iterator_t i /**< */)
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;
75 int
76 xcb_res_client_id_value_sizeof (const void *_buffer /**< */)
78 char *xcb_tmp = (char *)_buffer;
79 const xcb_res_client_id_value_t *_aux = (xcb_res_client_id_value_t *)_buffer;
80 unsigned int xcb_buffer_len = 0;
81 unsigned int xcb_block_len = 0;
82 unsigned int xcb_pad = 0;
83 unsigned int xcb_align_to = 0;
86 xcb_block_len += sizeof(xcb_res_client_id_value_t);
87 xcb_tmp += xcb_block_len;
88 xcb_buffer_len += xcb_block_len;
89 xcb_block_len = 0;
90 /* value */
91 xcb_block_len += _aux->length * sizeof(uint32_t);
92 xcb_tmp += xcb_block_len;
93 xcb_align_to = ALIGNOF(uint32_t);
94 /* insert padding */
95 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
96 xcb_buffer_len += xcb_block_len + xcb_pad;
97 if (0 != xcb_pad) {
98 xcb_tmp += xcb_pad;
99 xcb_pad = 0;
101 xcb_block_len = 0;
103 return xcb_buffer_len;
106 uint32_t *
107 xcb_res_client_id_value_value (const xcb_res_client_id_value_t *R /**< */)
109 return (uint32_t *) (R + 1);
113 xcb_res_client_id_value_value_length (const xcb_res_client_id_value_t *R /**< */)
115 return R->length;
118 xcb_generic_iterator_t
119 xcb_res_client_id_value_value_end (const xcb_res_client_id_value_t *R /**< */)
121 xcb_generic_iterator_t i;
122 i.data = ((uint32_t *) (R + 1)) + (R->length);
123 i.rem = 0;
124 i.index = (char *) i.data - (char *) R;
125 return i;
128 void
129 xcb_res_client_id_value_next (xcb_res_client_id_value_iterator_t *i /**< */)
131 xcb_res_client_id_value_t *R = i->data;
132 xcb_generic_iterator_t child;
133 child.data = (xcb_res_client_id_value_t *)(((char *)R) + xcb_res_client_id_value_sizeof(R));
134 i->index = (char *) child.data - (char *) i->data;
135 --i->rem;
136 i->data = (xcb_res_client_id_value_t *) child.data;
139 xcb_generic_iterator_t
140 xcb_res_client_id_value_end (xcb_res_client_id_value_iterator_t i /**< */)
142 xcb_generic_iterator_t ret;
143 while(i.rem > 0)
144 xcb_res_client_id_value_next(&i);
145 ret.data = i.data;
146 ret.rem = i.rem;
147 ret.index = i.index;
148 return ret;
151 void
152 xcb_res_resource_id_spec_next (xcb_res_resource_id_spec_iterator_t *i /**< */)
154 --i->rem;
155 ++i->data;
156 i->index += sizeof(xcb_res_resource_id_spec_t);
159 xcb_generic_iterator_t
160 xcb_res_resource_id_spec_end (xcb_res_resource_id_spec_iterator_t i /**< */)
162 xcb_generic_iterator_t ret;
163 ret.data = i.data + i.rem;
164 ret.index = i.index + ((char *) ret.data - (char *) i.data);
165 ret.rem = 0;
166 return ret;
169 void
170 xcb_res_resource_size_spec_next (xcb_res_resource_size_spec_iterator_t *i /**< */)
172 --i->rem;
173 ++i->data;
174 i->index += sizeof(xcb_res_resource_size_spec_t);
177 xcb_generic_iterator_t
178 xcb_res_resource_size_spec_end (xcb_res_resource_size_spec_iterator_t i /**< */)
180 xcb_generic_iterator_t ret;
181 ret.data = i.data + i.rem;
182 ret.index = i.index + ((char *) ret.data - (char *) i.data);
183 ret.rem = 0;
184 return ret;
188 xcb_res_resource_size_value_sizeof (const void *_buffer /**< */)
190 char *xcb_tmp = (char *)_buffer;
191 const xcb_res_resource_size_value_t *_aux = (xcb_res_resource_size_value_t *)_buffer;
192 unsigned int xcb_buffer_len = 0;
193 unsigned int xcb_block_len = 0;
194 unsigned int xcb_pad = 0;
195 unsigned int xcb_align_to = 0;
198 xcb_block_len += sizeof(xcb_res_resource_size_value_t);
199 xcb_tmp += xcb_block_len;
200 xcb_buffer_len += xcb_block_len;
201 xcb_block_len = 0;
202 /* cross_references */
203 xcb_block_len += _aux->num_cross_references * sizeof(xcb_res_resource_size_spec_t);
204 xcb_tmp += xcb_block_len;
205 xcb_align_to = ALIGNOF(xcb_res_resource_size_spec_t);
206 /* insert padding */
207 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
208 xcb_buffer_len += xcb_block_len + xcb_pad;
209 if (0 != xcb_pad) {
210 xcb_tmp += xcb_pad;
211 xcb_pad = 0;
213 xcb_block_len = 0;
215 return xcb_buffer_len;
218 xcb_res_resource_size_spec_t *
219 xcb_res_resource_size_value_cross_references (const xcb_res_resource_size_value_t *R /**< */)
221 return (xcb_res_resource_size_spec_t *) (R + 1);
225 xcb_res_resource_size_value_cross_references_length (const xcb_res_resource_size_value_t *R /**< */)
227 return R->num_cross_references;
230 xcb_res_resource_size_spec_iterator_t
231 xcb_res_resource_size_value_cross_references_iterator (const xcb_res_resource_size_value_t *R /**< */)
233 xcb_res_resource_size_spec_iterator_t i;
234 i.data = (xcb_res_resource_size_spec_t *) (R + 1);
235 i.rem = R->num_cross_references;
236 i.index = (char *) i.data - (char *) R;
237 return i;
240 void
241 xcb_res_resource_size_value_next (xcb_res_resource_size_value_iterator_t *i /**< */)
243 xcb_res_resource_size_value_t *R = i->data;
244 xcb_generic_iterator_t child;
245 child.data = (xcb_res_resource_size_value_t *)(((char *)R) + xcb_res_resource_size_value_sizeof(R));
246 i->index = (char *) child.data - (char *) i->data;
247 --i->rem;
248 i->data = (xcb_res_resource_size_value_t *) child.data;
251 xcb_generic_iterator_t
252 xcb_res_resource_size_value_end (xcb_res_resource_size_value_iterator_t i /**< */)
254 xcb_generic_iterator_t ret;
255 while(i.rem > 0)
256 xcb_res_resource_size_value_next(&i);
257 ret.data = i.data;
258 ret.rem = i.rem;
259 ret.index = i.index;
260 return ret;
263 xcb_res_query_version_cookie_t
264 xcb_res_query_version (xcb_connection_t *c /**< */,
265 uint8_t client_major /**< */,
266 uint8_t client_minor /**< */)
268 static const xcb_protocol_request_t xcb_req = {
269 /* count */ 2,
270 /* ext */ &xcb_res_id,
271 /* opcode */ XCB_RES_QUERY_VERSION,
272 /* isvoid */ 0
275 struct iovec xcb_parts[4];
276 xcb_res_query_version_cookie_t xcb_ret;
277 xcb_res_query_version_request_t xcb_out;
279 xcb_out.client_major = client_major;
280 xcb_out.client_minor = client_minor;
282 xcb_parts[2].iov_base = (char *) &xcb_out;
283 xcb_parts[2].iov_len = sizeof(xcb_out);
284 xcb_parts[3].iov_base = 0;
285 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
287 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
288 return xcb_ret;
291 xcb_res_query_version_cookie_t
292 xcb_res_query_version_unchecked (xcb_connection_t *c /**< */,
293 uint8_t client_major /**< */,
294 uint8_t client_minor /**< */)
296 static const xcb_protocol_request_t xcb_req = {
297 /* count */ 2,
298 /* ext */ &xcb_res_id,
299 /* opcode */ XCB_RES_QUERY_VERSION,
300 /* isvoid */ 0
303 struct iovec xcb_parts[4];
304 xcb_res_query_version_cookie_t xcb_ret;
305 xcb_res_query_version_request_t xcb_out;
307 xcb_out.client_major = client_major;
308 xcb_out.client_minor = client_minor;
310 xcb_parts[2].iov_base = (char *) &xcb_out;
311 xcb_parts[2].iov_len = sizeof(xcb_out);
312 xcb_parts[3].iov_base = 0;
313 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
315 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
316 return xcb_ret;
319 xcb_res_query_version_reply_t *
320 xcb_res_query_version_reply (xcb_connection_t *c /**< */,
321 xcb_res_query_version_cookie_t cookie /**< */,
322 xcb_generic_error_t **e /**< */)
324 return (xcb_res_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
328 xcb_res_query_clients_sizeof (const void *_buffer /**< */)
330 char *xcb_tmp = (char *)_buffer;
331 const xcb_res_query_clients_reply_t *_aux = (xcb_res_query_clients_reply_t *)_buffer;
332 unsigned int xcb_buffer_len = 0;
333 unsigned int xcb_block_len = 0;
334 unsigned int xcb_pad = 0;
335 unsigned int xcb_align_to = 0;
338 xcb_block_len += sizeof(xcb_res_query_clients_reply_t);
339 xcb_tmp += xcb_block_len;
340 xcb_buffer_len += xcb_block_len;
341 xcb_block_len = 0;
342 /* clients */
343 xcb_block_len += _aux->num_clients * sizeof(xcb_res_client_t);
344 xcb_tmp += xcb_block_len;
345 xcb_align_to = ALIGNOF(xcb_res_client_t);
346 /* insert padding */
347 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
348 xcb_buffer_len += xcb_block_len + xcb_pad;
349 if (0 != xcb_pad) {
350 xcb_tmp += xcb_pad;
351 xcb_pad = 0;
353 xcb_block_len = 0;
355 return xcb_buffer_len;
358 xcb_res_query_clients_cookie_t
359 xcb_res_query_clients (xcb_connection_t *c /**< */)
361 static const xcb_protocol_request_t xcb_req = {
362 /* count */ 2,
363 /* ext */ &xcb_res_id,
364 /* opcode */ XCB_RES_QUERY_CLIENTS,
365 /* isvoid */ 0
368 struct iovec xcb_parts[4];
369 xcb_res_query_clients_cookie_t xcb_ret;
370 xcb_res_query_clients_request_t xcb_out;
373 xcb_parts[2].iov_base = (char *) &xcb_out;
374 xcb_parts[2].iov_len = sizeof(xcb_out);
375 xcb_parts[3].iov_base = 0;
376 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
378 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
379 return xcb_ret;
382 xcb_res_query_clients_cookie_t
383 xcb_res_query_clients_unchecked (xcb_connection_t *c /**< */)
385 static const xcb_protocol_request_t xcb_req = {
386 /* count */ 2,
387 /* ext */ &xcb_res_id,
388 /* opcode */ XCB_RES_QUERY_CLIENTS,
389 /* isvoid */ 0
392 struct iovec xcb_parts[4];
393 xcb_res_query_clients_cookie_t xcb_ret;
394 xcb_res_query_clients_request_t xcb_out;
397 xcb_parts[2].iov_base = (char *) &xcb_out;
398 xcb_parts[2].iov_len = sizeof(xcb_out);
399 xcb_parts[3].iov_base = 0;
400 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
402 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
403 return xcb_ret;
406 xcb_res_client_t *
407 xcb_res_query_clients_clients (const xcb_res_query_clients_reply_t *R /**< */)
409 return (xcb_res_client_t *) (R + 1);
413 xcb_res_query_clients_clients_length (const xcb_res_query_clients_reply_t *R /**< */)
415 return R->num_clients;
418 xcb_res_client_iterator_t
419 xcb_res_query_clients_clients_iterator (const xcb_res_query_clients_reply_t *R /**< */)
421 xcb_res_client_iterator_t i;
422 i.data = (xcb_res_client_t *) (R + 1);
423 i.rem = R->num_clients;
424 i.index = (char *) i.data - (char *) R;
425 return i;
428 xcb_res_query_clients_reply_t *
429 xcb_res_query_clients_reply (xcb_connection_t *c /**< */,
430 xcb_res_query_clients_cookie_t cookie /**< */,
431 xcb_generic_error_t **e /**< */)
433 return (xcb_res_query_clients_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
437 xcb_res_query_client_resources_sizeof (const void *_buffer /**< */)
439 char *xcb_tmp = (char *)_buffer;
440 const xcb_res_query_client_resources_reply_t *_aux = (xcb_res_query_client_resources_reply_t *)_buffer;
441 unsigned int xcb_buffer_len = 0;
442 unsigned int xcb_block_len = 0;
443 unsigned int xcb_pad = 0;
444 unsigned int xcb_align_to = 0;
447 xcb_block_len += sizeof(xcb_res_query_client_resources_reply_t);
448 xcb_tmp += xcb_block_len;
449 xcb_buffer_len += xcb_block_len;
450 xcb_block_len = 0;
451 /* types */
452 xcb_block_len += _aux->num_types * sizeof(xcb_res_type_t);
453 xcb_tmp += xcb_block_len;
454 xcb_align_to = ALIGNOF(xcb_res_type_t);
455 /* insert padding */
456 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
457 xcb_buffer_len += xcb_block_len + xcb_pad;
458 if (0 != xcb_pad) {
459 xcb_tmp += xcb_pad;
460 xcb_pad = 0;
462 xcb_block_len = 0;
464 return xcb_buffer_len;
467 xcb_res_query_client_resources_cookie_t
468 xcb_res_query_client_resources (xcb_connection_t *c /**< */,
469 uint32_t xid /**< */)
471 static const xcb_protocol_request_t xcb_req = {
472 /* count */ 2,
473 /* ext */ &xcb_res_id,
474 /* opcode */ XCB_RES_QUERY_CLIENT_RESOURCES,
475 /* isvoid */ 0
478 struct iovec xcb_parts[4];
479 xcb_res_query_client_resources_cookie_t xcb_ret;
480 xcb_res_query_client_resources_request_t xcb_out;
482 xcb_out.xid = xid;
484 xcb_parts[2].iov_base = (char *) &xcb_out;
485 xcb_parts[2].iov_len = sizeof(xcb_out);
486 xcb_parts[3].iov_base = 0;
487 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
489 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
490 return xcb_ret;
493 xcb_res_query_client_resources_cookie_t
494 xcb_res_query_client_resources_unchecked (xcb_connection_t *c /**< */,
495 uint32_t xid /**< */)
497 static const xcb_protocol_request_t xcb_req = {
498 /* count */ 2,
499 /* ext */ &xcb_res_id,
500 /* opcode */ XCB_RES_QUERY_CLIENT_RESOURCES,
501 /* isvoid */ 0
504 struct iovec xcb_parts[4];
505 xcb_res_query_client_resources_cookie_t xcb_ret;
506 xcb_res_query_client_resources_request_t xcb_out;
508 xcb_out.xid = xid;
510 xcb_parts[2].iov_base = (char *) &xcb_out;
511 xcb_parts[2].iov_len = sizeof(xcb_out);
512 xcb_parts[3].iov_base = 0;
513 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
515 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
516 return xcb_ret;
519 xcb_res_type_t *
520 xcb_res_query_client_resources_types (const xcb_res_query_client_resources_reply_t *R /**< */)
522 return (xcb_res_type_t *) (R + 1);
526 xcb_res_query_client_resources_types_length (const xcb_res_query_client_resources_reply_t *R /**< */)
528 return R->num_types;
531 xcb_res_type_iterator_t
532 xcb_res_query_client_resources_types_iterator (const xcb_res_query_client_resources_reply_t *R /**< */)
534 xcb_res_type_iterator_t i;
535 i.data = (xcb_res_type_t *) (R + 1);
536 i.rem = R->num_types;
537 i.index = (char *) i.data - (char *) R;
538 return i;
541 xcb_res_query_client_resources_reply_t *
542 xcb_res_query_client_resources_reply (xcb_connection_t *c /**< */,
543 xcb_res_query_client_resources_cookie_t cookie /**< */,
544 xcb_generic_error_t **e /**< */)
546 return (xcb_res_query_client_resources_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
549 xcb_res_query_client_pixmap_bytes_cookie_t
550 xcb_res_query_client_pixmap_bytes (xcb_connection_t *c /**< */,
551 uint32_t xid /**< */)
553 static const xcb_protocol_request_t xcb_req = {
554 /* count */ 2,
555 /* ext */ &xcb_res_id,
556 /* opcode */ XCB_RES_QUERY_CLIENT_PIXMAP_BYTES,
557 /* isvoid */ 0
560 struct iovec xcb_parts[4];
561 xcb_res_query_client_pixmap_bytes_cookie_t xcb_ret;
562 xcb_res_query_client_pixmap_bytes_request_t xcb_out;
564 xcb_out.xid = xid;
566 xcb_parts[2].iov_base = (char *) &xcb_out;
567 xcb_parts[2].iov_len = sizeof(xcb_out);
568 xcb_parts[3].iov_base = 0;
569 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
571 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
572 return xcb_ret;
575 xcb_res_query_client_pixmap_bytes_cookie_t
576 xcb_res_query_client_pixmap_bytes_unchecked (xcb_connection_t *c /**< */,
577 uint32_t xid /**< */)
579 static const xcb_protocol_request_t xcb_req = {
580 /* count */ 2,
581 /* ext */ &xcb_res_id,
582 /* opcode */ XCB_RES_QUERY_CLIENT_PIXMAP_BYTES,
583 /* isvoid */ 0
586 struct iovec xcb_parts[4];
587 xcb_res_query_client_pixmap_bytes_cookie_t xcb_ret;
588 xcb_res_query_client_pixmap_bytes_request_t xcb_out;
590 xcb_out.xid = xid;
592 xcb_parts[2].iov_base = (char *) &xcb_out;
593 xcb_parts[2].iov_len = sizeof(xcb_out);
594 xcb_parts[3].iov_base = 0;
595 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
597 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
598 return xcb_ret;
601 xcb_res_query_client_pixmap_bytes_reply_t *
602 xcb_res_query_client_pixmap_bytes_reply (xcb_connection_t *c /**< */,
603 xcb_res_query_client_pixmap_bytes_cookie_t cookie /**< */,
604 xcb_generic_error_t **e /**< */)
606 return (xcb_res_query_client_pixmap_bytes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
610 xcb_res_query_client_ids_sizeof (const void *_buffer /**< */)
612 char *xcb_tmp = (char *)_buffer;
613 const xcb_res_query_client_ids_request_t *_aux = (xcb_res_query_client_ids_request_t *)_buffer;
614 unsigned int xcb_buffer_len = 0;
615 unsigned int xcb_block_len = 0;
616 unsigned int xcb_pad = 0;
617 unsigned int xcb_align_to = 0;
620 xcb_block_len += sizeof(xcb_res_query_client_ids_request_t);
621 xcb_tmp += xcb_block_len;
622 xcb_buffer_len += xcb_block_len;
623 xcb_block_len = 0;
624 /* specs */
625 xcb_block_len += _aux->num_specs * sizeof(xcb_res_client_id_spec_t);
626 xcb_tmp += xcb_block_len;
627 xcb_align_to = ALIGNOF(xcb_res_client_id_spec_t);
628 /* insert padding */
629 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
630 xcb_buffer_len += xcb_block_len + xcb_pad;
631 if (0 != xcb_pad) {
632 xcb_tmp += xcb_pad;
633 xcb_pad = 0;
635 xcb_block_len = 0;
637 return xcb_buffer_len;
640 xcb_res_query_client_ids_cookie_t
641 xcb_res_query_client_ids (xcb_connection_t *c /**< */,
642 uint32_t num_specs /**< */,
643 const xcb_res_client_id_spec_t *specs /**< */)
645 static const xcb_protocol_request_t xcb_req = {
646 /* count */ 4,
647 /* ext */ &xcb_res_id,
648 /* opcode */ XCB_RES_QUERY_CLIENT_IDS,
649 /* isvoid */ 0
652 struct iovec xcb_parts[6];
653 xcb_res_query_client_ids_cookie_t xcb_ret;
654 xcb_res_query_client_ids_request_t xcb_out;
656 xcb_out.num_specs = num_specs;
658 xcb_parts[2].iov_base = (char *) &xcb_out;
659 xcb_parts[2].iov_len = sizeof(xcb_out);
660 xcb_parts[3].iov_base = 0;
661 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
662 /* xcb_res_client_id_spec_t specs */
663 xcb_parts[4].iov_base = (char *) specs;
664 xcb_parts[4].iov_len = num_specs * sizeof(xcb_res_client_id_spec_t);
665 xcb_parts[5].iov_base = 0;
666 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
668 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
669 return xcb_ret;
672 xcb_res_query_client_ids_cookie_t
673 xcb_res_query_client_ids_unchecked (xcb_connection_t *c /**< */,
674 uint32_t num_specs /**< */,
675 const xcb_res_client_id_spec_t *specs /**< */)
677 static const xcb_protocol_request_t xcb_req = {
678 /* count */ 4,
679 /* ext */ &xcb_res_id,
680 /* opcode */ XCB_RES_QUERY_CLIENT_IDS,
681 /* isvoid */ 0
684 struct iovec xcb_parts[6];
685 xcb_res_query_client_ids_cookie_t xcb_ret;
686 xcb_res_query_client_ids_request_t xcb_out;
688 xcb_out.num_specs = num_specs;
690 xcb_parts[2].iov_base = (char *) &xcb_out;
691 xcb_parts[2].iov_len = sizeof(xcb_out);
692 xcb_parts[3].iov_base = 0;
693 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
694 /* xcb_res_client_id_spec_t specs */
695 xcb_parts[4].iov_base = (char *) specs;
696 xcb_parts[4].iov_len = num_specs * sizeof(xcb_res_client_id_spec_t);
697 xcb_parts[5].iov_base = 0;
698 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
700 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
701 return xcb_ret;
705 xcb_res_query_client_ids_ids_length (const xcb_res_query_client_ids_reply_t *R /**< */)
707 return R->num_ids;
710 xcb_res_client_id_value_iterator_t
711 xcb_res_query_client_ids_ids_iterator (const xcb_res_query_client_ids_reply_t *R /**< */)
713 xcb_res_client_id_value_iterator_t i;
714 i.data = (xcb_res_client_id_value_t *) (R + 1);
715 i.rem = R->num_ids;
716 i.index = (char *) i.data - (char *) R;
717 return i;
720 xcb_res_query_client_ids_reply_t *
721 xcb_res_query_client_ids_reply (xcb_connection_t *c /**< */,
722 xcb_res_query_client_ids_cookie_t cookie /**< */,
723 xcb_generic_error_t **e /**< */)
725 return (xcb_res_query_client_ids_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
729 xcb_res_query_resource_bytes_sizeof (const void *_buffer /**< */)
731 char *xcb_tmp = (char *)_buffer;
732 const xcb_res_query_resource_bytes_request_t *_aux = (xcb_res_query_resource_bytes_request_t *)_buffer;
733 unsigned int xcb_buffer_len = 0;
734 unsigned int xcb_block_len = 0;
735 unsigned int xcb_pad = 0;
736 unsigned int xcb_align_to = 0;
739 xcb_block_len += sizeof(xcb_res_query_resource_bytes_request_t);
740 xcb_tmp += xcb_block_len;
741 xcb_buffer_len += xcb_block_len;
742 xcb_block_len = 0;
743 /* specs */
744 xcb_block_len += _aux->num_specs * sizeof(xcb_res_resource_id_spec_t);
745 xcb_tmp += xcb_block_len;
746 xcb_align_to = ALIGNOF(xcb_res_resource_id_spec_t);
747 /* insert padding */
748 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
749 xcb_buffer_len += xcb_block_len + xcb_pad;
750 if (0 != xcb_pad) {
751 xcb_tmp += xcb_pad;
752 xcb_pad = 0;
754 xcb_block_len = 0;
756 return xcb_buffer_len;
759 xcb_res_query_resource_bytes_cookie_t
760 xcb_res_query_resource_bytes (xcb_connection_t *c /**< */,
761 uint32_t client /**< */,
762 uint32_t num_specs /**< */,
763 const xcb_res_resource_id_spec_t *specs /**< */)
765 static const xcb_protocol_request_t xcb_req = {
766 /* count */ 4,
767 /* ext */ &xcb_res_id,
768 /* opcode */ XCB_RES_QUERY_RESOURCE_BYTES,
769 /* isvoid */ 0
772 struct iovec xcb_parts[6];
773 xcb_res_query_resource_bytes_cookie_t xcb_ret;
774 xcb_res_query_resource_bytes_request_t xcb_out;
776 xcb_out.client = client;
777 xcb_out.num_specs = num_specs;
779 xcb_parts[2].iov_base = (char *) &xcb_out;
780 xcb_parts[2].iov_len = sizeof(xcb_out);
781 xcb_parts[3].iov_base = 0;
782 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
783 /* xcb_res_resource_id_spec_t specs */
784 xcb_parts[4].iov_base = (char *) specs;
785 xcb_parts[4].iov_len = num_specs * sizeof(xcb_res_resource_id_spec_t);
786 xcb_parts[5].iov_base = 0;
787 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
789 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
790 return xcb_ret;
793 xcb_res_query_resource_bytes_cookie_t
794 xcb_res_query_resource_bytes_unchecked (xcb_connection_t *c /**< */,
795 uint32_t client /**< */,
796 uint32_t num_specs /**< */,
797 const xcb_res_resource_id_spec_t *specs /**< */)
799 static const xcb_protocol_request_t xcb_req = {
800 /* count */ 4,
801 /* ext */ &xcb_res_id,
802 /* opcode */ XCB_RES_QUERY_RESOURCE_BYTES,
803 /* isvoid */ 0
806 struct iovec xcb_parts[6];
807 xcb_res_query_resource_bytes_cookie_t xcb_ret;
808 xcb_res_query_resource_bytes_request_t xcb_out;
810 xcb_out.client = client;
811 xcb_out.num_specs = num_specs;
813 xcb_parts[2].iov_base = (char *) &xcb_out;
814 xcb_parts[2].iov_len = sizeof(xcb_out);
815 xcb_parts[3].iov_base = 0;
816 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
817 /* xcb_res_resource_id_spec_t specs */
818 xcb_parts[4].iov_base = (char *) specs;
819 xcb_parts[4].iov_len = num_specs * sizeof(xcb_res_resource_id_spec_t);
820 xcb_parts[5].iov_base = 0;
821 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
823 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
824 return xcb_ret;
828 xcb_res_query_resource_bytes_sizes_length (const xcb_res_query_resource_bytes_reply_t *R /**< */)
830 return R->num_sizes;
833 xcb_res_resource_size_value_iterator_t
834 xcb_res_query_resource_bytes_sizes_iterator (const xcb_res_query_resource_bytes_reply_t *R /**< */)
836 xcb_res_resource_size_value_iterator_t i;
837 i.data = (xcb_res_resource_size_value_t *) (R + 1);
838 i.rem = R->num_sizes;
839 i.index = (char *) i.data - (char *) R;
840 return i;
843 xcb_res_query_resource_bytes_reply_t *
844 xcb_res_query_resource_bytes_reply (xcb_connection_t *c /**< */,
845 xcb_res_query_resource_bytes_cookie_t cookie /**< */,
846 xcb_generic_error_t **e /**< */)
848 return (xcb_res_query_resource_bytes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);