1971bb1a5SLionel Sambuc /*
2971bb1a5SLionel Sambuc * This file generated automatically from xc_misc.xml by c_client.py.
3971bb1a5SLionel Sambuc * Edit at your peril.
4971bb1a5SLionel Sambuc */
5971bb1a5SLionel Sambuc
6971bb1a5SLionel Sambuc #ifdef HAVE_CONFIG_H
7971bb1a5SLionel Sambuc #include "config.h"
8971bb1a5SLionel Sambuc #endif
9971bb1a5SLionel Sambuc #include <stdlib.h>
10971bb1a5SLionel Sambuc #include <string.h>
11971bb1a5SLionel Sambuc #include <assert.h>
12971bb1a5SLionel Sambuc #include <stddef.h> /* for offsetof() */
13971bb1a5SLionel Sambuc #include "xcbext.h"
14971bb1a5SLionel Sambuc #include "xc_misc.h"
15971bb1a5SLionel Sambuc
16971bb1a5SLionel Sambuc #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17971bb1a5SLionel Sambuc
18971bb1a5SLionel Sambuc xcb_extension_t xcb_xc_misc_id = { "XC-MISC", 0 };
19971bb1a5SLionel Sambuc
20971bb1a5SLionel Sambuc xcb_xc_misc_get_version_cookie_t
xcb_xc_misc_get_version(xcb_connection_t * c,uint16_t client_major_version,uint16_t client_minor_version)21971bb1a5SLionel Sambuc xcb_xc_misc_get_version (xcb_connection_t *c /**< */,
22971bb1a5SLionel Sambuc uint16_t client_major_version /**< */,
23971bb1a5SLionel Sambuc uint16_t client_minor_version /**< */)
24971bb1a5SLionel Sambuc {
25971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
26971bb1a5SLionel Sambuc /* count */ 2,
27971bb1a5SLionel Sambuc /* ext */ &xcb_xc_misc_id,
28971bb1a5SLionel Sambuc /* opcode */ XCB_XC_MISC_GET_VERSION,
29971bb1a5SLionel Sambuc /* isvoid */ 0
30971bb1a5SLionel Sambuc };
31971bb1a5SLionel Sambuc
32971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
33971bb1a5SLionel Sambuc xcb_xc_misc_get_version_cookie_t xcb_ret;
34971bb1a5SLionel Sambuc xcb_xc_misc_get_version_request_t xcb_out;
35971bb1a5SLionel Sambuc
36971bb1a5SLionel Sambuc xcb_out.client_major_version = client_major_version;
37971bb1a5SLionel Sambuc xcb_out.client_minor_version = client_minor_version;
38971bb1a5SLionel Sambuc
39971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
40971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
41971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
42971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
43971bb1a5SLionel Sambuc
44971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
45971bb1a5SLionel Sambuc return xcb_ret;
46971bb1a5SLionel Sambuc }
47971bb1a5SLionel Sambuc
48971bb1a5SLionel Sambuc xcb_xc_misc_get_version_cookie_t
xcb_xc_misc_get_version_unchecked(xcb_connection_t * c,uint16_t client_major_version,uint16_t client_minor_version)49971bb1a5SLionel Sambuc xcb_xc_misc_get_version_unchecked (xcb_connection_t *c /**< */,
50971bb1a5SLionel Sambuc uint16_t client_major_version /**< */,
51971bb1a5SLionel Sambuc uint16_t client_minor_version /**< */)
52971bb1a5SLionel Sambuc {
53971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
54971bb1a5SLionel Sambuc /* count */ 2,
55971bb1a5SLionel Sambuc /* ext */ &xcb_xc_misc_id,
56971bb1a5SLionel Sambuc /* opcode */ XCB_XC_MISC_GET_VERSION,
57971bb1a5SLionel Sambuc /* isvoid */ 0
58971bb1a5SLionel Sambuc };
59971bb1a5SLionel Sambuc
60971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
61971bb1a5SLionel Sambuc xcb_xc_misc_get_version_cookie_t xcb_ret;
62971bb1a5SLionel Sambuc xcb_xc_misc_get_version_request_t xcb_out;
63971bb1a5SLionel Sambuc
64971bb1a5SLionel Sambuc xcb_out.client_major_version = client_major_version;
65971bb1a5SLionel Sambuc xcb_out.client_minor_version = client_minor_version;
66971bb1a5SLionel Sambuc
67971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
68971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
69971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
70971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
71971bb1a5SLionel Sambuc
72971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
73971bb1a5SLionel Sambuc return xcb_ret;
74971bb1a5SLionel Sambuc }
75971bb1a5SLionel Sambuc
76971bb1a5SLionel Sambuc xcb_xc_misc_get_version_reply_t *
xcb_xc_misc_get_version_reply(xcb_connection_t * c,xcb_xc_misc_get_version_cookie_t cookie,xcb_generic_error_t ** e)77971bb1a5SLionel Sambuc xcb_xc_misc_get_version_reply (xcb_connection_t *c /**< */,
78971bb1a5SLionel Sambuc xcb_xc_misc_get_version_cookie_t cookie /**< */,
79971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
80971bb1a5SLionel Sambuc {
81971bb1a5SLionel Sambuc return (xcb_xc_misc_get_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
82971bb1a5SLionel Sambuc }
83971bb1a5SLionel Sambuc
84971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range_cookie_t
xcb_xc_misc_get_xid_range(xcb_connection_t * c)85971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range (xcb_connection_t *c /**< */)
86971bb1a5SLionel Sambuc {
87971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
88971bb1a5SLionel Sambuc /* count */ 2,
89971bb1a5SLionel Sambuc /* ext */ &xcb_xc_misc_id,
90971bb1a5SLionel Sambuc /* opcode */ XCB_XC_MISC_GET_XID_RANGE,
91971bb1a5SLionel Sambuc /* isvoid */ 0
92971bb1a5SLionel Sambuc };
93971bb1a5SLionel Sambuc
94971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
95971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range_cookie_t xcb_ret;
96971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range_request_t xcb_out;
97971bb1a5SLionel Sambuc
98971bb1a5SLionel Sambuc
99971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
100971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
101971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
102971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
103971bb1a5SLionel Sambuc
104971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
105971bb1a5SLionel Sambuc return xcb_ret;
106971bb1a5SLionel Sambuc }
107971bb1a5SLionel Sambuc
108971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range_cookie_t
xcb_xc_misc_get_xid_range_unchecked(xcb_connection_t * c)109971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range_unchecked (xcb_connection_t *c /**< */)
110971bb1a5SLionel Sambuc {
111971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
112971bb1a5SLionel Sambuc /* count */ 2,
113971bb1a5SLionel Sambuc /* ext */ &xcb_xc_misc_id,
114971bb1a5SLionel Sambuc /* opcode */ XCB_XC_MISC_GET_XID_RANGE,
115971bb1a5SLionel Sambuc /* isvoid */ 0
116971bb1a5SLionel Sambuc };
117971bb1a5SLionel Sambuc
118971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
119971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range_cookie_t xcb_ret;
120971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range_request_t xcb_out;
121971bb1a5SLionel Sambuc
122971bb1a5SLionel Sambuc
123971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
124971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
125971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
126971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
127971bb1a5SLionel Sambuc
128971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
129971bb1a5SLionel Sambuc return xcb_ret;
130971bb1a5SLionel Sambuc }
131971bb1a5SLionel Sambuc
132971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range_reply_t *
xcb_xc_misc_get_xid_range_reply(xcb_connection_t * c,xcb_xc_misc_get_xid_range_cookie_t cookie,xcb_generic_error_t ** e)133971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range_reply (xcb_connection_t *c /**< */,
134971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_range_cookie_t cookie /**< */,
135971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
136971bb1a5SLionel Sambuc {
137971bb1a5SLionel Sambuc return (xcb_xc_misc_get_xid_range_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
138971bb1a5SLionel Sambuc }
139971bb1a5SLionel Sambuc
140971bb1a5SLionel Sambuc int
xcb_xc_misc_get_xid_list_sizeof(const void * _buffer)141971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_sizeof (const void *_buffer /**< */)
142971bb1a5SLionel Sambuc {
143971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
144971bb1a5SLionel Sambuc const xcb_xc_misc_get_xid_list_reply_t *_aux = (xcb_xc_misc_get_xid_list_reply_t *)_buffer;
145971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
146971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
147971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
148*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
149971bb1a5SLionel Sambuc
150971bb1a5SLionel Sambuc
151971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_xc_misc_get_xid_list_reply_t);
152971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
153*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
154*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
155971bb1a5SLionel Sambuc /* ids */
156971bb1a5SLionel Sambuc xcb_block_len += _aux->ids_len * sizeof(uint32_t);
157971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
158971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
159971bb1a5SLionel Sambuc /* insert padding */
160971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
161971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
162971bb1a5SLionel Sambuc if (0 != xcb_pad) {
163971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
164971bb1a5SLionel Sambuc xcb_pad = 0;
165971bb1a5SLionel Sambuc }
166971bb1a5SLionel Sambuc xcb_block_len = 0;
167971bb1a5SLionel Sambuc
168971bb1a5SLionel Sambuc return xcb_buffer_len;
169971bb1a5SLionel Sambuc }
170971bb1a5SLionel Sambuc
171971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_cookie_t
xcb_xc_misc_get_xid_list(xcb_connection_t * c,uint32_t count)172971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list (xcb_connection_t *c /**< */,
173971bb1a5SLionel Sambuc uint32_t count /**< */)
174971bb1a5SLionel Sambuc {
175971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
176971bb1a5SLionel Sambuc /* count */ 2,
177971bb1a5SLionel Sambuc /* ext */ &xcb_xc_misc_id,
178971bb1a5SLionel Sambuc /* opcode */ XCB_XC_MISC_GET_XID_LIST,
179971bb1a5SLionel Sambuc /* isvoid */ 0
180971bb1a5SLionel Sambuc };
181971bb1a5SLionel Sambuc
182971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
183971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_cookie_t xcb_ret;
184971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_request_t xcb_out;
185971bb1a5SLionel Sambuc
186971bb1a5SLionel Sambuc xcb_out.count = count;
187971bb1a5SLionel Sambuc
188971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
189971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
190971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
191971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
192971bb1a5SLionel Sambuc
193971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
194971bb1a5SLionel Sambuc return xcb_ret;
195971bb1a5SLionel Sambuc }
196971bb1a5SLionel Sambuc
197971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_cookie_t
xcb_xc_misc_get_xid_list_unchecked(xcb_connection_t * c,uint32_t count)198971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_unchecked (xcb_connection_t *c /**< */,
199971bb1a5SLionel Sambuc uint32_t count /**< */)
200971bb1a5SLionel Sambuc {
201971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
202971bb1a5SLionel Sambuc /* count */ 2,
203971bb1a5SLionel Sambuc /* ext */ &xcb_xc_misc_id,
204971bb1a5SLionel Sambuc /* opcode */ XCB_XC_MISC_GET_XID_LIST,
205971bb1a5SLionel Sambuc /* isvoid */ 0
206971bb1a5SLionel Sambuc };
207971bb1a5SLionel Sambuc
208971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
209971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_cookie_t xcb_ret;
210971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_request_t xcb_out;
211971bb1a5SLionel Sambuc
212971bb1a5SLionel Sambuc xcb_out.count = count;
213971bb1a5SLionel Sambuc
214971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
215971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
216971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
217971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
218971bb1a5SLionel Sambuc
219971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
220971bb1a5SLionel Sambuc return xcb_ret;
221971bb1a5SLionel Sambuc }
222971bb1a5SLionel Sambuc
223971bb1a5SLionel Sambuc uint32_t *
xcb_xc_misc_get_xid_list_ids(const xcb_xc_misc_get_xid_list_reply_t * R)224971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_ids (const xcb_xc_misc_get_xid_list_reply_t *R /**< */)
225971bb1a5SLionel Sambuc {
226971bb1a5SLionel Sambuc return (uint32_t *) (R + 1);
227971bb1a5SLionel Sambuc }
228971bb1a5SLionel Sambuc
229971bb1a5SLionel Sambuc int
xcb_xc_misc_get_xid_list_ids_length(const xcb_xc_misc_get_xid_list_reply_t * R)230971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_ids_length (const xcb_xc_misc_get_xid_list_reply_t *R /**< */)
231971bb1a5SLionel Sambuc {
232971bb1a5SLionel Sambuc return R->ids_len;
233971bb1a5SLionel Sambuc }
234971bb1a5SLionel Sambuc
235971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_xc_misc_get_xid_list_ids_end(const xcb_xc_misc_get_xid_list_reply_t * R)236971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_ids_end (const xcb_xc_misc_get_xid_list_reply_t *R /**< */)
237971bb1a5SLionel Sambuc {
238971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
239971bb1a5SLionel Sambuc i.data = ((uint32_t *) (R + 1)) + (R->ids_len);
240971bb1a5SLionel Sambuc i.rem = 0;
241971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
242971bb1a5SLionel Sambuc return i;
243971bb1a5SLionel Sambuc }
244971bb1a5SLionel Sambuc
245971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_reply_t *
xcb_xc_misc_get_xid_list_reply(xcb_connection_t * c,xcb_xc_misc_get_xid_list_cookie_t cookie,xcb_generic_error_t ** e)246971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_reply (xcb_connection_t *c /**< */,
247971bb1a5SLionel Sambuc xcb_xc_misc_get_xid_list_cookie_t cookie /**< */,
248971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
249971bb1a5SLionel Sambuc {
250971bb1a5SLionel Sambuc return (xcb_xc_misc_get_xid_list_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
251971bb1a5SLionel Sambuc }
252971bb1a5SLionel Sambuc
253