etc/protocols - sync with NetBSD-8
[minix.git] / external / mit / xorg / lib / libxcb / files / xselinux.c
blobfc9e41b444caf0a0267052a240343c6c0e71c145
1 /*
2 * This file generated automatically from xselinux.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 "xselinux.h"
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
19 xcb_extension_t xcb_selinux_id = { "SELinux", 0 };
21 xcb_selinux_query_version_cookie_t
22 xcb_selinux_query_version (xcb_connection_t *c /**< */,
23 uint8_t client_major /**< */,
24 uint8_t client_minor /**< */)
26 static const xcb_protocol_request_t xcb_req = {
27 /* count */ 2,
28 /* ext */ &xcb_selinux_id,
29 /* opcode */ XCB_SELINUX_QUERY_VERSION,
30 /* isvoid */ 0
33 struct iovec xcb_parts[4];
34 xcb_selinux_query_version_cookie_t xcb_ret;
35 xcb_selinux_query_version_request_t xcb_out;
37 xcb_out.client_major = client_major;
38 xcb_out.client_minor = client_minor;
40 xcb_parts[2].iov_base = (char *) &xcb_out;
41 xcb_parts[2].iov_len = sizeof(xcb_out);
42 xcb_parts[3].iov_base = 0;
43 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
45 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
46 return xcb_ret;
49 xcb_selinux_query_version_cookie_t
50 xcb_selinux_query_version_unchecked (xcb_connection_t *c /**< */,
51 uint8_t client_major /**< */,
52 uint8_t client_minor /**< */)
54 static const xcb_protocol_request_t xcb_req = {
55 /* count */ 2,
56 /* ext */ &xcb_selinux_id,
57 /* opcode */ XCB_SELINUX_QUERY_VERSION,
58 /* isvoid */ 0
61 struct iovec xcb_parts[4];
62 xcb_selinux_query_version_cookie_t xcb_ret;
63 xcb_selinux_query_version_request_t xcb_out;
65 xcb_out.client_major = client_major;
66 xcb_out.client_minor = client_minor;
68 xcb_parts[2].iov_base = (char *) &xcb_out;
69 xcb_parts[2].iov_len = sizeof(xcb_out);
70 xcb_parts[3].iov_base = 0;
71 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
73 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
74 return xcb_ret;
77 xcb_selinux_query_version_reply_t *
78 xcb_selinux_query_version_reply (xcb_connection_t *c /**< */,
79 xcb_selinux_query_version_cookie_t cookie /**< */,
80 xcb_generic_error_t **e /**< */)
82 return (xcb_selinux_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
85 int
86 xcb_selinux_set_device_create_context_sizeof (const void *_buffer /**< */)
88 char *xcb_tmp = (char *)_buffer;
89 const xcb_selinux_set_device_create_context_request_t *_aux = (xcb_selinux_set_device_create_context_request_t *)_buffer;
90 unsigned int xcb_buffer_len = 0;
91 unsigned int xcb_block_len = 0;
92 unsigned int xcb_pad = 0;
93 unsigned int xcb_align_to = 0;
96 xcb_block_len += sizeof(xcb_selinux_set_device_create_context_request_t);
97 xcb_tmp += xcb_block_len;
98 xcb_buffer_len += xcb_block_len;
99 xcb_block_len = 0;
100 /* context */
101 xcb_block_len += _aux->context_len * sizeof(char);
102 xcb_tmp += xcb_block_len;
103 xcb_align_to = ALIGNOF(char);
104 /* insert padding */
105 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
106 xcb_buffer_len += xcb_block_len + xcb_pad;
107 if (0 != xcb_pad) {
108 xcb_tmp += xcb_pad;
109 xcb_pad = 0;
111 xcb_block_len = 0;
113 return xcb_buffer_len;
116 xcb_void_cookie_t
117 xcb_selinux_set_device_create_context_checked (xcb_connection_t *c /**< */,
118 uint32_t context_len /**< */,
119 const char *context /**< */)
121 static const xcb_protocol_request_t xcb_req = {
122 /* count */ 4,
123 /* ext */ &xcb_selinux_id,
124 /* opcode */ XCB_SELINUX_SET_DEVICE_CREATE_CONTEXT,
125 /* isvoid */ 1
128 struct iovec xcb_parts[6];
129 xcb_void_cookie_t xcb_ret;
130 xcb_selinux_set_device_create_context_request_t xcb_out;
132 xcb_out.context_len = context_len;
134 xcb_parts[2].iov_base = (char *) &xcb_out;
135 xcb_parts[2].iov_len = sizeof(xcb_out);
136 xcb_parts[3].iov_base = 0;
137 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
138 /* char context */
139 xcb_parts[4].iov_base = (char *) context;
140 xcb_parts[4].iov_len = context_len * sizeof(char);
141 xcb_parts[5].iov_base = 0;
142 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
144 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
145 return xcb_ret;
148 xcb_void_cookie_t
149 xcb_selinux_set_device_create_context (xcb_connection_t *c /**< */,
150 uint32_t context_len /**< */,
151 const char *context /**< */)
153 static const xcb_protocol_request_t xcb_req = {
154 /* count */ 4,
155 /* ext */ &xcb_selinux_id,
156 /* opcode */ XCB_SELINUX_SET_DEVICE_CREATE_CONTEXT,
157 /* isvoid */ 1
160 struct iovec xcb_parts[6];
161 xcb_void_cookie_t xcb_ret;
162 xcb_selinux_set_device_create_context_request_t xcb_out;
164 xcb_out.context_len = context_len;
166 xcb_parts[2].iov_base = (char *) &xcb_out;
167 xcb_parts[2].iov_len = sizeof(xcb_out);
168 xcb_parts[3].iov_base = 0;
169 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
170 /* char context */
171 xcb_parts[4].iov_base = (char *) context;
172 xcb_parts[4].iov_len = context_len * sizeof(char);
173 xcb_parts[5].iov_base = 0;
174 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
176 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
177 return xcb_ret;
181 xcb_selinux_get_device_create_context_sizeof (const void *_buffer /**< */)
183 char *xcb_tmp = (char *)_buffer;
184 const xcb_selinux_get_device_create_context_reply_t *_aux = (xcb_selinux_get_device_create_context_reply_t *)_buffer;
185 unsigned int xcb_buffer_len = 0;
186 unsigned int xcb_block_len = 0;
187 unsigned int xcb_pad = 0;
188 unsigned int xcb_align_to = 0;
191 xcb_block_len += sizeof(xcb_selinux_get_device_create_context_reply_t);
192 xcb_tmp += xcb_block_len;
193 xcb_buffer_len += xcb_block_len;
194 xcb_block_len = 0;
195 /* context */
196 xcb_block_len += _aux->context_len * sizeof(char);
197 xcb_tmp += xcb_block_len;
198 xcb_align_to = ALIGNOF(char);
199 /* insert padding */
200 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
201 xcb_buffer_len += xcb_block_len + xcb_pad;
202 if (0 != xcb_pad) {
203 xcb_tmp += xcb_pad;
204 xcb_pad = 0;
206 xcb_block_len = 0;
208 return xcb_buffer_len;
211 xcb_selinux_get_device_create_context_cookie_t
212 xcb_selinux_get_device_create_context (xcb_connection_t *c /**< */)
214 static const xcb_protocol_request_t xcb_req = {
215 /* count */ 2,
216 /* ext */ &xcb_selinux_id,
217 /* opcode */ XCB_SELINUX_GET_DEVICE_CREATE_CONTEXT,
218 /* isvoid */ 0
221 struct iovec xcb_parts[4];
222 xcb_selinux_get_device_create_context_cookie_t xcb_ret;
223 xcb_selinux_get_device_create_context_request_t xcb_out;
226 xcb_parts[2].iov_base = (char *) &xcb_out;
227 xcb_parts[2].iov_len = sizeof(xcb_out);
228 xcb_parts[3].iov_base = 0;
229 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
231 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
232 return xcb_ret;
235 xcb_selinux_get_device_create_context_cookie_t
236 xcb_selinux_get_device_create_context_unchecked (xcb_connection_t *c /**< */)
238 static const xcb_protocol_request_t xcb_req = {
239 /* count */ 2,
240 /* ext */ &xcb_selinux_id,
241 /* opcode */ XCB_SELINUX_GET_DEVICE_CREATE_CONTEXT,
242 /* isvoid */ 0
245 struct iovec xcb_parts[4];
246 xcb_selinux_get_device_create_context_cookie_t xcb_ret;
247 xcb_selinux_get_device_create_context_request_t xcb_out;
250 xcb_parts[2].iov_base = (char *) &xcb_out;
251 xcb_parts[2].iov_len = sizeof(xcb_out);
252 xcb_parts[3].iov_base = 0;
253 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
255 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
256 return xcb_ret;
259 char *
260 xcb_selinux_get_device_create_context_context (const xcb_selinux_get_device_create_context_reply_t *R /**< */)
262 return (char *) (R + 1);
266 xcb_selinux_get_device_create_context_context_length (const xcb_selinux_get_device_create_context_reply_t *R /**< */)
268 return R->context_len;
271 xcb_generic_iterator_t
272 xcb_selinux_get_device_create_context_context_end (const xcb_selinux_get_device_create_context_reply_t *R /**< */)
274 xcb_generic_iterator_t i;
275 i.data = ((char *) (R + 1)) + (R->context_len);
276 i.rem = 0;
277 i.index = (char *) i.data - (char *) R;
278 return i;
281 xcb_selinux_get_device_create_context_reply_t *
282 xcb_selinux_get_device_create_context_reply (xcb_connection_t *c /**< */,
283 xcb_selinux_get_device_create_context_cookie_t cookie /**< */,
284 xcb_generic_error_t **e /**< */)
286 return (xcb_selinux_get_device_create_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
290 xcb_selinux_set_device_context_sizeof (const void *_buffer /**< */)
292 char *xcb_tmp = (char *)_buffer;
293 const xcb_selinux_set_device_context_request_t *_aux = (xcb_selinux_set_device_context_request_t *)_buffer;
294 unsigned int xcb_buffer_len = 0;
295 unsigned int xcb_block_len = 0;
296 unsigned int xcb_pad = 0;
297 unsigned int xcb_align_to = 0;
300 xcb_block_len += sizeof(xcb_selinux_set_device_context_request_t);
301 xcb_tmp += xcb_block_len;
302 xcb_buffer_len += xcb_block_len;
303 xcb_block_len = 0;
304 /* context */
305 xcb_block_len += _aux->context_len * sizeof(char);
306 xcb_tmp += xcb_block_len;
307 xcb_align_to = ALIGNOF(char);
308 /* insert padding */
309 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
310 xcb_buffer_len += xcb_block_len + xcb_pad;
311 if (0 != xcb_pad) {
312 xcb_tmp += xcb_pad;
313 xcb_pad = 0;
315 xcb_block_len = 0;
317 return xcb_buffer_len;
320 xcb_void_cookie_t
321 xcb_selinux_set_device_context_checked (xcb_connection_t *c /**< */,
322 uint32_t device /**< */,
323 uint32_t context_len /**< */,
324 const char *context /**< */)
326 static const xcb_protocol_request_t xcb_req = {
327 /* count */ 4,
328 /* ext */ &xcb_selinux_id,
329 /* opcode */ XCB_SELINUX_SET_DEVICE_CONTEXT,
330 /* isvoid */ 1
333 struct iovec xcb_parts[6];
334 xcb_void_cookie_t xcb_ret;
335 xcb_selinux_set_device_context_request_t xcb_out;
337 xcb_out.device = device;
338 xcb_out.context_len = context_len;
340 xcb_parts[2].iov_base = (char *) &xcb_out;
341 xcb_parts[2].iov_len = sizeof(xcb_out);
342 xcb_parts[3].iov_base = 0;
343 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
344 /* char context */
345 xcb_parts[4].iov_base = (char *) context;
346 xcb_parts[4].iov_len = context_len * sizeof(char);
347 xcb_parts[5].iov_base = 0;
348 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
350 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
351 return xcb_ret;
354 xcb_void_cookie_t
355 xcb_selinux_set_device_context (xcb_connection_t *c /**< */,
356 uint32_t device /**< */,
357 uint32_t context_len /**< */,
358 const char *context /**< */)
360 static const xcb_protocol_request_t xcb_req = {
361 /* count */ 4,
362 /* ext */ &xcb_selinux_id,
363 /* opcode */ XCB_SELINUX_SET_DEVICE_CONTEXT,
364 /* isvoid */ 1
367 struct iovec xcb_parts[6];
368 xcb_void_cookie_t xcb_ret;
369 xcb_selinux_set_device_context_request_t xcb_out;
371 xcb_out.device = device;
372 xcb_out.context_len = context_len;
374 xcb_parts[2].iov_base = (char *) &xcb_out;
375 xcb_parts[2].iov_len = sizeof(xcb_out);
376 xcb_parts[3].iov_base = 0;
377 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
378 /* char context */
379 xcb_parts[4].iov_base = (char *) context;
380 xcb_parts[4].iov_len = context_len * sizeof(char);
381 xcb_parts[5].iov_base = 0;
382 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
384 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
385 return xcb_ret;
389 xcb_selinux_get_device_context_sizeof (const void *_buffer /**< */)
391 char *xcb_tmp = (char *)_buffer;
392 const xcb_selinux_get_device_context_reply_t *_aux = (xcb_selinux_get_device_context_reply_t *)_buffer;
393 unsigned int xcb_buffer_len = 0;
394 unsigned int xcb_block_len = 0;
395 unsigned int xcb_pad = 0;
396 unsigned int xcb_align_to = 0;
399 xcb_block_len += sizeof(xcb_selinux_get_device_context_reply_t);
400 xcb_tmp += xcb_block_len;
401 xcb_buffer_len += xcb_block_len;
402 xcb_block_len = 0;
403 /* context */
404 xcb_block_len += _aux->context_len * sizeof(char);
405 xcb_tmp += xcb_block_len;
406 xcb_align_to = ALIGNOF(char);
407 /* insert padding */
408 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
409 xcb_buffer_len += xcb_block_len + xcb_pad;
410 if (0 != xcb_pad) {
411 xcb_tmp += xcb_pad;
412 xcb_pad = 0;
414 xcb_block_len = 0;
416 return xcb_buffer_len;
419 xcb_selinux_get_device_context_cookie_t
420 xcb_selinux_get_device_context (xcb_connection_t *c /**< */,
421 uint32_t device /**< */)
423 static const xcb_protocol_request_t xcb_req = {
424 /* count */ 2,
425 /* ext */ &xcb_selinux_id,
426 /* opcode */ XCB_SELINUX_GET_DEVICE_CONTEXT,
427 /* isvoid */ 0
430 struct iovec xcb_parts[4];
431 xcb_selinux_get_device_context_cookie_t xcb_ret;
432 xcb_selinux_get_device_context_request_t xcb_out;
434 xcb_out.device = device;
436 xcb_parts[2].iov_base = (char *) &xcb_out;
437 xcb_parts[2].iov_len = sizeof(xcb_out);
438 xcb_parts[3].iov_base = 0;
439 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
441 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
442 return xcb_ret;
445 xcb_selinux_get_device_context_cookie_t
446 xcb_selinux_get_device_context_unchecked (xcb_connection_t *c /**< */,
447 uint32_t device /**< */)
449 static const xcb_protocol_request_t xcb_req = {
450 /* count */ 2,
451 /* ext */ &xcb_selinux_id,
452 /* opcode */ XCB_SELINUX_GET_DEVICE_CONTEXT,
453 /* isvoid */ 0
456 struct iovec xcb_parts[4];
457 xcb_selinux_get_device_context_cookie_t xcb_ret;
458 xcb_selinux_get_device_context_request_t xcb_out;
460 xcb_out.device = device;
462 xcb_parts[2].iov_base = (char *) &xcb_out;
463 xcb_parts[2].iov_len = sizeof(xcb_out);
464 xcb_parts[3].iov_base = 0;
465 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
467 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
468 return xcb_ret;
471 char *
472 xcb_selinux_get_device_context_context (const xcb_selinux_get_device_context_reply_t *R /**< */)
474 return (char *) (R + 1);
478 xcb_selinux_get_device_context_context_length (const xcb_selinux_get_device_context_reply_t *R /**< */)
480 return R->context_len;
483 xcb_generic_iterator_t
484 xcb_selinux_get_device_context_context_end (const xcb_selinux_get_device_context_reply_t *R /**< */)
486 xcb_generic_iterator_t i;
487 i.data = ((char *) (R + 1)) + (R->context_len);
488 i.rem = 0;
489 i.index = (char *) i.data - (char *) R;
490 return i;
493 xcb_selinux_get_device_context_reply_t *
494 xcb_selinux_get_device_context_reply (xcb_connection_t *c /**< */,
495 xcb_selinux_get_device_context_cookie_t cookie /**< */,
496 xcb_generic_error_t **e /**< */)
498 return (xcb_selinux_get_device_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
502 xcb_selinux_set_window_create_context_sizeof (const void *_buffer /**< */)
504 char *xcb_tmp = (char *)_buffer;
505 const xcb_selinux_set_window_create_context_request_t *_aux = (xcb_selinux_set_window_create_context_request_t *)_buffer;
506 unsigned int xcb_buffer_len = 0;
507 unsigned int xcb_block_len = 0;
508 unsigned int xcb_pad = 0;
509 unsigned int xcb_align_to = 0;
512 xcb_block_len += sizeof(xcb_selinux_set_window_create_context_request_t);
513 xcb_tmp += xcb_block_len;
514 xcb_buffer_len += xcb_block_len;
515 xcb_block_len = 0;
516 /* context */
517 xcb_block_len += _aux->context_len * sizeof(char);
518 xcb_tmp += xcb_block_len;
519 xcb_align_to = ALIGNOF(char);
520 /* insert padding */
521 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
522 xcb_buffer_len += xcb_block_len + xcb_pad;
523 if (0 != xcb_pad) {
524 xcb_tmp += xcb_pad;
525 xcb_pad = 0;
527 xcb_block_len = 0;
529 return xcb_buffer_len;
532 xcb_void_cookie_t
533 xcb_selinux_set_window_create_context_checked (xcb_connection_t *c /**< */,
534 uint32_t context_len /**< */,
535 const char *context /**< */)
537 static const xcb_protocol_request_t xcb_req = {
538 /* count */ 4,
539 /* ext */ &xcb_selinux_id,
540 /* opcode */ XCB_SELINUX_SET_WINDOW_CREATE_CONTEXT,
541 /* isvoid */ 1
544 struct iovec xcb_parts[6];
545 xcb_void_cookie_t xcb_ret;
546 xcb_selinux_set_window_create_context_request_t xcb_out;
548 xcb_out.context_len = context_len;
550 xcb_parts[2].iov_base = (char *) &xcb_out;
551 xcb_parts[2].iov_len = sizeof(xcb_out);
552 xcb_parts[3].iov_base = 0;
553 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
554 /* char context */
555 xcb_parts[4].iov_base = (char *) context;
556 xcb_parts[4].iov_len = context_len * sizeof(char);
557 xcb_parts[5].iov_base = 0;
558 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
560 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
561 return xcb_ret;
564 xcb_void_cookie_t
565 xcb_selinux_set_window_create_context (xcb_connection_t *c /**< */,
566 uint32_t context_len /**< */,
567 const char *context /**< */)
569 static const xcb_protocol_request_t xcb_req = {
570 /* count */ 4,
571 /* ext */ &xcb_selinux_id,
572 /* opcode */ XCB_SELINUX_SET_WINDOW_CREATE_CONTEXT,
573 /* isvoid */ 1
576 struct iovec xcb_parts[6];
577 xcb_void_cookie_t xcb_ret;
578 xcb_selinux_set_window_create_context_request_t xcb_out;
580 xcb_out.context_len = context_len;
582 xcb_parts[2].iov_base = (char *) &xcb_out;
583 xcb_parts[2].iov_len = sizeof(xcb_out);
584 xcb_parts[3].iov_base = 0;
585 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
586 /* char context */
587 xcb_parts[4].iov_base = (char *) context;
588 xcb_parts[4].iov_len = context_len * sizeof(char);
589 xcb_parts[5].iov_base = 0;
590 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
592 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
593 return xcb_ret;
597 xcb_selinux_get_window_create_context_sizeof (const void *_buffer /**< */)
599 char *xcb_tmp = (char *)_buffer;
600 const xcb_selinux_get_window_create_context_reply_t *_aux = (xcb_selinux_get_window_create_context_reply_t *)_buffer;
601 unsigned int xcb_buffer_len = 0;
602 unsigned int xcb_block_len = 0;
603 unsigned int xcb_pad = 0;
604 unsigned int xcb_align_to = 0;
607 xcb_block_len += sizeof(xcb_selinux_get_window_create_context_reply_t);
608 xcb_tmp += xcb_block_len;
609 xcb_buffer_len += xcb_block_len;
610 xcb_block_len = 0;
611 /* context */
612 xcb_block_len += _aux->context_len * sizeof(char);
613 xcb_tmp += xcb_block_len;
614 xcb_align_to = ALIGNOF(char);
615 /* insert padding */
616 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
617 xcb_buffer_len += xcb_block_len + xcb_pad;
618 if (0 != xcb_pad) {
619 xcb_tmp += xcb_pad;
620 xcb_pad = 0;
622 xcb_block_len = 0;
624 return xcb_buffer_len;
627 xcb_selinux_get_window_create_context_cookie_t
628 xcb_selinux_get_window_create_context (xcb_connection_t *c /**< */)
630 static const xcb_protocol_request_t xcb_req = {
631 /* count */ 2,
632 /* ext */ &xcb_selinux_id,
633 /* opcode */ XCB_SELINUX_GET_WINDOW_CREATE_CONTEXT,
634 /* isvoid */ 0
637 struct iovec xcb_parts[4];
638 xcb_selinux_get_window_create_context_cookie_t xcb_ret;
639 xcb_selinux_get_window_create_context_request_t xcb_out;
642 xcb_parts[2].iov_base = (char *) &xcb_out;
643 xcb_parts[2].iov_len = sizeof(xcb_out);
644 xcb_parts[3].iov_base = 0;
645 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
647 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
648 return xcb_ret;
651 xcb_selinux_get_window_create_context_cookie_t
652 xcb_selinux_get_window_create_context_unchecked (xcb_connection_t *c /**< */)
654 static const xcb_protocol_request_t xcb_req = {
655 /* count */ 2,
656 /* ext */ &xcb_selinux_id,
657 /* opcode */ XCB_SELINUX_GET_WINDOW_CREATE_CONTEXT,
658 /* isvoid */ 0
661 struct iovec xcb_parts[4];
662 xcb_selinux_get_window_create_context_cookie_t xcb_ret;
663 xcb_selinux_get_window_create_context_request_t xcb_out;
666 xcb_parts[2].iov_base = (char *) &xcb_out;
667 xcb_parts[2].iov_len = sizeof(xcb_out);
668 xcb_parts[3].iov_base = 0;
669 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
671 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
672 return xcb_ret;
675 char *
676 xcb_selinux_get_window_create_context_context (const xcb_selinux_get_window_create_context_reply_t *R /**< */)
678 return (char *) (R + 1);
682 xcb_selinux_get_window_create_context_context_length (const xcb_selinux_get_window_create_context_reply_t *R /**< */)
684 return R->context_len;
687 xcb_generic_iterator_t
688 xcb_selinux_get_window_create_context_context_end (const xcb_selinux_get_window_create_context_reply_t *R /**< */)
690 xcb_generic_iterator_t i;
691 i.data = ((char *) (R + 1)) + (R->context_len);
692 i.rem = 0;
693 i.index = (char *) i.data - (char *) R;
694 return i;
697 xcb_selinux_get_window_create_context_reply_t *
698 xcb_selinux_get_window_create_context_reply (xcb_connection_t *c /**< */,
699 xcb_selinux_get_window_create_context_cookie_t cookie /**< */,
700 xcb_generic_error_t **e /**< */)
702 return (xcb_selinux_get_window_create_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
706 xcb_selinux_get_window_context_sizeof (const void *_buffer /**< */)
708 char *xcb_tmp = (char *)_buffer;
709 const xcb_selinux_get_window_context_reply_t *_aux = (xcb_selinux_get_window_context_reply_t *)_buffer;
710 unsigned int xcb_buffer_len = 0;
711 unsigned int xcb_block_len = 0;
712 unsigned int xcb_pad = 0;
713 unsigned int xcb_align_to = 0;
716 xcb_block_len += sizeof(xcb_selinux_get_window_context_reply_t);
717 xcb_tmp += xcb_block_len;
718 xcb_buffer_len += xcb_block_len;
719 xcb_block_len = 0;
720 /* context */
721 xcb_block_len += _aux->context_len * sizeof(char);
722 xcb_tmp += xcb_block_len;
723 xcb_align_to = ALIGNOF(char);
724 /* insert padding */
725 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
726 xcb_buffer_len += xcb_block_len + xcb_pad;
727 if (0 != xcb_pad) {
728 xcb_tmp += xcb_pad;
729 xcb_pad = 0;
731 xcb_block_len = 0;
733 return xcb_buffer_len;
736 xcb_selinux_get_window_context_cookie_t
737 xcb_selinux_get_window_context (xcb_connection_t *c /**< */,
738 xcb_window_t window /**< */)
740 static const xcb_protocol_request_t xcb_req = {
741 /* count */ 2,
742 /* ext */ &xcb_selinux_id,
743 /* opcode */ XCB_SELINUX_GET_WINDOW_CONTEXT,
744 /* isvoid */ 0
747 struct iovec xcb_parts[4];
748 xcb_selinux_get_window_context_cookie_t xcb_ret;
749 xcb_selinux_get_window_context_request_t xcb_out;
751 xcb_out.window = window;
753 xcb_parts[2].iov_base = (char *) &xcb_out;
754 xcb_parts[2].iov_len = sizeof(xcb_out);
755 xcb_parts[3].iov_base = 0;
756 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
758 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
759 return xcb_ret;
762 xcb_selinux_get_window_context_cookie_t
763 xcb_selinux_get_window_context_unchecked (xcb_connection_t *c /**< */,
764 xcb_window_t window /**< */)
766 static const xcb_protocol_request_t xcb_req = {
767 /* count */ 2,
768 /* ext */ &xcb_selinux_id,
769 /* opcode */ XCB_SELINUX_GET_WINDOW_CONTEXT,
770 /* isvoid */ 0
773 struct iovec xcb_parts[4];
774 xcb_selinux_get_window_context_cookie_t xcb_ret;
775 xcb_selinux_get_window_context_request_t xcb_out;
777 xcb_out.window = window;
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;
784 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
785 return xcb_ret;
788 char *
789 xcb_selinux_get_window_context_context (const xcb_selinux_get_window_context_reply_t *R /**< */)
791 return (char *) (R + 1);
795 xcb_selinux_get_window_context_context_length (const xcb_selinux_get_window_context_reply_t *R /**< */)
797 return R->context_len;
800 xcb_generic_iterator_t
801 xcb_selinux_get_window_context_context_end (const xcb_selinux_get_window_context_reply_t *R /**< */)
803 xcb_generic_iterator_t i;
804 i.data = ((char *) (R + 1)) + (R->context_len);
805 i.rem = 0;
806 i.index = (char *) i.data - (char *) R;
807 return i;
810 xcb_selinux_get_window_context_reply_t *
811 xcb_selinux_get_window_context_reply (xcb_connection_t *c /**< */,
812 xcb_selinux_get_window_context_cookie_t cookie /**< */,
813 xcb_generic_error_t **e /**< */)
815 return (xcb_selinux_get_window_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
819 xcb_selinux_list_item_sizeof (const void *_buffer /**< */)
821 char *xcb_tmp = (char *)_buffer;
822 const xcb_selinux_list_item_t *_aux = (xcb_selinux_list_item_t *)_buffer;
823 unsigned int xcb_buffer_len = 0;
824 unsigned int xcb_block_len = 0;
825 unsigned int xcb_pad = 0;
826 unsigned int xcb_align_to = 0;
829 xcb_block_len += sizeof(xcb_selinux_list_item_t);
830 xcb_tmp += xcb_block_len;
831 xcb_buffer_len += xcb_block_len;
832 xcb_block_len = 0;
833 /* object_context */
834 xcb_block_len += _aux->object_context_len * sizeof(char);
835 xcb_tmp += xcb_block_len;
836 xcb_align_to = ALIGNOF(char);
837 /* insert padding */
838 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
839 xcb_buffer_len += xcb_block_len + xcb_pad;
840 if (0 != xcb_pad) {
841 xcb_tmp += xcb_pad;
842 xcb_pad = 0;
844 xcb_block_len = 0;
845 /* data_context */
846 xcb_block_len += _aux->data_context_len * sizeof(char);
847 xcb_tmp += xcb_block_len;
848 xcb_align_to = ALIGNOF(char);
849 /* insert padding */
850 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
851 xcb_buffer_len += xcb_block_len + xcb_pad;
852 if (0 != xcb_pad) {
853 xcb_tmp += xcb_pad;
854 xcb_pad = 0;
856 xcb_block_len = 0;
858 return xcb_buffer_len;
861 char *
862 xcb_selinux_list_item_object_context (const xcb_selinux_list_item_t *R /**< */)
864 return (char *) (R + 1);
868 xcb_selinux_list_item_object_context_length (const xcb_selinux_list_item_t *R /**< */)
870 return R->object_context_len;
873 xcb_generic_iterator_t
874 xcb_selinux_list_item_object_context_end (const xcb_selinux_list_item_t *R /**< */)
876 xcb_generic_iterator_t i;
877 i.data = ((char *) (R + 1)) + (R->object_context_len);
878 i.rem = 0;
879 i.index = (char *) i.data - (char *) R;
880 return i;
883 char *
884 xcb_selinux_list_item_data_context (const xcb_selinux_list_item_t *R /**< */)
886 xcb_generic_iterator_t prev = xcb_selinux_list_item_object_context_end(R);
887 return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
891 xcb_selinux_list_item_data_context_length (const xcb_selinux_list_item_t *R /**< */)
893 return R->data_context_len;
896 xcb_generic_iterator_t
897 xcb_selinux_list_item_data_context_end (const xcb_selinux_list_item_t *R /**< */)
899 xcb_generic_iterator_t i;
900 xcb_generic_iterator_t child = xcb_selinux_list_item_object_context_end(R);
901 i.data = ((char *) child.data) + (R->data_context_len);
902 i.rem = 0;
903 i.index = (char *) i.data - (char *) R;
904 return i;
907 void
908 xcb_selinux_list_item_next (xcb_selinux_list_item_iterator_t *i /**< */)
910 xcb_selinux_list_item_t *R = i->data;
911 xcb_generic_iterator_t child;
912 child.data = (xcb_selinux_list_item_t *)(((char *)R) + xcb_selinux_list_item_sizeof(R));
913 i->index = (char *) child.data - (char *) i->data;
914 --i->rem;
915 i->data = (xcb_selinux_list_item_t *) child.data;
918 xcb_generic_iterator_t
919 xcb_selinux_list_item_end (xcb_selinux_list_item_iterator_t i /**< */)
921 xcb_generic_iterator_t ret;
922 while(i.rem > 0)
923 xcb_selinux_list_item_next(&i);
924 ret.data = i.data;
925 ret.rem = i.rem;
926 ret.index = i.index;
927 return ret;
931 xcb_selinux_set_property_create_context_sizeof (const void *_buffer /**< */)
933 char *xcb_tmp = (char *)_buffer;
934 const xcb_selinux_set_property_create_context_request_t *_aux = (xcb_selinux_set_property_create_context_request_t *)_buffer;
935 unsigned int xcb_buffer_len = 0;
936 unsigned int xcb_block_len = 0;
937 unsigned int xcb_pad = 0;
938 unsigned int xcb_align_to = 0;
941 xcb_block_len += sizeof(xcb_selinux_set_property_create_context_request_t);
942 xcb_tmp += xcb_block_len;
943 xcb_buffer_len += xcb_block_len;
944 xcb_block_len = 0;
945 /* context */
946 xcb_block_len += _aux->context_len * sizeof(char);
947 xcb_tmp += xcb_block_len;
948 xcb_align_to = ALIGNOF(char);
949 /* insert padding */
950 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
951 xcb_buffer_len += xcb_block_len + xcb_pad;
952 if (0 != xcb_pad) {
953 xcb_tmp += xcb_pad;
954 xcb_pad = 0;
956 xcb_block_len = 0;
958 return xcb_buffer_len;
961 xcb_void_cookie_t
962 xcb_selinux_set_property_create_context_checked (xcb_connection_t *c /**< */,
963 uint32_t context_len /**< */,
964 const char *context /**< */)
966 static const xcb_protocol_request_t xcb_req = {
967 /* count */ 4,
968 /* ext */ &xcb_selinux_id,
969 /* opcode */ XCB_SELINUX_SET_PROPERTY_CREATE_CONTEXT,
970 /* isvoid */ 1
973 struct iovec xcb_parts[6];
974 xcb_void_cookie_t xcb_ret;
975 xcb_selinux_set_property_create_context_request_t xcb_out;
977 xcb_out.context_len = context_len;
979 xcb_parts[2].iov_base = (char *) &xcb_out;
980 xcb_parts[2].iov_len = sizeof(xcb_out);
981 xcb_parts[3].iov_base = 0;
982 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
983 /* char context */
984 xcb_parts[4].iov_base = (char *) context;
985 xcb_parts[4].iov_len = context_len * sizeof(char);
986 xcb_parts[5].iov_base = 0;
987 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
989 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
990 return xcb_ret;
993 xcb_void_cookie_t
994 xcb_selinux_set_property_create_context (xcb_connection_t *c /**< */,
995 uint32_t context_len /**< */,
996 const char *context /**< */)
998 static const xcb_protocol_request_t xcb_req = {
999 /* count */ 4,
1000 /* ext */ &xcb_selinux_id,
1001 /* opcode */ XCB_SELINUX_SET_PROPERTY_CREATE_CONTEXT,
1002 /* isvoid */ 1
1005 struct iovec xcb_parts[6];
1006 xcb_void_cookie_t xcb_ret;
1007 xcb_selinux_set_property_create_context_request_t xcb_out;
1009 xcb_out.context_len = context_len;
1011 xcb_parts[2].iov_base = (char *) &xcb_out;
1012 xcb_parts[2].iov_len = sizeof(xcb_out);
1013 xcb_parts[3].iov_base = 0;
1014 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1015 /* char context */
1016 xcb_parts[4].iov_base = (char *) context;
1017 xcb_parts[4].iov_len = context_len * sizeof(char);
1018 xcb_parts[5].iov_base = 0;
1019 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1021 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1022 return xcb_ret;
1026 xcb_selinux_get_property_create_context_sizeof (const void *_buffer /**< */)
1028 char *xcb_tmp = (char *)_buffer;
1029 const xcb_selinux_get_property_create_context_reply_t *_aux = (xcb_selinux_get_property_create_context_reply_t *)_buffer;
1030 unsigned int xcb_buffer_len = 0;
1031 unsigned int xcb_block_len = 0;
1032 unsigned int xcb_pad = 0;
1033 unsigned int xcb_align_to = 0;
1036 xcb_block_len += sizeof(xcb_selinux_get_property_create_context_reply_t);
1037 xcb_tmp += xcb_block_len;
1038 xcb_buffer_len += xcb_block_len;
1039 xcb_block_len = 0;
1040 /* context */
1041 xcb_block_len += _aux->context_len * sizeof(char);
1042 xcb_tmp += xcb_block_len;
1043 xcb_align_to = ALIGNOF(char);
1044 /* insert padding */
1045 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1046 xcb_buffer_len += xcb_block_len + xcb_pad;
1047 if (0 != xcb_pad) {
1048 xcb_tmp += xcb_pad;
1049 xcb_pad = 0;
1051 xcb_block_len = 0;
1053 return xcb_buffer_len;
1056 xcb_selinux_get_property_create_context_cookie_t
1057 xcb_selinux_get_property_create_context (xcb_connection_t *c /**< */)
1059 static const xcb_protocol_request_t xcb_req = {
1060 /* count */ 2,
1061 /* ext */ &xcb_selinux_id,
1062 /* opcode */ XCB_SELINUX_GET_PROPERTY_CREATE_CONTEXT,
1063 /* isvoid */ 0
1066 struct iovec xcb_parts[4];
1067 xcb_selinux_get_property_create_context_cookie_t xcb_ret;
1068 xcb_selinux_get_property_create_context_request_t xcb_out;
1071 xcb_parts[2].iov_base = (char *) &xcb_out;
1072 xcb_parts[2].iov_len = sizeof(xcb_out);
1073 xcb_parts[3].iov_base = 0;
1074 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1076 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1077 return xcb_ret;
1080 xcb_selinux_get_property_create_context_cookie_t
1081 xcb_selinux_get_property_create_context_unchecked (xcb_connection_t *c /**< */)
1083 static const xcb_protocol_request_t xcb_req = {
1084 /* count */ 2,
1085 /* ext */ &xcb_selinux_id,
1086 /* opcode */ XCB_SELINUX_GET_PROPERTY_CREATE_CONTEXT,
1087 /* isvoid */ 0
1090 struct iovec xcb_parts[4];
1091 xcb_selinux_get_property_create_context_cookie_t xcb_ret;
1092 xcb_selinux_get_property_create_context_request_t xcb_out;
1095 xcb_parts[2].iov_base = (char *) &xcb_out;
1096 xcb_parts[2].iov_len = sizeof(xcb_out);
1097 xcb_parts[3].iov_base = 0;
1098 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1100 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1101 return xcb_ret;
1104 char *
1105 xcb_selinux_get_property_create_context_context (const xcb_selinux_get_property_create_context_reply_t *R /**< */)
1107 return (char *) (R + 1);
1111 xcb_selinux_get_property_create_context_context_length (const xcb_selinux_get_property_create_context_reply_t *R /**< */)
1113 return R->context_len;
1116 xcb_generic_iterator_t
1117 xcb_selinux_get_property_create_context_context_end (const xcb_selinux_get_property_create_context_reply_t *R /**< */)
1119 xcb_generic_iterator_t i;
1120 i.data = ((char *) (R + 1)) + (R->context_len);
1121 i.rem = 0;
1122 i.index = (char *) i.data - (char *) R;
1123 return i;
1126 xcb_selinux_get_property_create_context_reply_t *
1127 xcb_selinux_get_property_create_context_reply (xcb_connection_t *c /**< */,
1128 xcb_selinux_get_property_create_context_cookie_t cookie /**< */,
1129 xcb_generic_error_t **e /**< */)
1131 return (xcb_selinux_get_property_create_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1135 xcb_selinux_set_property_use_context_sizeof (const void *_buffer /**< */)
1137 char *xcb_tmp = (char *)_buffer;
1138 const xcb_selinux_set_property_use_context_request_t *_aux = (xcb_selinux_set_property_use_context_request_t *)_buffer;
1139 unsigned int xcb_buffer_len = 0;
1140 unsigned int xcb_block_len = 0;
1141 unsigned int xcb_pad = 0;
1142 unsigned int xcb_align_to = 0;
1145 xcb_block_len += sizeof(xcb_selinux_set_property_use_context_request_t);
1146 xcb_tmp += xcb_block_len;
1147 xcb_buffer_len += xcb_block_len;
1148 xcb_block_len = 0;
1149 /* context */
1150 xcb_block_len += _aux->context_len * sizeof(char);
1151 xcb_tmp += xcb_block_len;
1152 xcb_align_to = ALIGNOF(char);
1153 /* insert padding */
1154 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1155 xcb_buffer_len += xcb_block_len + xcb_pad;
1156 if (0 != xcb_pad) {
1157 xcb_tmp += xcb_pad;
1158 xcb_pad = 0;
1160 xcb_block_len = 0;
1162 return xcb_buffer_len;
1165 xcb_void_cookie_t
1166 xcb_selinux_set_property_use_context_checked (xcb_connection_t *c /**< */,
1167 uint32_t context_len /**< */,
1168 const char *context /**< */)
1170 static const xcb_protocol_request_t xcb_req = {
1171 /* count */ 4,
1172 /* ext */ &xcb_selinux_id,
1173 /* opcode */ XCB_SELINUX_SET_PROPERTY_USE_CONTEXT,
1174 /* isvoid */ 1
1177 struct iovec xcb_parts[6];
1178 xcb_void_cookie_t xcb_ret;
1179 xcb_selinux_set_property_use_context_request_t xcb_out;
1181 xcb_out.context_len = context_len;
1183 xcb_parts[2].iov_base = (char *) &xcb_out;
1184 xcb_parts[2].iov_len = sizeof(xcb_out);
1185 xcb_parts[3].iov_base = 0;
1186 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1187 /* char context */
1188 xcb_parts[4].iov_base = (char *) context;
1189 xcb_parts[4].iov_len = context_len * sizeof(char);
1190 xcb_parts[5].iov_base = 0;
1191 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1193 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1194 return xcb_ret;
1197 xcb_void_cookie_t
1198 xcb_selinux_set_property_use_context (xcb_connection_t *c /**< */,
1199 uint32_t context_len /**< */,
1200 const char *context /**< */)
1202 static const xcb_protocol_request_t xcb_req = {
1203 /* count */ 4,
1204 /* ext */ &xcb_selinux_id,
1205 /* opcode */ XCB_SELINUX_SET_PROPERTY_USE_CONTEXT,
1206 /* isvoid */ 1
1209 struct iovec xcb_parts[6];
1210 xcb_void_cookie_t xcb_ret;
1211 xcb_selinux_set_property_use_context_request_t xcb_out;
1213 xcb_out.context_len = context_len;
1215 xcb_parts[2].iov_base = (char *) &xcb_out;
1216 xcb_parts[2].iov_len = sizeof(xcb_out);
1217 xcb_parts[3].iov_base = 0;
1218 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1219 /* char context */
1220 xcb_parts[4].iov_base = (char *) context;
1221 xcb_parts[4].iov_len = context_len * sizeof(char);
1222 xcb_parts[5].iov_base = 0;
1223 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1225 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1226 return xcb_ret;
1230 xcb_selinux_get_property_use_context_sizeof (const void *_buffer /**< */)
1232 char *xcb_tmp = (char *)_buffer;
1233 const xcb_selinux_get_property_use_context_reply_t *_aux = (xcb_selinux_get_property_use_context_reply_t *)_buffer;
1234 unsigned int xcb_buffer_len = 0;
1235 unsigned int xcb_block_len = 0;
1236 unsigned int xcb_pad = 0;
1237 unsigned int xcb_align_to = 0;
1240 xcb_block_len += sizeof(xcb_selinux_get_property_use_context_reply_t);
1241 xcb_tmp += xcb_block_len;
1242 xcb_buffer_len += xcb_block_len;
1243 xcb_block_len = 0;
1244 /* context */
1245 xcb_block_len += _aux->context_len * sizeof(char);
1246 xcb_tmp += xcb_block_len;
1247 xcb_align_to = ALIGNOF(char);
1248 /* insert padding */
1249 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1250 xcb_buffer_len += xcb_block_len + xcb_pad;
1251 if (0 != xcb_pad) {
1252 xcb_tmp += xcb_pad;
1253 xcb_pad = 0;
1255 xcb_block_len = 0;
1257 return xcb_buffer_len;
1260 xcb_selinux_get_property_use_context_cookie_t
1261 xcb_selinux_get_property_use_context (xcb_connection_t *c /**< */)
1263 static const xcb_protocol_request_t xcb_req = {
1264 /* count */ 2,
1265 /* ext */ &xcb_selinux_id,
1266 /* opcode */ XCB_SELINUX_GET_PROPERTY_USE_CONTEXT,
1267 /* isvoid */ 0
1270 struct iovec xcb_parts[4];
1271 xcb_selinux_get_property_use_context_cookie_t xcb_ret;
1272 xcb_selinux_get_property_use_context_request_t xcb_out;
1275 xcb_parts[2].iov_base = (char *) &xcb_out;
1276 xcb_parts[2].iov_len = sizeof(xcb_out);
1277 xcb_parts[3].iov_base = 0;
1278 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1280 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1281 return xcb_ret;
1284 xcb_selinux_get_property_use_context_cookie_t
1285 xcb_selinux_get_property_use_context_unchecked (xcb_connection_t *c /**< */)
1287 static const xcb_protocol_request_t xcb_req = {
1288 /* count */ 2,
1289 /* ext */ &xcb_selinux_id,
1290 /* opcode */ XCB_SELINUX_GET_PROPERTY_USE_CONTEXT,
1291 /* isvoid */ 0
1294 struct iovec xcb_parts[4];
1295 xcb_selinux_get_property_use_context_cookie_t xcb_ret;
1296 xcb_selinux_get_property_use_context_request_t xcb_out;
1299 xcb_parts[2].iov_base = (char *) &xcb_out;
1300 xcb_parts[2].iov_len = sizeof(xcb_out);
1301 xcb_parts[3].iov_base = 0;
1302 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1304 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1305 return xcb_ret;
1308 char *
1309 xcb_selinux_get_property_use_context_context (const xcb_selinux_get_property_use_context_reply_t *R /**< */)
1311 return (char *) (R + 1);
1315 xcb_selinux_get_property_use_context_context_length (const xcb_selinux_get_property_use_context_reply_t *R /**< */)
1317 return R->context_len;
1320 xcb_generic_iterator_t
1321 xcb_selinux_get_property_use_context_context_end (const xcb_selinux_get_property_use_context_reply_t *R /**< */)
1323 xcb_generic_iterator_t i;
1324 i.data = ((char *) (R + 1)) + (R->context_len);
1325 i.rem = 0;
1326 i.index = (char *) i.data - (char *) R;
1327 return i;
1330 xcb_selinux_get_property_use_context_reply_t *
1331 xcb_selinux_get_property_use_context_reply (xcb_connection_t *c /**< */,
1332 xcb_selinux_get_property_use_context_cookie_t cookie /**< */,
1333 xcb_generic_error_t **e /**< */)
1335 return (xcb_selinux_get_property_use_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1339 xcb_selinux_get_property_context_sizeof (const void *_buffer /**< */)
1341 char *xcb_tmp = (char *)_buffer;
1342 const xcb_selinux_get_property_context_reply_t *_aux = (xcb_selinux_get_property_context_reply_t *)_buffer;
1343 unsigned int xcb_buffer_len = 0;
1344 unsigned int xcb_block_len = 0;
1345 unsigned int xcb_pad = 0;
1346 unsigned int xcb_align_to = 0;
1349 xcb_block_len += sizeof(xcb_selinux_get_property_context_reply_t);
1350 xcb_tmp += xcb_block_len;
1351 xcb_buffer_len += xcb_block_len;
1352 xcb_block_len = 0;
1353 /* context */
1354 xcb_block_len += _aux->context_len * sizeof(char);
1355 xcb_tmp += xcb_block_len;
1356 xcb_align_to = ALIGNOF(char);
1357 /* insert padding */
1358 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1359 xcb_buffer_len += xcb_block_len + xcb_pad;
1360 if (0 != xcb_pad) {
1361 xcb_tmp += xcb_pad;
1362 xcb_pad = 0;
1364 xcb_block_len = 0;
1366 return xcb_buffer_len;
1369 xcb_selinux_get_property_context_cookie_t
1370 xcb_selinux_get_property_context (xcb_connection_t *c /**< */,
1371 xcb_window_t window /**< */,
1372 xcb_atom_t property /**< */)
1374 static const xcb_protocol_request_t xcb_req = {
1375 /* count */ 2,
1376 /* ext */ &xcb_selinux_id,
1377 /* opcode */ XCB_SELINUX_GET_PROPERTY_CONTEXT,
1378 /* isvoid */ 0
1381 struct iovec xcb_parts[4];
1382 xcb_selinux_get_property_context_cookie_t xcb_ret;
1383 xcb_selinux_get_property_context_request_t xcb_out;
1385 xcb_out.window = window;
1386 xcb_out.property = property;
1388 xcb_parts[2].iov_base = (char *) &xcb_out;
1389 xcb_parts[2].iov_len = sizeof(xcb_out);
1390 xcb_parts[3].iov_base = 0;
1391 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1393 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1394 return xcb_ret;
1397 xcb_selinux_get_property_context_cookie_t
1398 xcb_selinux_get_property_context_unchecked (xcb_connection_t *c /**< */,
1399 xcb_window_t window /**< */,
1400 xcb_atom_t property /**< */)
1402 static const xcb_protocol_request_t xcb_req = {
1403 /* count */ 2,
1404 /* ext */ &xcb_selinux_id,
1405 /* opcode */ XCB_SELINUX_GET_PROPERTY_CONTEXT,
1406 /* isvoid */ 0
1409 struct iovec xcb_parts[4];
1410 xcb_selinux_get_property_context_cookie_t xcb_ret;
1411 xcb_selinux_get_property_context_request_t xcb_out;
1413 xcb_out.window = window;
1414 xcb_out.property = property;
1416 xcb_parts[2].iov_base = (char *) &xcb_out;
1417 xcb_parts[2].iov_len = sizeof(xcb_out);
1418 xcb_parts[3].iov_base = 0;
1419 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1421 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1422 return xcb_ret;
1425 char *
1426 xcb_selinux_get_property_context_context (const xcb_selinux_get_property_context_reply_t *R /**< */)
1428 return (char *) (R + 1);
1432 xcb_selinux_get_property_context_context_length (const xcb_selinux_get_property_context_reply_t *R /**< */)
1434 return R->context_len;
1437 xcb_generic_iterator_t
1438 xcb_selinux_get_property_context_context_end (const xcb_selinux_get_property_context_reply_t *R /**< */)
1440 xcb_generic_iterator_t i;
1441 i.data = ((char *) (R + 1)) + (R->context_len);
1442 i.rem = 0;
1443 i.index = (char *) i.data - (char *) R;
1444 return i;
1447 xcb_selinux_get_property_context_reply_t *
1448 xcb_selinux_get_property_context_reply (xcb_connection_t *c /**< */,
1449 xcb_selinux_get_property_context_cookie_t cookie /**< */,
1450 xcb_generic_error_t **e /**< */)
1452 return (xcb_selinux_get_property_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1456 xcb_selinux_get_property_data_context_sizeof (const void *_buffer /**< */)
1458 char *xcb_tmp = (char *)_buffer;
1459 const xcb_selinux_get_property_data_context_reply_t *_aux = (xcb_selinux_get_property_data_context_reply_t *)_buffer;
1460 unsigned int xcb_buffer_len = 0;
1461 unsigned int xcb_block_len = 0;
1462 unsigned int xcb_pad = 0;
1463 unsigned int xcb_align_to = 0;
1466 xcb_block_len += sizeof(xcb_selinux_get_property_data_context_reply_t);
1467 xcb_tmp += xcb_block_len;
1468 xcb_buffer_len += xcb_block_len;
1469 xcb_block_len = 0;
1470 /* context */
1471 xcb_block_len += _aux->context_len * sizeof(char);
1472 xcb_tmp += xcb_block_len;
1473 xcb_align_to = ALIGNOF(char);
1474 /* insert padding */
1475 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1476 xcb_buffer_len += xcb_block_len + xcb_pad;
1477 if (0 != xcb_pad) {
1478 xcb_tmp += xcb_pad;
1479 xcb_pad = 0;
1481 xcb_block_len = 0;
1483 return xcb_buffer_len;
1486 xcb_selinux_get_property_data_context_cookie_t
1487 xcb_selinux_get_property_data_context (xcb_connection_t *c /**< */,
1488 xcb_window_t window /**< */,
1489 xcb_atom_t property /**< */)
1491 static const xcb_protocol_request_t xcb_req = {
1492 /* count */ 2,
1493 /* ext */ &xcb_selinux_id,
1494 /* opcode */ XCB_SELINUX_GET_PROPERTY_DATA_CONTEXT,
1495 /* isvoid */ 0
1498 struct iovec xcb_parts[4];
1499 xcb_selinux_get_property_data_context_cookie_t xcb_ret;
1500 xcb_selinux_get_property_data_context_request_t xcb_out;
1502 xcb_out.window = window;
1503 xcb_out.property = property;
1505 xcb_parts[2].iov_base = (char *) &xcb_out;
1506 xcb_parts[2].iov_len = sizeof(xcb_out);
1507 xcb_parts[3].iov_base = 0;
1508 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1510 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1511 return xcb_ret;
1514 xcb_selinux_get_property_data_context_cookie_t
1515 xcb_selinux_get_property_data_context_unchecked (xcb_connection_t *c /**< */,
1516 xcb_window_t window /**< */,
1517 xcb_atom_t property /**< */)
1519 static const xcb_protocol_request_t xcb_req = {
1520 /* count */ 2,
1521 /* ext */ &xcb_selinux_id,
1522 /* opcode */ XCB_SELINUX_GET_PROPERTY_DATA_CONTEXT,
1523 /* isvoid */ 0
1526 struct iovec xcb_parts[4];
1527 xcb_selinux_get_property_data_context_cookie_t xcb_ret;
1528 xcb_selinux_get_property_data_context_request_t xcb_out;
1530 xcb_out.window = window;
1531 xcb_out.property = property;
1533 xcb_parts[2].iov_base = (char *) &xcb_out;
1534 xcb_parts[2].iov_len = sizeof(xcb_out);
1535 xcb_parts[3].iov_base = 0;
1536 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1538 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1539 return xcb_ret;
1542 char *
1543 xcb_selinux_get_property_data_context_context (const xcb_selinux_get_property_data_context_reply_t *R /**< */)
1545 return (char *) (R + 1);
1549 xcb_selinux_get_property_data_context_context_length (const xcb_selinux_get_property_data_context_reply_t *R /**< */)
1551 return R->context_len;
1554 xcb_generic_iterator_t
1555 xcb_selinux_get_property_data_context_context_end (const xcb_selinux_get_property_data_context_reply_t *R /**< */)
1557 xcb_generic_iterator_t i;
1558 i.data = ((char *) (R + 1)) + (R->context_len);
1559 i.rem = 0;
1560 i.index = (char *) i.data - (char *) R;
1561 return i;
1564 xcb_selinux_get_property_data_context_reply_t *
1565 xcb_selinux_get_property_data_context_reply (xcb_connection_t *c /**< */,
1566 xcb_selinux_get_property_data_context_cookie_t cookie /**< */,
1567 xcb_generic_error_t **e /**< */)
1569 return (xcb_selinux_get_property_data_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1573 xcb_selinux_list_properties_sizeof (const void *_buffer /**< */)
1575 char *xcb_tmp = (char *)_buffer;
1576 const xcb_selinux_list_properties_reply_t *_aux = (xcb_selinux_list_properties_reply_t *)_buffer;
1577 unsigned int xcb_buffer_len = 0;
1578 unsigned int xcb_block_len = 0;
1579 unsigned int xcb_pad = 0;
1580 unsigned int xcb_align_to = 0;
1582 unsigned int i;
1583 unsigned int xcb_tmp_len;
1585 xcb_block_len += sizeof(xcb_selinux_list_properties_reply_t);
1586 xcb_tmp += xcb_block_len;
1587 xcb_buffer_len += xcb_block_len;
1588 xcb_block_len = 0;
1589 /* properties */
1590 for(i=0; i<_aux->properties_len; i++) {
1591 xcb_tmp_len = xcb_selinux_list_item_sizeof(xcb_tmp);
1592 xcb_block_len += xcb_tmp_len;
1593 xcb_tmp += xcb_tmp_len;
1595 xcb_align_to = ALIGNOF(xcb_selinux_list_item_t);
1596 /* insert padding */
1597 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1598 xcb_buffer_len += xcb_block_len + xcb_pad;
1599 if (0 != xcb_pad) {
1600 xcb_tmp += xcb_pad;
1601 xcb_pad = 0;
1603 xcb_block_len = 0;
1605 return xcb_buffer_len;
1608 xcb_selinux_list_properties_cookie_t
1609 xcb_selinux_list_properties (xcb_connection_t *c /**< */,
1610 xcb_window_t window /**< */)
1612 static const xcb_protocol_request_t xcb_req = {
1613 /* count */ 2,
1614 /* ext */ &xcb_selinux_id,
1615 /* opcode */ XCB_SELINUX_LIST_PROPERTIES,
1616 /* isvoid */ 0
1619 struct iovec xcb_parts[4];
1620 xcb_selinux_list_properties_cookie_t xcb_ret;
1621 xcb_selinux_list_properties_request_t xcb_out;
1623 xcb_out.window = window;
1625 xcb_parts[2].iov_base = (char *) &xcb_out;
1626 xcb_parts[2].iov_len = sizeof(xcb_out);
1627 xcb_parts[3].iov_base = 0;
1628 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1630 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1631 return xcb_ret;
1634 xcb_selinux_list_properties_cookie_t
1635 xcb_selinux_list_properties_unchecked (xcb_connection_t *c /**< */,
1636 xcb_window_t window /**< */)
1638 static const xcb_protocol_request_t xcb_req = {
1639 /* count */ 2,
1640 /* ext */ &xcb_selinux_id,
1641 /* opcode */ XCB_SELINUX_LIST_PROPERTIES,
1642 /* isvoid */ 0
1645 struct iovec xcb_parts[4];
1646 xcb_selinux_list_properties_cookie_t xcb_ret;
1647 xcb_selinux_list_properties_request_t xcb_out;
1649 xcb_out.window = window;
1651 xcb_parts[2].iov_base = (char *) &xcb_out;
1652 xcb_parts[2].iov_len = sizeof(xcb_out);
1653 xcb_parts[3].iov_base = 0;
1654 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1656 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1657 return xcb_ret;
1661 xcb_selinux_list_properties_properties_length (const xcb_selinux_list_properties_reply_t *R /**< */)
1663 return R->properties_len;
1666 xcb_selinux_list_item_iterator_t
1667 xcb_selinux_list_properties_properties_iterator (const xcb_selinux_list_properties_reply_t *R /**< */)
1669 xcb_selinux_list_item_iterator_t i;
1670 i.data = (xcb_selinux_list_item_t *) (R + 1);
1671 i.rem = R->properties_len;
1672 i.index = (char *) i.data - (char *) R;
1673 return i;
1676 xcb_selinux_list_properties_reply_t *
1677 xcb_selinux_list_properties_reply (xcb_connection_t *c /**< */,
1678 xcb_selinux_list_properties_cookie_t cookie /**< */,
1679 xcb_generic_error_t **e /**< */)
1681 return (xcb_selinux_list_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1685 xcb_selinux_set_selection_create_context_sizeof (const void *_buffer /**< */)
1687 char *xcb_tmp = (char *)_buffer;
1688 const xcb_selinux_set_selection_create_context_request_t *_aux = (xcb_selinux_set_selection_create_context_request_t *)_buffer;
1689 unsigned int xcb_buffer_len = 0;
1690 unsigned int xcb_block_len = 0;
1691 unsigned int xcb_pad = 0;
1692 unsigned int xcb_align_to = 0;
1695 xcb_block_len += sizeof(xcb_selinux_set_selection_create_context_request_t);
1696 xcb_tmp += xcb_block_len;
1697 xcb_buffer_len += xcb_block_len;
1698 xcb_block_len = 0;
1699 /* context */
1700 xcb_block_len += _aux->context_len * sizeof(char);
1701 xcb_tmp += xcb_block_len;
1702 xcb_align_to = ALIGNOF(char);
1703 /* insert padding */
1704 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1705 xcb_buffer_len += xcb_block_len + xcb_pad;
1706 if (0 != xcb_pad) {
1707 xcb_tmp += xcb_pad;
1708 xcb_pad = 0;
1710 xcb_block_len = 0;
1712 return xcb_buffer_len;
1715 xcb_void_cookie_t
1716 xcb_selinux_set_selection_create_context_checked (xcb_connection_t *c /**< */,
1717 uint32_t context_len /**< */,
1718 const char *context /**< */)
1720 static const xcb_protocol_request_t xcb_req = {
1721 /* count */ 4,
1722 /* ext */ &xcb_selinux_id,
1723 /* opcode */ XCB_SELINUX_SET_SELECTION_CREATE_CONTEXT,
1724 /* isvoid */ 1
1727 struct iovec xcb_parts[6];
1728 xcb_void_cookie_t xcb_ret;
1729 xcb_selinux_set_selection_create_context_request_t xcb_out;
1731 xcb_out.context_len = context_len;
1733 xcb_parts[2].iov_base = (char *) &xcb_out;
1734 xcb_parts[2].iov_len = sizeof(xcb_out);
1735 xcb_parts[3].iov_base = 0;
1736 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1737 /* char context */
1738 xcb_parts[4].iov_base = (char *) context;
1739 xcb_parts[4].iov_len = context_len * sizeof(char);
1740 xcb_parts[5].iov_base = 0;
1741 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1743 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1744 return xcb_ret;
1747 xcb_void_cookie_t
1748 xcb_selinux_set_selection_create_context (xcb_connection_t *c /**< */,
1749 uint32_t context_len /**< */,
1750 const char *context /**< */)
1752 static const xcb_protocol_request_t xcb_req = {
1753 /* count */ 4,
1754 /* ext */ &xcb_selinux_id,
1755 /* opcode */ XCB_SELINUX_SET_SELECTION_CREATE_CONTEXT,
1756 /* isvoid */ 1
1759 struct iovec xcb_parts[6];
1760 xcb_void_cookie_t xcb_ret;
1761 xcb_selinux_set_selection_create_context_request_t xcb_out;
1763 xcb_out.context_len = context_len;
1765 xcb_parts[2].iov_base = (char *) &xcb_out;
1766 xcb_parts[2].iov_len = sizeof(xcb_out);
1767 xcb_parts[3].iov_base = 0;
1768 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1769 /* char context */
1770 xcb_parts[4].iov_base = (char *) context;
1771 xcb_parts[4].iov_len = context_len * sizeof(char);
1772 xcb_parts[5].iov_base = 0;
1773 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1775 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1776 return xcb_ret;
1780 xcb_selinux_get_selection_create_context_sizeof (const void *_buffer /**< */)
1782 char *xcb_tmp = (char *)_buffer;
1783 const xcb_selinux_get_selection_create_context_reply_t *_aux = (xcb_selinux_get_selection_create_context_reply_t *)_buffer;
1784 unsigned int xcb_buffer_len = 0;
1785 unsigned int xcb_block_len = 0;
1786 unsigned int xcb_pad = 0;
1787 unsigned int xcb_align_to = 0;
1790 xcb_block_len += sizeof(xcb_selinux_get_selection_create_context_reply_t);
1791 xcb_tmp += xcb_block_len;
1792 xcb_buffer_len += xcb_block_len;
1793 xcb_block_len = 0;
1794 /* context */
1795 xcb_block_len += _aux->context_len * sizeof(char);
1796 xcb_tmp += xcb_block_len;
1797 xcb_align_to = ALIGNOF(char);
1798 /* insert padding */
1799 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1800 xcb_buffer_len += xcb_block_len + xcb_pad;
1801 if (0 != xcb_pad) {
1802 xcb_tmp += xcb_pad;
1803 xcb_pad = 0;
1805 xcb_block_len = 0;
1807 return xcb_buffer_len;
1810 xcb_selinux_get_selection_create_context_cookie_t
1811 xcb_selinux_get_selection_create_context (xcb_connection_t *c /**< */)
1813 static const xcb_protocol_request_t xcb_req = {
1814 /* count */ 2,
1815 /* ext */ &xcb_selinux_id,
1816 /* opcode */ XCB_SELINUX_GET_SELECTION_CREATE_CONTEXT,
1817 /* isvoid */ 0
1820 struct iovec xcb_parts[4];
1821 xcb_selinux_get_selection_create_context_cookie_t xcb_ret;
1822 xcb_selinux_get_selection_create_context_request_t xcb_out;
1825 xcb_parts[2].iov_base = (char *) &xcb_out;
1826 xcb_parts[2].iov_len = sizeof(xcb_out);
1827 xcb_parts[3].iov_base = 0;
1828 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1830 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1831 return xcb_ret;
1834 xcb_selinux_get_selection_create_context_cookie_t
1835 xcb_selinux_get_selection_create_context_unchecked (xcb_connection_t *c /**< */)
1837 static const xcb_protocol_request_t xcb_req = {
1838 /* count */ 2,
1839 /* ext */ &xcb_selinux_id,
1840 /* opcode */ XCB_SELINUX_GET_SELECTION_CREATE_CONTEXT,
1841 /* isvoid */ 0
1844 struct iovec xcb_parts[4];
1845 xcb_selinux_get_selection_create_context_cookie_t xcb_ret;
1846 xcb_selinux_get_selection_create_context_request_t xcb_out;
1849 xcb_parts[2].iov_base = (char *) &xcb_out;
1850 xcb_parts[2].iov_len = sizeof(xcb_out);
1851 xcb_parts[3].iov_base = 0;
1852 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1854 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1855 return xcb_ret;
1858 char *
1859 xcb_selinux_get_selection_create_context_context (const xcb_selinux_get_selection_create_context_reply_t *R /**< */)
1861 return (char *) (R + 1);
1865 xcb_selinux_get_selection_create_context_context_length (const xcb_selinux_get_selection_create_context_reply_t *R /**< */)
1867 return R->context_len;
1870 xcb_generic_iterator_t
1871 xcb_selinux_get_selection_create_context_context_end (const xcb_selinux_get_selection_create_context_reply_t *R /**< */)
1873 xcb_generic_iterator_t i;
1874 i.data = ((char *) (R + 1)) + (R->context_len);
1875 i.rem = 0;
1876 i.index = (char *) i.data - (char *) R;
1877 return i;
1880 xcb_selinux_get_selection_create_context_reply_t *
1881 xcb_selinux_get_selection_create_context_reply (xcb_connection_t *c /**< */,
1882 xcb_selinux_get_selection_create_context_cookie_t cookie /**< */,
1883 xcb_generic_error_t **e /**< */)
1885 return (xcb_selinux_get_selection_create_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1889 xcb_selinux_set_selection_use_context_sizeof (const void *_buffer /**< */)
1891 char *xcb_tmp = (char *)_buffer;
1892 const xcb_selinux_set_selection_use_context_request_t *_aux = (xcb_selinux_set_selection_use_context_request_t *)_buffer;
1893 unsigned int xcb_buffer_len = 0;
1894 unsigned int xcb_block_len = 0;
1895 unsigned int xcb_pad = 0;
1896 unsigned int xcb_align_to = 0;
1899 xcb_block_len += sizeof(xcb_selinux_set_selection_use_context_request_t);
1900 xcb_tmp += xcb_block_len;
1901 xcb_buffer_len += xcb_block_len;
1902 xcb_block_len = 0;
1903 /* context */
1904 xcb_block_len += _aux->context_len * sizeof(char);
1905 xcb_tmp += xcb_block_len;
1906 xcb_align_to = ALIGNOF(char);
1907 /* insert padding */
1908 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1909 xcb_buffer_len += xcb_block_len + xcb_pad;
1910 if (0 != xcb_pad) {
1911 xcb_tmp += xcb_pad;
1912 xcb_pad = 0;
1914 xcb_block_len = 0;
1916 return xcb_buffer_len;
1919 xcb_void_cookie_t
1920 xcb_selinux_set_selection_use_context_checked (xcb_connection_t *c /**< */,
1921 uint32_t context_len /**< */,
1922 const char *context /**< */)
1924 static const xcb_protocol_request_t xcb_req = {
1925 /* count */ 4,
1926 /* ext */ &xcb_selinux_id,
1927 /* opcode */ XCB_SELINUX_SET_SELECTION_USE_CONTEXT,
1928 /* isvoid */ 1
1931 struct iovec xcb_parts[6];
1932 xcb_void_cookie_t xcb_ret;
1933 xcb_selinux_set_selection_use_context_request_t xcb_out;
1935 xcb_out.context_len = context_len;
1937 xcb_parts[2].iov_base = (char *) &xcb_out;
1938 xcb_parts[2].iov_len = sizeof(xcb_out);
1939 xcb_parts[3].iov_base = 0;
1940 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1941 /* char context */
1942 xcb_parts[4].iov_base = (char *) context;
1943 xcb_parts[4].iov_len = context_len * sizeof(char);
1944 xcb_parts[5].iov_base = 0;
1945 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1947 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1948 return xcb_ret;
1951 xcb_void_cookie_t
1952 xcb_selinux_set_selection_use_context (xcb_connection_t *c /**< */,
1953 uint32_t context_len /**< */,
1954 const char *context /**< */)
1956 static const xcb_protocol_request_t xcb_req = {
1957 /* count */ 4,
1958 /* ext */ &xcb_selinux_id,
1959 /* opcode */ XCB_SELINUX_SET_SELECTION_USE_CONTEXT,
1960 /* isvoid */ 1
1963 struct iovec xcb_parts[6];
1964 xcb_void_cookie_t xcb_ret;
1965 xcb_selinux_set_selection_use_context_request_t xcb_out;
1967 xcb_out.context_len = context_len;
1969 xcb_parts[2].iov_base = (char *) &xcb_out;
1970 xcb_parts[2].iov_len = sizeof(xcb_out);
1971 xcb_parts[3].iov_base = 0;
1972 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1973 /* char context */
1974 xcb_parts[4].iov_base = (char *) context;
1975 xcb_parts[4].iov_len = context_len * sizeof(char);
1976 xcb_parts[5].iov_base = 0;
1977 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1979 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1980 return xcb_ret;
1984 xcb_selinux_get_selection_use_context_sizeof (const void *_buffer /**< */)
1986 char *xcb_tmp = (char *)_buffer;
1987 const xcb_selinux_get_selection_use_context_reply_t *_aux = (xcb_selinux_get_selection_use_context_reply_t *)_buffer;
1988 unsigned int xcb_buffer_len = 0;
1989 unsigned int xcb_block_len = 0;
1990 unsigned int xcb_pad = 0;
1991 unsigned int xcb_align_to = 0;
1994 xcb_block_len += sizeof(xcb_selinux_get_selection_use_context_reply_t);
1995 xcb_tmp += xcb_block_len;
1996 xcb_buffer_len += xcb_block_len;
1997 xcb_block_len = 0;
1998 /* context */
1999 xcb_block_len += _aux->context_len * sizeof(char);
2000 xcb_tmp += xcb_block_len;
2001 xcb_align_to = ALIGNOF(char);
2002 /* insert padding */
2003 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2004 xcb_buffer_len += xcb_block_len + xcb_pad;
2005 if (0 != xcb_pad) {
2006 xcb_tmp += xcb_pad;
2007 xcb_pad = 0;
2009 xcb_block_len = 0;
2011 return xcb_buffer_len;
2014 xcb_selinux_get_selection_use_context_cookie_t
2015 xcb_selinux_get_selection_use_context (xcb_connection_t *c /**< */)
2017 static const xcb_protocol_request_t xcb_req = {
2018 /* count */ 2,
2019 /* ext */ &xcb_selinux_id,
2020 /* opcode */ XCB_SELINUX_GET_SELECTION_USE_CONTEXT,
2021 /* isvoid */ 0
2024 struct iovec xcb_parts[4];
2025 xcb_selinux_get_selection_use_context_cookie_t xcb_ret;
2026 xcb_selinux_get_selection_use_context_request_t xcb_out;
2029 xcb_parts[2].iov_base = (char *) &xcb_out;
2030 xcb_parts[2].iov_len = sizeof(xcb_out);
2031 xcb_parts[3].iov_base = 0;
2032 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2034 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2035 return xcb_ret;
2038 xcb_selinux_get_selection_use_context_cookie_t
2039 xcb_selinux_get_selection_use_context_unchecked (xcb_connection_t *c /**< */)
2041 static const xcb_protocol_request_t xcb_req = {
2042 /* count */ 2,
2043 /* ext */ &xcb_selinux_id,
2044 /* opcode */ XCB_SELINUX_GET_SELECTION_USE_CONTEXT,
2045 /* isvoid */ 0
2048 struct iovec xcb_parts[4];
2049 xcb_selinux_get_selection_use_context_cookie_t xcb_ret;
2050 xcb_selinux_get_selection_use_context_request_t xcb_out;
2053 xcb_parts[2].iov_base = (char *) &xcb_out;
2054 xcb_parts[2].iov_len = sizeof(xcb_out);
2055 xcb_parts[3].iov_base = 0;
2056 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2058 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2059 return xcb_ret;
2062 char *
2063 xcb_selinux_get_selection_use_context_context (const xcb_selinux_get_selection_use_context_reply_t *R /**< */)
2065 return (char *) (R + 1);
2069 xcb_selinux_get_selection_use_context_context_length (const xcb_selinux_get_selection_use_context_reply_t *R /**< */)
2071 return R->context_len;
2074 xcb_generic_iterator_t
2075 xcb_selinux_get_selection_use_context_context_end (const xcb_selinux_get_selection_use_context_reply_t *R /**< */)
2077 xcb_generic_iterator_t i;
2078 i.data = ((char *) (R + 1)) + (R->context_len);
2079 i.rem = 0;
2080 i.index = (char *) i.data - (char *) R;
2081 return i;
2084 xcb_selinux_get_selection_use_context_reply_t *
2085 xcb_selinux_get_selection_use_context_reply (xcb_connection_t *c /**< */,
2086 xcb_selinux_get_selection_use_context_cookie_t cookie /**< */,
2087 xcb_generic_error_t **e /**< */)
2089 return (xcb_selinux_get_selection_use_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2093 xcb_selinux_get_selection_context_sizeof (const void *_buffer /**< */)
2095 char *xcb_tmp = (char *)_buffer;
2096 const xcb_selinux_get_selection_context_reply_t *_aux = (xcb_selinux_get_selection_context_reply_t *)_buffer;
2097 unsigned int xcb_buffer_len = 0;
2098 unsigned int xcb_block_len = 0;
2099 unsigned int xcb_pad = 0;
2100 unsigned int xcb_align_to = 0;
2103 xcb_block_len += sizeof(xcb_selinux_get_selection_context_reply_t);
2104 xcb_tmp += xcb_block_len;
2105 xcb_buffer_len += xcb_block_len;
2106 xcb_block_len = 0;
2107 /* context */
2108 xcb_block_len += _aux->context_len * sizeof(char);
2109 xcb_tmp += xcb_block_len;
2110 xcb_align_to = ALIGNOF(char);
2111 /* insert padding */
2112 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2113 xcb_buffer_len += xcb_block_len + xcb_pad;
2114 if (0 != xcb_pad) {
2115 xcb_tmp += xcb_pad;
2116 xcb_pad = 0;
2118 xcb_block_len = 0;
2120 return xcb_buffer_len;
2123 xcb_selinux_get_selection_context_cookie_t
2124 xcb_selinux_get_selection_context (xcb_connection_t *c /**< */,
2125 xcb_atom_t selection /**< */)
2127 static const xcb_protocol_request_t xcb_req = {
2128 /* count */ 2,
2129 /* ext */ &xcb_selinux_id,
2130 /* opcode */ XCB_SELINUX_GET_SELECTION_CONTEXT,
2131 /* isvoid */ 0
2134 struct iovec xcb_parts[4];
2135 xcb_selinux_get_selection_context_cookie_t xcb_ret;
2136 xcb_selinux_get_selection_context_request_t xcb_out;
2138 xcb_out.selection = selection;
2140 xcb_parts[2].iov_base = (char *) &xcb_out;
2141 xcb_parts[2].iov_len = sizeof(xcb_out);
2142 xcb_parts[3].iov_base = 0;
2143 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2145 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2146 return xcb_ret;
2149 xcb_selinux_get_selection_context_cookie_t
2150 xcb_selinux_get_selection_context_unchecked (xcb_connection_t *c /**< */,
2151 xcb_atom_t selection /**< */)
2153 static const xcb_protocol_request_t xcb_req = {
2154 /* count */ 2,
2155 /* ext */ &xcb_selinux_id,
2156 /* opcode */ XCB_SELINUX_GET_SELECTION_CONTEXT,
2157 /* isvoid */ 0
2160 struct iovec xcb_parts[4];
2161 xcb_selinux_get_selection_context_cookie_t xcb_ret;
2162 xcb_selinux_get_selection_context_request_t xcb_out;
2164 xcb_out.selection = selection;
2166 xcb_parts[2].iov_base = (char *) &xcb_out;
2167 xcb_parts[2].iov_len = sizeof(xcb_out);
2168 xcb_parts[3].iov_base = 0;
2169 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2171 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2172 return xcb_ret;
2175 char *
2176 xcb_selinux_get_selection_context_context (const xcb_selinux_get_selection_context_reply_t *R /**< */)
2178 return (char *) (R + 1);
2182 xcb_selinux_get_selection_context_context_length (const xcb_selinux_get_selection_context_reply_t *R /**< */)
2184 return R->context_len;
2187 xcb_generic_iterator_t
2188 xcb_selinux_get_selection_context_context_end (const xcb_selinux_get_selection_context_reply_t *R /**< */)
2190 xcb_generic_iterator_t i;
2191 i.data = ((char *) (R + 1)) + (R->context_len);
2192 i.rem = 0;
2193 i.index = (char *) i.data - (char *) R;
2194 return i;
2197 xcb_selinux_get_selection_context_reply_t *
2198 xcb_selinux_get_selection_context_reply (xcb_connection_t *c /**< */,
2199 xcb_selinux_get_selection_context_cookie_t cookie /**< */,
2200 xcb_generic_error_t **e /**< */)
2202 return (xcb_selinux_get_selection_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2206 xcb_selinux_get_selection_data_context_sizeof (const void *_buffer /**< */)
2208 char *xcb_tmp = (char *)_buffer;
2209 const xcb_selinux_get_selection_data_context_reply_t *_aux = (xcb_selinux_get_selection_data_context_reply_t *)_buffer;
2210 unsigned int xcb_buffer_len = 0;
2211 unsigned int xcb_block_len = 0;
2212 unsigned int xcb_pad = 0;
2213 unsigned int xcb_align_to = 0;
2216 xcb_block_len += sizeof(xcb_selinux_get_selection_data_context_reply_t);
2217 xcb_tmp += xcb_block_len;
2218 xcb_buffer_len += xcb_block_len;
2219 xcb_block_len = 0;
2220 /* context */
2221 xcb_block_len += _aux->context_len * sizeof(char);
2222 xcb_tmp += xcb_block_len;
2223 xcb_align_to = ALIGNOF(char);
2224 /* insert padding */
2225 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2226 xcb_buffer_len += xcb_block_len + xcb_pad;
2227 if (0 != xcb_pad) {
2228 xcb_tmp += xcb_pad;
2229 xcb_pad = 0;
2231 xcb_block_len = 0;
2233 return xcb_buffer_len;
2236 xcb_selinux_get_selection_data_context_cookie_t
2237 xcb_selinux_get_selection_data_context (xcb_connection_t *c /**< */,
2238 xcb_atom_t selection /**< */)
2240 static const xcb_protocol_request_t xcb_req = {
2241 /* count */ 2,
2242 /* ext */ &xcb_selinux_id,
2243 /* opcode */ XCB_SELINUX_GET_SELECTION_DATA_CONTEXT,
2244 /* isvoid */ 0
2247 struct iovec xcb_parts[4];
2248 xcb_selinux_get_selection_data_context_cookie_t xcb_ret;
2249 xcb_selinux_get_selection_data_context_request_t xcb_out;
2251 xcb_out.selection = selection;
2253 xcb_parts[2].iov_base = (char *) &xcb_out;
2254 xcb_parts[2].iov_len = sizeof(xcb_out);
2255 xcb_parts[3].iov_base = 0;
2256 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2258 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2259 return xcb_ret;
2262 xcb_selinux_get_selection_data_context_cookie_t
2263 xcb_selinux_get_selection_data_context_unchecked (xcb_connection_t *c /**< */,
2264 xcb_atom_t selection /**< */)
2266 static const xcb_protocol_request_t xcb_req = {
2267 /* count */ 2,
2268 /* ext */ &xcb_selinux_id,
2269 /* opcode */ XCB_SELINUX_GET_SELECTION_DATA_CONTEXT,
2270 /* isvoid */ 0
2273 struct iovec xcb_parts[4];
2274 xcb_selinux_get_selection_data_context_cookie_t xcb_ret;
2275 xcb_selinux_get_selection_data_context_request_t xcb_out;
2277 xcb_out.selection = selection;
2279 xcb_parts[2].iov_base = (char *) &xcb_out;
2280 xcb_parts[2].iov_len = sizeof(xcb_out);
2281 xcb_parts[3].iov_base = 0;
2282 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2284 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2285 return xcb_ret;
2288 char *
2289 xcb_selinux_get_selection_data_context_context (const xcb_selinux_get_selection_data_context_reply_t *R /**< */)
2291 return (char *) (R + 1);
2295 xcb_selinux_get_selection_data_context_context_length (const xcb_selinux_get_selection_data_context_reply_t *R /**< */)
2297 return R->context_len;
2300 xcb_generic_iterator_t
2301 xcb_selinux_get_selection_data_context_context_end (const xcb_selinux_get_selection_data_context_reply_t *R /**< */)
2303 xcb_generic_iterator_t i;
2304 i.data = ((char *) (R + 1)) + (R->context_len);
2305 i.rem = 0;
2306 i.index = (char *) i.data - (char *) R;
2307 return i;
2310 xcb_selinux_get_selection_data_context_reply_t *
2311 xcb_selinux_get_selection_data_context_reply (xcb_connection_t *c /**< */,
2312 xcb_selinux_get_selection_data_context_cookie_t cookie /**< */,
2313 xcb_generic_error_t **e /**< */)
2315 return (xcb_selinux_get_selection_data_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2319 xcb_selinux_list_selections_sizeof (const void *_buffer /**< */)
2321 char *xcb_tmp = (char *)_buffer;
2322 const xcb_selinux_list_selections_reply_t *_aux = (xcb_selinux_list_selections_reply_t *)_buffer;
2323 unsigned int xcb_buffer_len = 0;
2324 unsigned int xcb_block_len = 0;
2325 unsigned int xcb_pad = 0;
2326 unsigned int xcb_align_to = 0;
2328 unsigned int i;
2329 unsigned int xcb_tmp_len;
2331 xcb_block_len += sizeof(xcb_selinux_list_selections_reply_t);
2332 xcb_tmp += xcb_block_len;
2333 xcb_buffer_len += xcb_block_len;
2334 xcb_block_len = 0;
2335 /* selections */
2336 for(i=0; i<_aux->selections_len; i++) {
2337 xcb_tmp_len = xcb_selinux_list_item_sizeof(xcb_tmp);
2338 xcb_block_len += xcb_tmp_len;
2339 xcb_tmp += xcb_tmp_len;
2341 xcb_align_to = ALIGNOF(xcb_selinux_list_item_t);
2342 /* insert padding */
2343 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2344 xcb_buffer_len += xcb_block_len + xcb_pad;
2345 if (0 != xcb_pad) {
2346 xcb_tmp += xcb_pad;
2347 xcb_pad = 0;
2349 xcb_block_len = 0;
2351 return xcb_buffer_len;
2354 xcb_selinux_list_selections_cookie_t
2355 xcb_selinux_list_selections (xcb_connection_t *c /**< */)
2357 static const xcb_protocol_request_t xcb_req = {
2358 /* count */ 2,
2359 /* ext */ &xcb_selinux_id,
2360 /* opcode */ XCB_SELINUX_LIST_SELECTIONS,
2361 /* isvoid */ 0
2364 struct iovec xcb_parts[4];
2365 xcb_selinux_list_selections_cookie_t xcb_ret;
2366 xcb_selinux_list_selections_request_t xcb_out;
2369 xcb_parts[2].iov_base = (char *) &xcb_out;
2370 xcb_parts[2].iov_len = sizeof(xcb_out);
2371 xcb_parts[3].iov_base = 0;
2372 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2374 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2375 return xcb_ret;
2378 xcb_selinux_list_selections_cookie_t
2379 xcb_selinux_list_selections_unchecked (xcb_connection_t *c /**< */)
2381 static const xcb_protocol_request_t xcb_req = {
2382 /* count */ 2,
2383 /* ext */ &xcb_selinux_id,
2384 /* opcode */ XCB_SELINUX_LIST_SELECTIONS,
2385 /* isvoid */ 0
2388 struct iovec xcb_parts[4];
2389 xcb_selinux_list_selections_cookie_t xcb_ret;
2390 xcb_selinux_list_selections_request_t xcb_out;
2393 xcb_parts[2].iov_base = (char *) &xcb_out;
2394 xcb_parts[2].iov_len = sizeof(xcb_out);
2395 xcb_parts[3].iov_base = 0;
2396 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2398 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2399 return xcb_ret;
2403 xcb_selinux_list_selections_selections_length (const xcb_selinux_list_selections_reply_t *R /**< */)
2405 return R->selections_len;
2408 xcb_selinux_list_item_iterator_t
2409 xcb_selinux_list_selections_selections_iterator (const xcb_selinux_list_selections_reply_t *R /**< */)
2411 xcb_selinux_list_item_iterator_t i;
2412 i.data = (xcb_selinux_list_item_t *) (R + 1);
2413 i.rem = R->selections_len;
2414 i.index = (char *) i.data - (char *) R;
2415 return i;
2418 xcb_selinux_list_selections_reply_t *
2419 xcb_selinux_list_selections_reply (xcb_connection_t *c /**< */,
2420 xcb_selinux_list_selections_cookie_t cookie /**< */,
2421 xcb_generic_error_t **e /**< */)
2423 return (xcb_selinux_list_selections_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2427 xcb_selinux_get_client_context_sizeof (const void *_buffer /**< */)
2429 char *xcb_tmp = (char *)_buffer;
2430 const xcb_selinux_get_client_context_reply_t *_aux = (xcb_selinux_get_client_context_reply_t *)_buffer;
2431 unsigned int xcb_buffer_len = 0;
2432 unsigned int xcb_block_len = 0;
2433 unsigned int xcb_pad = 0;
2434 unsigned int xcb_align_to = 0;
2437 xcb_block_len += sizeof(xcb_selinux_get_client_context_reply_t);
2438 xcb_tmp += xcb_block_len;
2439 xcb_buffer_len += xcb_block_len;
2440 xcb_block_len = 0;
2441 /* context */
2442 xcb_block_len += _aux->context_len * sizeof(char);
2443 xcb_tmp += xcb_block_len;
2444 xcb_align_to = ALIGNOF(char);
2445 /* insert padding */
2446 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2447 xcb_buffer_len += xcb_block_len + xcb_pad;
2448 if (0 != xcb_pad) {
2449 xcb_tmp += xcb_pad;
2450 xcb_pad = 0;
2452 xcb_block_len = 0;
2454 return xcb_buffer_len;
2457 xcb_selinux_get_client_context_cookie_t
2458 xcb_selinux_get_client_context (xcb_connection_t *c /**< */,
2459 uint32_t resource /**< */)
2461 static const xcb_protocol_request_t xcb_req = {
2462 /* count */ 2,
2463 /* ext */ &xcb_selinux_id,
2464 /* opcode */ XCB_SELINUX_GET_CLIENT_CONTEXT,
2465 /* isvoid */ 0
2468 struct iovec xcb_parts[4];
2469 xcb_selinux_get_client_context_cookie_t xcb_ret;
2470 xcb_selinux_get_client_context_request_t xcb_out;
2472 xcb_out.resource = resource;
2474 xcb_parts[2].iov_base = (char *) &xcb_out;
2475 xcb_parts[2].iov_len = sizeof(xcb_out);
2476 xcb_parts[3].iov_base = 0;
2477 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2479 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2480 return xcb_ret;
2483 xcb_selinux_get_client_context_cookie_t
2484 xcb_selinux_get_client_context_unchecked (xcb_connection_t *c /**< */,
2485 uint32_t resource /**< */)
2487 static const xcb_protocol_request_t xcb_req = {
2488 /* count */ 2,
2489 /* ext */ &xcb_selinux_id,
2490 /* opcode */ XCB_SELINUX_GET_CLIENT_CONTEXT,
2491 /* isvoid */ 0
2494 struct iovec xcb_parts[4];
2495 xcb_selinux_get_client_context_cookie_t xcb_ret;
2496 xcb_selinux_get_client_context_request_t xcb_out;
2498 xcb_out.resource = resource;
2500 xcb_parts[2].iov_base = (char *) &xcb_out;
2501 xcb_parts[2].iov_len = sizeof(xcb_out);
2502 xcb_parts[3].iov_base = 0;
2503 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2505 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2506 return xcb_ret;
2509 char *
2510 xcb_selinux_get_client_context_context (const xcb_selinux_get_client_context_reply_t *R /**< */)
2512 return (char *) (R + 1);
2516 xcb_selinux_get_client_context_context_length (const xcb_selinux_get_client_context_reply_t *R /**< */)
2518 return R->context_len;
2521 xcb_generic_iterator_t
2522 xcb_selinux_get_client_context_context_end (const xcb_selinux_get_client_context_reply_t *R /**< */)
2524 xcb_generic_iterator_t i;
2525 i.data = ((char *) (R + 1)) + (R->context_len);
2526 i.rem = 0;
2527 i.index = (char *) i.data - (char *) R;
2528 return i;
2531 xcb_selinux_get_client_context_reply_t *
2532 xcb_selinux_get_client_context_reply (xcb_connection_t *c /**< */,
2533 xcb_selinux_get_client_context_cookie_t cookie /**< */,
2534 xcb_generic_error_t **e /**< */)
2536 return (xcb_selinux_get_client_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);