1971bb1a5SLionel Sambuc /*
2971bb1a5SLionel Sambuc * This file generated automatically from sync.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 "sync.h"
15971bb1a5SLionel Sambuc
16971bb1a5SLionel Sambuc #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17971bb1a5SLionel Sambuc #include "xproto.h"
18971bb1a5SLionel Sambuc
19971bb1a5SLionel Sambuc xcb_extension_t xcb_sync_id = { "SYNC", 0 };
20971bb1a5SLionel Sambuc
21971bb1a5SLionel Sambuc void
xcb_sync_alarm_next(xcb_sync_alarm_iterator_t * i)22971bb1a5SLionel Sambuc xcb_sync_alarm_next (xcb_sync_alarm_iterator_t *i /**< */)
23971bb1a5SLionel Sambuc {
24971bb1a5SLionel Sambuc --i->rem;
25971bb1a5SLionel Sambuc ++i->data;
26971bb1a5SLionel Sambuc i->index += sizeof(xcb_sync_alarm_t);
27971bb1a5SLionel Sambuc }
28971bb1a5SLionel Sambuc
29971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_sync_alarm_end(xcb_sync_alarm_iterator_t i)30971bb1a5SLionel Sambuc xcb_sync_alarm_end (xcb_sync_alarm_iterator_t i /**< */)
31971bb1a5SLionel Sambuc {
32971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
33971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
34971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
35971bb1a5SLionel Sambuc ret.rem = 0;
36971bb1a5SLionel Sambuc return ret;
37971bb1a5SLionel Sambuc }
38971bb1a5SLionel Sambuc
39971bb1a5SLionel Sambuc void
xcb_sync_counter_next(xcb_sync_counter_iterator_t * i)40971bb1a5SLionel Sambuc xcb_sync_counter_next (xcb_sync_counter_iterator_t *i /**< */)
41971bb1a5SLionel Sambuc {
42971bb1a5SLionel Sambuc --i->rem;
43971bb1a5SLionel Sambuc ++i->data;
44971bb1a5SLionel Sambuc i->index += sizeof(xcb_sync_counter_t);
45971bb1a5SLionel Sambuc }
46971bb1a5SLionel Sambuc
47971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_sync_counter_end(xcb_sync_counter_iterator_t i)48971bb1a5SLionel Sambuc xcb_sync_counter_end (xcb_sync_counter_iterator_t i /**< */)
49971bb1a5SLionel Sambuc {
50971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
51971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
52971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
53971bb1a5SLionel Sambuc ret.rem = 0;
54971bb1a5SLionel Sambuc return ret;
55971bb1a5SLionel Sambuc }
56971bb1a5SLionel Sambuc
57971bb1a5SLionel Sambuc void
xcb_sync_fence_next(xcb_sync_fence_iterator_t * i)58971bb1a5SLionel Sambuc xcb_sync_fence_next (xcb_sync_fence_iterator_t *i /**< */)
59971bb1a5SLionel Sambuc {
60971bb1a5SLionel Sambuc --i->rem;
61971bb1a5SLionel Sambuc ++i->data;
62971bb1a5SLionel Sambuc i->index += sizeof(xcb_sync_fence_t);
63971bb1a5SLionel Sambuc }
64971bb1a5SLionel Sambuc
65971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_sync_fence_end(xcb_sync_fence_iterator_t i)66971bb1a5SLionel Sambuc xcb_sync_fence_end (xcb_sync_fence_iterator_t i /**< */)
67971bb1a5SLionel Sambuc {
68971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
69971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
70971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
71971bb1a5SLionel Sambuc ret.rem = 0;
72971bb1a5SLionel Sambuc return ret;
73971bb1a5SLionel Sambuc }
74971bb1a5SLionel Sambuc
75971bb1a5SLionel Sambuc void
xcb_sync_int64_next(xcb_sync_int64_iterator_t * i)76971bb1a5SLionel Sambuc xcb_sync_int64_next (xcb_sync_int64_iterator_t *i /**< */)
77971bb1a5SLionel Sambuc {
78971bb1a5SLionel Sambuc --i->rem;
79971bb1a5SLionel Sambuc ++i->data;
80971bb1a5SLionel Sambuc i->index += sizeof(xcb_sync_int64_t);
81971bb1a5SLionel Sambuc }
82971bb1a5SLionel Sambuc
83971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_sync_int64_end(xcb_sync_int64_iterator_t i)84971bb1a5SLionel Sambuc xcb_sync_int64_end (xcb_sync_int64_iterator_t i /**< */)
85971bb1a5SLionel Sambuc {
86971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
87971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
88971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
89971bb1a5SLionel Sambuc ret.rem = 0;
90971bb1a5SLionel Sambuc return ret;
91971bb1a5SLionel Sambuc }
92971bb1a5SLionel Sambuc
93971bb1a5SLionel Sambuc int
xcb_sync_systemcounter_sizeof(const void * _buffer)94971bb1a5SLionel Sambuc xcb_sync_systemcounter_sizeof (const void *_buffer /**< */)
95971bb1a5SLionel Sambuc {
96971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
97971bb1a5SLionel Sambuc const xcb_sync_systemcounter_t *_aux = (xcb_sync_systemcounter_t *)_buffer;
98971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
99971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
100971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
101*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
102971bb1a5SLionel Sambuc
103971bb1a5SLionel Sambuc
104971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_sync_systemcounter_t);
105971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
106*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
107*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
108971bb1a5SLionel Sambuc /* name */
109971bb1a5SLionel Sambuc xcb_block_len += _aux->name_len * sizeof(char);
110971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
111971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(char);
112971bb1a5SLionel Sambuc /* insert padding */
113971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
114971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
115971bb1a5SLionel Sambuc if (0 != xcb_pad) {
116971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
117971bb1a5SLionel Sambuc xcb_pad = 0;
118971bb1a5SLionel Sambuc }
119971bb1a5SLionel Sambuc xcb_block_len = 0;
120971bb1a5SLionel Sambuc
121971bb1a5SLionel Sambuc return xcb_buffer_len;
122971bb1a5SLionel Sambuc }
123971bb1a5SLionel Sambuc
124971bb1a5SLionel Sambuc char *
xcb_sync_systemcounter_name(const xcb_sync_systemcounter_t * R)125971bb1a5SLionel Sambuc xcb_sync_systemcounter_name (const xcb_sync_systemcounter_t *R /**< */)
126971bb1a5SLionel Sambuc {
127971bb1a5SLionel Sambuc return (char *) (R + 1);
128971bb1a5SLionel Sambuc }
129971bb1a5SLionel Sambuc
130971bb1a5SLionel Sambuc int
xcb_sync_systemcounter_name_length(const xcb_sync_systemcounter_t * R)131971bb1a5SLionel Sambuc xcb_sync_systemcounter_name_length (const xcb_sync_systemcounter_t *R /**< */)
132971bb1a5SLionel Sambuc {
133971bb1a5SLionel Sambuc return R->name_len;
134971bb1a5SLionel Sambuc }
135971bb1a5SLionel Sambuc
136971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_sync_systemcounter_name_end(const xcb_sync_systemcounter_t * R)137971bb1a5SLionel Sambuc xcb_sync_systemcounter_name_end (const xcb_sync_systemcounter_t *R /**< */)
138971bb1a5SLionel Sambuc {
139971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
140971bb1a5SLionel Sambuc i.data = ((char *) (R + 1)) + (R->name_len);
141971bb1a5SLionel Sambuc i.rem = 0;
142971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
143971bb1a5SLionel Sambuc return i;
144971bb1a5SLionel Sambuc }
145971bb1a5SLionel Sambuc
146971bb1a5SLionel Sambuc void
xcb_sync_systemcounter_next(xcb_sync_systemcounter_iterator_t * i)147971bb1a5SLionel Sambuc xcb_sync_systemcounter_next (xcb_sync_systemcounter_iterator_t *i /**< */)
148971bb1a5SLionel Sambuc {
149971bb1a5SLionel Sambuc xcb_sync_systemcounter_t *R = i->data;
150971bb1a5SLionel Sambuc xcb_generic_iterator_t child;
151971bb1a5SLionel Sambuc child.data = (xcb_sync_systemcounter_t *)(((char *)R) + xcb_sync_systemcounter_sizeof(R));
152971bb1a5SLionel Sambuc i->index = (char *) child.data - (char *) i->data;
153971bb1a5SLionel Sambuc --i->rem;
154971bb1a5SLionel Sambuc i->data = (xcb_sync_systemcounter_t *) child.data;
155971bb1a5SLionel Sambuc }
156971bb1a5SLionel Sambuc
157971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_sync_systemcounter_end(xcb_sync_systemcounter_iterator_t i)158971bb1a5SLionel Sambuc xcb_sync_systemcounter_end (xcb_sync_systemcounter_iterator_t i /**< */)
159971bb1a5SLionel Sambuc {
160971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
161971bb1a5SLionel Sambuc while(i.rem > 0)
162971bb1a5SLionel Sambuc xcb_sync_systemcounter_next(&i);
163971bb1a5SLionel Sambuc ret.data = i.data;
164971bb1a5SLionel Sambuc ret.rem = i.rem;
165971bb1a5SLionel Sambuc ret.index = i.index;
166971bb1a5SLionel Sambuc return ret;
167971bb1a5SLionel Sambuc }
168971bb1a5SLionel Sambuc
169971bb1a5SLionel Sambuc void
xcb_sync_trigger_next(xcb_sync_trigger_iterator_t * i)170971bb1a5SLionel Sambuc xcb_sync_trigger_next (xcb_sync_trigger_iterator_t *i /**< */)
171971bb1a5SLionel Sambuc {
172971bb1a5SLionel Sambuc --i->rem;
173971bb1a5SLionel Sambuc ++i->data;
174971bb1a5SLionel Sambuc i->index += sizeof(xcb_sync_trigger_t);
175971bb1a5SLionel Sambuc }
176971bb1a5SLionel Sambuc
177971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_sync_trigger_end(xcb_sync_trigger_iterator_t i)178971bb1a5SLionel Sambuc xcb_sync_trigger_end (xcb_sync_trigger_iterator_t i /**< */)
179971bb1a5SLionel Sambuc {
180971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
181971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
182971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
183971bb1a5SLionel Sambuc ret.rem = 0;
184971bb1a5SLionel Sambuc return ret;
185971bb1a5SLionel Sambuc }
186971bb1a5SLionel Sambuc
187971bb1a5SLionel Sambuc void
xcb_sync_waitcondition_next(xcb_sync_waitcondition_iterator_t * i)188971bb1a5SLionel Sambuc xcb_sync_waitcondition_next (xcb_sync_waitcondition_iterator_t *i /**< */)
189971bb1a5SLionel Sambuc {
190971bb1a5SLionel Sambuc --i->rem;
191971bb1a5SLionel Sambuc ++i->data;
192971bb1a5SLionel Sambuc i->index += sizeof(xcb_sync_waitcondition_t);
193971bb1a5SLionel Sambuc }
194971bb1a5SLionel Sambuc
195971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_sync_waitcondition_end(xcb_sync_waitcondition_iterator_t i)196971bb1a5SLionel Sambuc xcb_sync_waitcondition_end (xcb_sync_waitcondition_iterator_t i /**< */)
197971bb1a5SLionel Sambuc {
198971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
199971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
200971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
201971bb1a5SLionel Sambuc ret.rem = 0;
202971bb1a5SLionel Sambuc return ret;
203971bb1a5SLionel Sambuc }
204971bb1a5SLionel Sambuc
205971bb1a5SLionel Sambuc xcb_sync_initialize_cookie_t
xcb_sync_initialize(xcb_connection_t * c,uint8_t desired_major_version,uint8_t desired_minor_version)206971bb1a5SLionel Sambuc xcb_sync_initialize (xcb_connection_t *c /**< */,
207971bb1a5SLionel Sambuc uint8_t desired_major_version /**< */,
208971bb1a5SLionel Sambuc uint8_t desired_minor_version /**< */)
209971bb1a5SLionel Sambuc {
210971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
211971bb1a5SLionel Sambuc /* count */ 2,
212971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
213971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_INITIALIZE,
214971bb1a5SLionel Sambuc /* isvoid */ 0
215971bb1a5SLionel Sambuc };
216971bb1a5SLionel Sambuc
217971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
218971bb1a5SLionel Sambuc xcb_sync_initialize_cookie_t xcb_ret;
219971bb1a5SLionel Sambuc xcb_sync_initialize_request_t xcb_out;
220971bb1a5SLionel Sambuc
221971bb1a5SLionel Sambuc xcb_out.desired_major_version = desired_major_version;
222971bb1a5SLionel Sambuc xcb_out.desired_minor_version = desired_minor_version;
223971bb1a5SLionel Sambuc
224971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
225971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
226971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
227971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
228971bb1a5SLionel Sambuc
229971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
230971bb1a5SLionel Sambuc return xcb_ret;
231971bb1a5SLionel Sambuc }
232971bb1a5SLionel Sambuc
233971bb1a5SLionel Sambuc xcb_sync_initialize_cookie_t
xcb_sync_initialize_unchecked(xcb_connection_t * c,uint8_t desired_major_version,uint8_t desired_minor_version)234971bb1a5SLionel Sambuc xcb_sync_initialize_unchecked (xcb_connection_t *c /**< */,
235971bb1a5SLionel Sambuc uint8_t desired_major_version /**< */,
236971bb1a5SLionel Sambuc uint8_t desired_minor_version /**< */)
237971bb1a5SLionel Sambuc {
238971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
239971bb1a5SLionel Sambuc /* count */ 2,
240971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
241971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_INITIALIZE,
242971bb1a5SLionel Sambuc /* isvoid */ 0
243971bb1a5SLionel Sambuc };
244971bb1a5SLionel Sambuc
245971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
246971bb1a5SLionel Sambuc xcb_sync_initialize_cookie_t xcb_ret;
247971bb1a5SLionel Sambuc xcb_sync_initialize_request_t xcb_out;
248971bb1a5SLionel Sambuc
249971bb1a5SLionel Sambuc xcb_out.desired_major_version = desired_major_version;
250971bb1a5SLionel Sambuc xcb_out.desired_minor_version = desired_minor_version;
251971bb1a5SLionel Sambuc
252971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
253971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
254971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
255971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
256971bb1a5SLionel Sambuc
257971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
258971bb1a5SLionel Sambuc return xcb_ret;
259971bb1a5SLionel Sambuc }
260971bb1a5SLionel Sambuc
261971bb1a5SLionel Sambuc xcb_sync_initialize_reply_t *
xcb_sync_initialize_reply(xcb_connection_t * c,xcb_sync_initialize_cookie_t cookie,xcb_generic_error_t ** e)262971bb1a5SLionel Sambuc xcb_sync_initialize_reply (xcb_connection_t *c /**< */,
263971bb1a5SLionel Sambuc xcb_sync_initialize_cookie_t cookie /**< */,
264971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
265971bb1a5SLionel Sambuc {
266971bb1a5SLionel Sambuc return (xcb_sync_initialize_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
267971bb1a5SLionel Sambuc }
268971bb1a5SLionel Sambuc
269971bb1a5SLionel Sambuc int
xcb_sync_list_system_counters_sizeof(const void * _buffer)270971bb1a5SLionel Sambuc xcb_sync_list_system_counters_sizeof (const void *_buffer /**< */)
271971bb1a5SLionel Sambuc {
272971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
273971bb1a5SLionel Sambuc const xcb_sync_list_system_counters_reply_t *_aux = (xcb_sync_list_system_counters_reply_t *)_buffer;
274971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
275971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
276971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
277*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
278971bb1a5SLionel Sambuc
279971bb1a5SLionel Sambuc unsigned int i;
280971bb1a5SLionel Sambuc unsigned int xcb_tmp_len;
281971bb1a5SLionel Sambuc
282971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_sync_list_system_counters_reply_t);
283971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
284*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
285*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
286971bb1a5SLionel Sambuc /* counters */
287971bb1a5SLionel Sambuc for(i=0; i<_aux->counters_len; i++) {
288971bb1a5SLionel Sambuc xcb_tmp_len = xcb_sync_systemcounter_sizeof(xcb_tmp);
289971bb1a5SLionel Sambuc xcb_block_len += xcb_tmp_len;
290971bb1a5SLionel Sambuc xcb_tmp += xcb_tmp_len;
291971bb1a5SLionel Sambuc }
292971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_systemcounter_t);
293971bb1a5SLionel Sambuc /* insert padding */
294971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
295971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
296971bb1a5SLionel Sambuc if (0 != xcb_pad) {
297971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
298971bb1a5SLionel Sambuc xcb_pad = 0;
299971bb1a5SLionel Sambuc }
300971bb1a5SLionel Sambuc xcb_block_len = 0;
301971bb1a5SLionel Sambuc
302971bb1a5SLionel Sambuc return xcb_buffer_len;
303971bb1a5SLionel Sambuc }
304971bb1a5SLionel Sambuc
305971bb1a5SLionel Sambuc xcb_sync_list_system_counters_cookie_t
xcb_sync_list_system_counters(xcb_connection_t * c)306971bb1a5SLionel Sambuc xcb_sync_list_system_counters (xcb_connection_t *c /**< */)
307971bb1a5SLionel Sambuc {
308971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
309971bb1a5SLionel Sambuc /* count */ 2,
310971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
311971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_LIST_SYSTEM_COUNTERS,
312971bb1a5SLionel Sambuc /* isvoid */ 0
313971bb1a5SLionel Sambuc };
314971bb1a5SLionel Sambuc
315971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
316971bb1a5SLionel Sambuc xcb_sync_list_system_counters_cookie_t xcb_ret;
317971bb1a5SLionel Sambuc xcb_sync_list_system_counters_request_t xcb_out;
318971bb1a5SLionel Sambuc
319971bb1a5SLionel Sambuc
320971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
321971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
322971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
323971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
324971bb1a5SLionel Sambuc
325971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
326971bb1a5SLionel Sambuc return xcb_ret;
327971bb1a5SLionel Sambuc }
328971bb1a5SLionel Sambuc
329971bb1a5SLionel Sambuc xcb_sync_list_system_counters_cookie_t
xcb_sync_list_system_counters_unchecked(xcb_connection_t * c)330971bb1a5SLionel Sambuc xcb_sync_list_system_counters_unchecked (xcb_connection_t *c /**< */)
331971bb1a5SLionel Sambuc {
332971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
333971bb1a5SLionel Sambuc /* count */ 2,
334971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
335971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_LIST_SYSTEM_COUNTERS,
336971bb1a5SLionel Sambuc /* isvoid */ 0
337971bb1a5SLionel Sambuc };
338971bb1a5SLionel Sambuc
339971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
340971bb1a5SLionel Sambuc xcb_sync_list_system_counters_cookie_t xcb_ret;
341971bb1a5SLionel Sambuc xcb_sync_list_system_counters_request_t xcb_out;
342971bb1a5SLionel Sambuc
343971bb1a5SLionel Sambuc
344971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
345971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
346971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
347971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
348971bb1a5SLionel Sambuc
349971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
350971bb1a5SLionel Sambuc return xcb_ret;
351971bb1a5SLionel Sambuc }
352971bb1a5SLionel Sambuc
353971bb1a5SLionel Sambuc int
xcb_sync_list_system_counters_counters_length(const xcb_sync_list_system_counters_reply_t * R)354971bb1a5SLionel Sambuc xcb_sync_list_system_counters_counters_length (const xcb_sync_list_system_counters_reply_t *R /**< */)
355971bb1a5SLionel Sambuc {
356971bb1a5SLionel Sambuc return R->counters_len;
357971bb1a5SLionel Sambuc }
358971bb1a5SLionel Sambuc
359971bb1a5SLionel Sambuc xcb_sync_systemcounter_iterator_t
xcb_sync_list_system_counters_counters_iterator(const xcb_sync_list_system_counters_reply_t * R)360971bb1a5SLionel Sambuc xcb_sync_list_system_counters_counters_iterator (const xcb_sync_list_system_counters_reply_t *R /**< */)
361971bb1a5SLionel Sambuc {
362971bb1a5SLionel Sambuc xcb_sync_systemcounter_iterator_t i;
363971bb1a5SLionel Sambuc i.data = (xcb_sync_systemcounter_t *) (R + 1);
364971bb1a5SLionel Sambuc i.rem = R->counters_len;
365971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
366971bb1a5SLionel Sambuc return i;
367971bb1a5SLionel Sambuc }
368971bb1a5SLionel Sambuc
369971bb1a5SLionel Sambuc xcb_sync_list_system_counters_reply_t *
xcb_sync_list_system_counters_reply(xcb_connection_t * c,xcb_sync_list_system_counters_cookie_t cookie,xcb_generic_error_t ** e)370971bb1a5SLionel Sambuc xcb_sync_list_system_counters_reply (xcb_connection_t *c /**< */,
371971bb1a5SLionel Sambuc xcb_sync_list_system_counters_cookie_t cookie /**< */,
372971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
373971bb1a5SLionel Sambuc {
374971bb1a5SLionel Sambuc return (xcb_sync_list_system_counters_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
375971bb1a5SLionel Sambuc }
376971bb1a5SLionel Sambuc
377971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_create_counter_checked(xcb_connection_t * c,xcb_sync_counter_t id,xcb_sync_int64_t initial_value)378971bb1a5SLionel Sambuc xcb_sync_create_counter_checked (xcb_connection_t *c /**< */,
379971bb1a5SLionel Sambuc xcb_sync_counter_t id /**< */,
380971bb1a5SLionel Sambuc xcb_sync_int64_t initial_value /**< */)
381971bb1a5SLionel Sambuc {
382971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
383971bb1a5SLionel Sambuc /* count */ 2,
384971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
385971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_CREATE_COUNTER,
386971bb1a5SLionel Sambuc /* isvoid */ 1
387971bb1a5SLionel Sambuc };
388971bb1a5SLionel Sambuc
389971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
390971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
391971bb1a5SLionel Sambuc xcb_sync_create_counter_request_t xcb_out;
392971bb1a5SLionel Sambuc
393971bb1a5SLionel Sambuc xcb_out.id = id;
394971bb1a5SLionel Sambuc xcb_out.initial_value = initial_value;
395971bb1a5SLionel Sambuc
396971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
397971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
398971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
399971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
400971bb1a5SLionel Sambuc
401971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
402971bb1a5SLionel Sambuc return xcb_ret;
403971bb1a5SLionel Sambuc }
404971bb1a5SLionel Sambuc
405971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_create_counter(xcb_connection_t * c,xcb_sync_counter_t id,xcb_sync_int64_t initial_value)406971bb1a5SLionel Sambuc xcb_sync_create_counter (xcb_connection_t *c /**< */,
407971bb1a5SLionel Sambuc xcb_sync_counter_t id /**< */,
408971bb1a5SLionel Sambuc xcb_sync_int64_t initial_value /**< */)
409971bb1a5SLionel Sambuc {
410971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
411971bb1a5SLionel Sambuc /* count */ 2,
412971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
413971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_CREATE_COUNTER,
414971bb1a5SLionel Sambuc /* isvoid */ 1
415971bb1a5SLionel Sambuc };
416971bb1a5SLionel Sambuc
417971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
418971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
419971bb1a5SLionel Sambuc xcb_sync_create_counter_request_t xcb_out;
420971bb1a5SLionel Sambuc
421971bb1a5SLionel Sambuc xcb_out.id = id;
422971bb1a5SLionel Sambuc xcb_out.initial_value = initial_value;
423971bb1a5SLionel Sambuc
424971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
425971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
426971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
427971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
428971bb1a5SLionel Sambuc
429971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
430971bb1a5SLionel Sambuc return xcb_ret;
431971bb1a5SLionel Sambuc }
432971bb1a5SLionel Sambuc
433971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_destroy_counter_checked(xcb_connection_t * c,xcb_sync_counter_t counter)434971bb1a5SLionel Sambuc xcb_sync_destroy_counter_checked (xcb_connection_t *c /**< */,
435971bb1a5SLionel Sambuc xcb_sync_counter_t counter /**< */)
436971bb1a5SLionel Sambuc {
437971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
438971bb1a5SLionel Sambuc /* count */ 2,
439971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
440971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_DESTROY_COUNTER,
441971bb1a5SLionel Sambuc /* isvoid */ 1
442971bb1a5SLionel Sambuc };
443971bb1a5SLionel Sambuc
444971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
445971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
446971bb1a5SLionel Sambuc xcb_sync_destroy_counter_request_t xcb_out;
447971bb1a5SLionel Sambuc
448971bb1a5SLionel Sambuc xcb_out.counter = counter;
449971bb1a5SLionel Sambuc
450971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
451971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
452971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
453971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
454971bb1a5SLionel Sambuc
455971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
456971bb1a5SLionel Sambuc return xcb_ret;
457971bb1a5SLionel Sambuc }
458971bb1a5SLionel Sambuc
459971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_destroy_counter(xcb_connection_t * c,xcb_sync_counter_t counter)460971bb1a5SLionel Sambuc xcb_sync_destroy_counter (xcb_connection_t *c /**< */,
461971bb1a5SLionel Sambuc xcb_sync_counter_t counter /**< */)
462971bb1a5SLionel Sambuc {
463971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
464971bb1a5SLionel Sambuc /* count */ 2,
465971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
466971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_DESTROY_COUNTER,
467971bb1a5SLionel Sambuc /* isvoid */ 1
468971bb1a5SLionel Sambuc };
469971bb1a5SLionel Sambuc
470971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
471971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
472971bb1a5SLionel Sambuc xcb_sync_destroy_counter_request_t xcb_out;
473971bb1a5SLionel Sambuc
474971bb1a5SLionel Sambuc xcb_out.counter = counter;
475971bb1a5SLionel Sambuc
476971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
477971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
478971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
479971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
480971bb1a5SLionel Sambuc
481971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
482971bb1a5SLionel Sambuc return xcb_ret;
483971bb1a5SLionel Sambuc }
484971bb1a5SLionel Sambuc
485971bb1a5SLionel Sambuc xcb_sync_query_counter_cookie_t
xcb_sync_query_counter(xcb_connection_t * c,xcb_sync_counter_t counter)486971bb1a5SLionel Sambuc xcb_sync_query_counter (xcb_connection_t *c /**< */,
487971bb1a5SLionel Sambuc xcb_sync_counter_t counter /**< */)
488971bb1a5SLionel Sambuc {
489971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
490971bb1a5SLionel Sambuc /* count */ 2,
491971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
492971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_QUERY_COUNTER,
493971bb1a5SLionel Sambuc /* isvoid */ 0
494971bb1a5SLionel Sambuc };
495971bb1a5SLionel Sambuc
496971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
497971bb1a5SLionel Sambuc xcb_sync_query_counter_cookie_t xcb_ret;
498971bb1a5SLionel Sambuc xcb_sync_query_counter_request_t xcb_out;
499971bb1a5SLionel Sambuc
500971bb1a5SLionel Sambuc xcb_out.counter = counter;
501971bb1a5SLionel Sambuc
502971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
503971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
504971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
505971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
506971bb1a5SLionel Sambuc
507971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
508971bb1a5SLionel Sambuc return xcb_ret;
509971bb1a5SLionel Sambuc }
510971bb1a5SLionel Sambuc
511971bb1a5SLionel Sambuc xcb_sync_query_counter_cookie_t
xcb_sync_query_counter_unchecked(xcb_connection_t * c,xcb_sync_counter_t counter)512971bb1a5SLionel Sambuc xcb_sync_query_counter_unchecked (xcb_connection_t *c /**< */,
513971bb1a5SLionel Sambuc xcb_sync_counter_t counter /**< */)
514971bb1a5SLionel Sambuc {
515971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
516971bb1a5SLionel Sambuc /* count */ 2,
517971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
518971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_QUERY_COUNTER,
519971bb1a5SLionel Sambuc /* isvoid */ 0
520971bb1a5SLionel Sambuc };
521971bb1a5SLionel Sambuc
522971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
523971bb1a5SLionel Sambuc xcb_sync_query_counter_cookie_t xcb_ret;
524971bb1a5SLionel Sambuc xcb_sync_query_counter_request_t xcb_out;
525971bb1a5SLionel Sambuc
526971bb1a5SLionel Sambuc xcb_out.counter = counter;
527971bb1a5SLionel Sambuc
528971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
529971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
530971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
531971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
532971bb1a5SLionel Sambuc
533971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
534971bb1a5SLionel Sambuc return xcb_ret;
535971bb1a5SLionel Sambuc }
536971bb1a5SLionel Sambuc
537971bb1a5SLionel Sambuc xcb_sync_query_counter_reply_t *
xcb_sync_query_counter_reply(xcb_connection_t * c,xcb_sync_query_counter_cookie_t cookie,xcb_generic_error_t ** e)538971bb1a5SLionel Sambuc xcb_sync_query_counter_reply (xcb_connection_t *c /**< */,
539971bb1a5SLionel Sambuc xcb_sync_query_counter_cookie_t cookie /**< */,
540971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
541971bb1a5SLionel Sambuc {
542971bb1a5SLionel Sambuc return (xcb_sync_query_counter_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
543971bb1a5SLionel Sambuc }
544971bb1a5SLionel Sambuc
545971bb1a5SLionel Sambuc int
xcb_sync_await_sizeof(const void * _buffer,uint32_t wait_list_len)546971bb1a5SLionel Sambuc xcb_sync_await_sizeof (const void *_buffer /**< */,
547971bb1a5SLionel Sambuc uint32_t wait_list_len /**< */)
548971bb1a5SLionel Sambuc {
549971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
550971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
551971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
552971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
553*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
554971bb1a5SLionel Sambuc
555971bb1a5SLionel Sambuc
556971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_sync_await_request_t);
557971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
558*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
559*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
560971bb1a5SLionel Sambuc /* wait_list */
561971bb1a5SLionel Sambuc xcb_block_len += wait_list_len * sizeof(xcb_sync_waitcondition_t);
562971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
563971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_waitcondition_t);
564971bb1a5SLionel Sambuc /* insert padding */
565971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
566971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
567971bb1a5SLionel Sambuc if (0 != xcb_pad) {
568971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
569971bb1a5SLionel Sambuc xcb_pad = 0;
570971bb1a5SLionel Sambuc }
571971bb1a5SLionel Sambuc xcb_block_len = 0;
572971bb1a5SLionel Sambuc
573971bb1a5SLionel Sambuc return xcb_buffer_len;
574971bb1a5SLionel Sambuc }
575971bb1a5SLionel Sambuc
576971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_await_checked(xcb_connection_t * c,uint32_t wait_list_len,const xcb_sync_waitcondition_t * wait_list)577971bb1a5SLionel Sambuc xcb_sync_await_checked (xcb_connection_t *c /**< */,
578971bb1a5SLionel Sambuc uint32_t wait_list_len /**< */,
579971bb1a5SLionel Sambuc const xcb_sync_waitcondition_t *wait_list /**< */)
580971bb1a5SLionel Sambuc {
581971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
582971bb1a5SLionel Sambuc /* count */ 4,
583971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
584971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_AWAIT,
585971bb1a5SLionel Sambuc /* isvoid */ 1
586971bb1a5SLionel Sambuc };
587971bb1a5SLionel Sambuc
588971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
589971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
590971bb1a5SLionel Sambuc xcb_sync_await_request_t xcb_out;
591971bb1a5SLionel Sambuc
592971bb1a5SLionel Sambuc
593971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
594971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
595971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
596971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
597971bb1a5SLionel Sambuc /* xcb_sync_waitcondition_t wait_list */
598971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) wait_list;
599971bb1a5SLionel Sambuc xcb_parts[4].iov_len = wait_list_len * sizeof(xcb_sync_waitcondition_t);
600971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
601971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
602971bb1a5SLionel Sambuc
603971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
604971bb1a5SLionel Sambuc return xcb_ret;
605971bb1a5SLionel Sambuc }
606971bb1a5SLionel Sambuc
607971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_await(xcb_connection_t * c,uint32_t wait_list_len,const xcb_sync_waitcondition_t * wait_list)608971bb1a5SLionel Sambuc xcb_sync_await (xcb_connection_t *c /**< */,
609971bb1a5SLionel Sambuc uint32_t wait_list_len /**< */,
610971bb1a5SLionel Sambuc const xcb_sync_waitcondition_t *wait_list /**< */)
611971bb1a5SLionel Sambuc {
612971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
613971bb1a5SLionel Sambuc /* count */ 4,
614971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
615971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_AWAIT,
616971bb1a5SLionel Sambuc /* isvoid */ 1
617971bb1a5SLionel Sambuc };
618971bb1a5SLionel Sambuc
619971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
620971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
621971bb1a5SLionel Sambuc xcb_sync_await_request_t xcb_out;
622971bb1a5SLionel Sambuc
623971bb1a5SLionel Sambuc
624971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
625971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
626971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
627971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
628971bb1a5SLionel Sambuc /* xcb_sync_waitcondition_t wait_list */
629971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) wait_list;
630971bb1a5SLionel Sambuc xcb_parts[4].iov_len = wait_list_len * sizeof(xcb_sync_waitcondition_t);
631971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
632971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
633971bb1a5SLionel Sambuc
634971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
635971bb1a5SLionel Sambuc return xcb_ret;
636971bb1a5SLionel Sambuc }
637971bb1a5SLionel Sambuc
638971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_change_counter_checked(xcb_connection_t * c,xcb_sync_counter_t counter,xcb_sync_int64_t amount)639971bb1a5SLionel Sambuc xcb_sync_change_counter_checked (xcb_connection_t *c /**< */,
640971bb1a5SLionel Sambuc xcb_sync_counter_t counter /**< */,
641971bb1a5SLionel Sambuc xcb_sync_int64_t amount /**< */)
642971bb1a5SLionel Sambuc {
643971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
644971bb1a5SLionel Sambuc /* count */ 2,
645971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
646971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_CHANGE_COUNTER,
647971bb1a5SLionel Sambuc /* isvoid */ 1
648971bb1a5SLionel Sambuc };
649971bb1a5SLionel Sambuc
650971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
651971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
652971bb1a5SLionel Sambuc xcb_sync_change_counter_request_t xcb_out;
653971bb1a5SLionel Sambuc
654971bb1a5SLionel Sambuc xcb_out.counter = counter;
655971bb1a5SLionel Sambuc xcb_out.amount = amount;
656971bb1a5SLionel Sambuc
657971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
658971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
659971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
660971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
661971bb1a5SLionel Sambuc
662971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
663971bb1a5SLionel Sambuc return xcb_ret;
664971bb1a5SLionel Sambuc }
665971bb1a5SLionel Sambuc
666971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_change_counter(xcb_connection_t * c,xcb_sync_counter_t counter,xcb_sync_int64_t amount)667971bb1a5SLionel Sambuc xcb_sync_change_counter (xcb_connection_t *c /**< */,
668971bb1a5SLionel Sambuc xcb_sync_counter_t counter /**< */,
669971bb1a5SLionel Sambuc xcb_sync_int64_t amount /**< */)
670971bb1a5SLionel Sambuc {
671971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
672971bb1a5SLionel Sambuc /* count */ 2,
673971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
674971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_CHANGE_COUNTER,
675971bb1a5SLionel Sambuc /* isvoid */ 1
676971bb1a5SLionel Sambuc };
677971bb1a5SLionel Sambuc
678971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
679971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
680971bb1a5SLionel Sambuc xcb_sync_change_counter_request_t xcb_out;
681971bb1a5SLionel Sambuc
682971bb1a5SLionel Sambuc xcb_out.counter = counter;
683971bb1a5SLionel Sambuc xcb_out.amount = amount;
684971bb1a5SLionel Sambuc
685971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
686971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
687971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
688971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
689971bb1a5SLionel Sambuc
690971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
691971bb1a5SLionel Sambuc return xcb_ret;
692971bb1a5SLionel Sambuc }
693971bb1a5SLionel Sambuc
694971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_set_counter_checked(xcb_connection_t * c,xcb_sync_counter_t counter,xcb_sync_int64_t value)695971bb1a5SLionel Sambuc xcb_sync_set_counter_checked (xcb_connection_t *c /**< */,
696971bb1a5SLionel Sambuc xcb_sync_counter_t counter /**< */,
697971bb1a5SLionel Sambuc xcb_sync_int64_t value /**< */)
698971bb1a5SLionel Sambuc {
699971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
700971bb1a5SLionel Sambuc /* count */ 2,
701971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
702971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_SET_COUNTER,
703971bb1a5SLionel Sambuc /* isvoid */ 1
704971bb1a5SLionel Sambuc };
705971bb1a5SLionel Sambuc
706971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
707971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
708971bb1a5SLionel Sambuc xcb_sync_set_counter_request_t xcb_out;
709971bb1a5SLionel Sambuc
710971bb1a5SLionel Sambuc xcb_out.counter = counter;
711971bb1a5SLionel Sambuc xcb_out.value = value;
712971bb1a5SLionel Sambuc
713971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
714971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
715971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
716971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
717971bb1a5SLionel Sambuc
718971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
719971bb1a5SLionel Sambuc return xcb_ret;
720971bb1a5SLionel Sambuc }
721971bb1a5SLionel Sambuc
722971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_set_counter(xcb_connection_t * c,xcb_sync_counter_t counter,xcb_sync_int64_t value)723971bb1a5SLionel Sambuc xcb_sync_set_counter (xcb_connection_t *c /**< */,
724971bb1a5SLionel Sambuc xcb_sync_counter_t counter /**< */,
725971bb1a5SLionel Sambuc xcb_sync_int64_t value /**< */)
726971bb1a5SLionel Sambuc {
727971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
728971bb1a5SLionel Sambuc /* count */ 2,
729971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
730971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_SET_COUNTER,
731971bb1a5SLionel Sambuc /* isvoid */ 1
732971bb1a5SLionel Sambuc };
733971bb1a5SLionel Sambuc
734971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
735971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
736971bb1a5SLionel Sambuc xcb_sync_set_counter_request_t xcb_out;
737971bb1a5SLionel Sambuc
738971bb1a5SLionel Sambuc xcb_out.counter = counter;
739971bb1a5SLionel Sambuc xcb_out.value = value;
740971bb1a5SLionel Sambuc
741971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
742971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
743971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
744971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
745971bb1a5SLionel Sambuc
746971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
747971bb1a5SLionel Sambuc return xcb_ret;
748971bb1a5SLionel Sambuc }
749971bb1a5SLionel Sambuc
750971bb1a5SLionel Sambuc int
xcb_sync_create_alarm_value_list_serialize(void ** _buffer,uint32_t value_mask,const xcb_sync_create_alarm_value_list_t * _aux)751*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_value_list_serialize (void **_buffer /**< */,
752*0a6a1f1dSLionel Sambuc uint32_t value_mask /**< */,
753*0a6a1f1dSLionel Sambuc const xcb_sync_create_alarm_value_list_t *_aux /**< */)
754*0a6a1f1dSLionel Sambuc {
755*0a6a1f1dSLionel Sambuc char *xcb_out = *_buffer;
756*0a6a1f1dSLionel Sambuc unsigned int xcb_buffer_len = 0;
757*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
758*0a6a1f1dSLionel Sambuc
759*0a6a1f1dSLionel Sambuc unsigned int xcb_pad = 0;
760*0a6a1f1dSLionel Sambuc char xcb_pad0[3] = {0, 0, 0};
761*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[7];
762*0a6a1f1dSLionel Sambuc unsigned int xcb_parts_idx = 0;
763*0a6a1f1dSLionel Sambuc unsigned int xcb_block_len = 0;
764*0a6a1f1dSLionel Sambuc unsigned int i;
765*0a6a1f1dSLionel Sambuc char *xcb_tmp;
766*0a6a1f1dSLionel Sambuc
767*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_COUNTER) {
768*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.counter */
769*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->counter;
770*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_counter_t);
771*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_sync_counter_t);
772*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
773*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_counter_t);
774*0a6a1f1dSLionel Sambuc }
775*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_VALUE_TYPE) {
776*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.valueType */
777*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->valueType;
778*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
779*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
780*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
781*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
782*0a6a1f1dSLionel Sambuc }
783*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_VALUE) {
784*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.value */
785*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->value;
786*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_int64_t);
787*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_sync_int64_t);
788*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
789*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_int64_t);
790*0a6a1f1dSLionel Sambuc }
791*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_TEST_TYPE) {
792*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.testType */
793*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->testType;
794*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
795*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
796*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
797*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
798*0a6a1f1dSLionel Sambuc }
799*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_DELTA) {
800*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.delta */
801*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->delta;
802*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_int64_t);
803*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_sync_int64_t);
804*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
805*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_int64_t);
806*0a6a1f1dSLionel Sambuc }
807*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_EVENTS) {
808*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.events */
809*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->events;
810*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
811*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
812*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
813*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
814*0a6a1f1dSLionel Sambuc }
815*0a6a1f1dSLionel Sambuc /* insert padding */
816*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
817*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
818*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
819*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
820*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
821*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
822*0a6a1f1dSLionel Sambuc xcb_pad = 0;
823*0a6a1f1dSLionel Sambuc }
824*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
825*0a6a1f1dSLionel Sambuc
826*0a6a1f1dSLionel Sambuc if (NULL == xcb_out) {
827*0a6a1f1dSLionel Sambuc /* allocate memory */
828*0a6a1f1dSLionel Sambuc xcb_out = malloc(xcb_buffer_len);
829*0a6a1f1dSLionel Sambuc *_buffer = xcb_out;
830*0a6a1f1dSLionel Sambuc }
831*0a6a1f1dSLionel Sambuc
832*0a6a1f1dSLionel Sambuc xcb_tmp = xcb_out;
833*0a6a1f1dSLionel Sambuc for(i=0; i<xcb_parts_idx; i++) {
834*0a6a1f1dSLionel Sambuc if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
835*0a6a1f1dSLionel Sambuc memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
836*0a6a1f1dSLionel Sambuc if (0 != xcb_parts[i].iov_len)
837*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_parts[i].iov_len;
838*0a6a1f1dSLionel Sambuc }
839*0a6a1f1dSLionel Sambuc
840*0a6a1f1dSLionel Sambuc return xcb_buffer_len;
841*0a6a1f1dSLionel Sambuc }
842*0a6a1f1dSLionel Sambuc
843*0a6a1f1dSLionel Sambuc int
xcb_sync_create_alarm_value_list_unpack(const void * _buffer,uint32_t value_mask,xcb_sync_create_alarm_value_list_t * _aux)844*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_value_list_unpack (const void *_buffer /**< */,
845*0a6a1f1dSLionel Sambuc uint32_t value_mask /**< */,
846*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_value_list_t *_aux /**< */)
847971bb1a5SLionel Sambuc {
848971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
849971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
850971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
851971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
852*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
853971bb1a5SLionel Sambuc
854971bb1a5SLionel Sambuc
855*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_COUNTER) {
856*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.counter */
857*0a6a1f1dSLionel Sambuc _aux->counter = *(xcb_sync_counter_t *)xcb_tmp;
858*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_counter_t);
859*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(xcb_sync_counter_t);
860*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_counter_t);
861*0a6a1f1dSLionel Sambuc }
862*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_VALUE_TYPE) {
863*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.valueType */
864*0a6a1f1dSLionel Sambuc _aux->valueType = *(uint32_t *)xcb_tmp;
865*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
866*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(uint32_t);
867971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
868*0a6a1f1dSLionel Sambuc }
869*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_VALUE) {
870*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.value */
871*0a6a1f1dSLionel Sambuc _aux->value = *(xcb_sync_int64_t *)xcb_tmp;
872*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_int64_t);
873*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(xcb_sync_int64_t);
874*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_int64_t);
875*0a6a1f1dSLionel Sambuc }
876*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_TEST_TYPE) {
877*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.testType */
878*0a6a1f1dSLionel Sambuc _aux->testType = *(uint32_t *)xcb_tmp;
879*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
880*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(uint32_t);
881*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
882*0a6a1f1dSLionel Sambuc }
883*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_DELTA) {
884*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.delta */
885*0a6a1f1dSLionel Sambuc _aux->delta = *(xcb_sync_int64_t *)xcb_tmp;
886*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_int64_t);
887*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(xcb_sync_int64_t);
888*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_int64_t);
889*0a6a1f1dSLionel Sambuc }
890*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_EVENTS) {
891*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t.events */
892*0a6a1f1dSLionel Sambuc _aux->events = *(uint32_t *)xcb_tmp;
893*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
894*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(uint32_t);
895*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
896*0a6a1f1dSLionel Sambuc }
897971bb1a5SLionel Sambuc /* insert padding */
898971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
899971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
900971bb1a5SLionel Sambuc if (0 != xcb_pad) {
901971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
902971bb1a5SLionel Sambuc xcb_pad = 0;
903971bb1a5SLionel Sambuc }
904971bb1a5SLionel Sambuc xcb_block_len = 0;
905971bb1a5SLionel Sambuc
906971bb1a5SLionel Sambuc return xcb_buffer_len;
907971bb1a5SLionel Sambuc }
908971bb1a5SLionel Sambuc
909*0a6a1f1dSLionel Sambuc int
xcb_sync_create_alarm_value_list_sizeof(const void * _buffer,uint32_t value_mask)910*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_value_list_sizeof (const void *_buffer /**< */,
911*0a6a1f1dSLionel Sambuc uint32_t value_mask /**< */)
912*0a6a1f1dSLionel Sambuc {
913*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_value_list_t _aux;
914*0a6a1f1dSLionel Sambuc return xcb_sync_create_alarm_value_list_unpack(_buffer, value_mask, &_aux);
915*0a6a1f1dSLionel Sambuc }
916971bb1a5SLionel Sambuc
917971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_create_alarm_checked(xcb_connection_t * c,xcb_sync_alarm_t id,uint32_t value_mask,const void * value_list)918971bb1a5SLionel Sambuc xcb_sync_create_alarm_checked (xcb_connection_t *c /**< */,
919971bb1a5SLionel Sambuc xcb_sync_alarm_t id /**< */,
920971bb1a5SLionel Sambuc uint32_t value_mask /**< */,
921*0a6a1f1dSLionel Sambuc const void *value_list /**< */)
922971bb1a5SLionel Sambuc {
923971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
924*0a6a1f1dSLionel Sambuc /* count */ 3,
925971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
926971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_CREATE_ALARM,
927971bb1a5SLionel Sambuc /* isvoid */ 1
928971bb1a5SLionel Sambuc };
929971bb1a5SLionel Sambuc
930*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[5];
931971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
932971bb1a5SLionel Sambuc xcb_sync_create_alarm_request_t xcb_out;
933971bb1a5SLionel Sambuc
934971bb1a5SLionel Sambuc xcb_out.id = id;
935971bb1a5SLionel Sambuc xcb_out.value_mask = value_mask;
936971bb1a5SLionel Sambuc
937971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
938971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
939971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
940971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
941*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t value_list */
942971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) value_list;
943*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len =
944*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_value_list_sizeof (value_list, value_mask);
945971bb1a5SLionel Sambuc
946971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
947971bb1a5SLionel Sambuc return xcb_ret;
948971bb1a5SLionel Sambuc }
949971bb1a5SLionel Sambuc
950971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_create_alarm(xcb_connection_t * c,xcb_sync_alarm_t id,uint32_t value_mask,const void * value_list)951971bb1a5SLionel Sambuc xcb_sync_create_alarm (xcb_connection_t *c /**< */,
952971bb1a5SLionel Sambuc xcb_sync_alarm_t id /**< */,
953971bb1a5SLionel Sambuc uint32_t value_mask /**< */,
954*0a6a1f1dSLionel Sambuc const void *value_list /**< */)
955971bb1a5SLionel Sambuc {
956971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
957*0a6a1f1dSLionel Sambuc /* count */ 3,
958971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
959971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_CREATE_ALARM,
960971bb1a5SLionel Sambuc /* isvoid */ 1
961971bb1a5SLionel Sambuc };
962971bb1a5SLionel Sambuc
963*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[5];
964971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
965971bb1a5SLionel Sambuc xcb_sync_create_alarm_request_t xcb_out;
966971bb1a5SLionel Sambuc
967971bb1a5SLionel Sambuc xcb_out.id = id;
968971bb1a5SLionel Sambuc xcb_out.value_mask = value_mask;
969971bb1a5SLionel Sambuc
970971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
971971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
972971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
973971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
974*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t value_list */
975971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) value_list;
976*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len =
977*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_value_list_sizeof (value_list, value_mask);
978971bb1a5SLionel Sambuc
979971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
980971bb1a5SLionel Sambuc return xcb_ret;
981971bb1a5SLionel Sambuc }
982971bb1a5SLionel Sambuc
983*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_sync_create_alarm_aux_checked(xcb_connection_t * c,xcb_sync_alarm_t id,uint32_t value_mask,const xcb_sync_create_alarm_value_list_t * value_list)984*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_aux_checked (xcb_connection_t *c /**< */,
985*0a6a1f1dSLionel Sambuc xcb_sync_alarm_t id /**< */,
986*0a6a1f1dSLionel Sambuc uint32_t value_mask /**< */,
987*0a6a1f1dSLionel Sambuc const xcb_sync_create_alarm_value_list_t *value_list /**< */)
988*0a6a1f1dSLionel Sambuc {
989*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
990*0a6a1f1dSLionel Sambuc /* count */ 3,
991*0a6a1f1dSLionel Sambuc /* ext */ &xcb_sync_id,
992*0a6a1f1dSLionel Sambuc /* opcode */ XCB_SYNC_CREATE_ALARM,
993*0a6a1f1dSLionel Sambuc /* isvoid */ 1
994*0a6a1f1dSLionel Sambuc };
995*0a6a1f1dSLionel Sambuc
996*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[5];
997*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
998*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_request_t xcb_out;
999*0a6a1f1dSLionel Sambuc void *xcb_aux0 = 0;
1000*0a6a1f1dSLionel Sambuc
1001*0a6a1f1dSLionel Sambuc xcb_out.id = id;
1002*0a6a1f1dSLionel Sambuc xcb_out.value_mask = value_mask;
1003*0a6a1f1dSLionel Sambuc
1004*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1005*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1006*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
1007*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1008*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t value_list */
1009*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len =
1010*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_value_list_serialize (&xcb_aux0, value_mask, value_list);
1011*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_base = xcb_aux0;
1012*0a6a1f1dSLionel Sambuc
1013*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1014*0a6a1f1dSLionel Sambuc free(xcb_aux0);
1015*0a6a1f1dSLionel Sambuc return xcb_ret;
1016*0a6a1f1dSLionel Sambuc }
1017*0a6a1f1dSLionel Sambuc
1018*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_sync_create_alarm_aux(xcb_connection_t * c,xcb_sync_alarm_t id,uint32_t value_mask,const xcb_sync_create_alarm_value_list_t * value_list)1019*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_aux (xcb_connection_t *c /**< */,
1020*0a6a1f1dSLionel Sambuc xcb_sync_alarm_t id /**< */,
1021*0a6a1f1dSLionel Sambuc uint32_t value_mask /**< */,
1022*0a6a1f1dSLionel Sambuc const xcb_sync_create_alarm_value_list_t *value_list /**< */)
1023*0a6a1f1dSLionel Sambuc {
1024*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1025*0a6a1f1dSLionel Sambuc /* count */ 3,
1026*0a6a1f1dSLionel Sambuc /* ext */ &xcb_sync_id,
1027*0a6a1f1dSLionel Sambuc /* opcode */ XCB_SYNC_CREATE_ALARM,
1028*0a6a1f1dSLionel Sambuc /* isvoid */ 1
1029*0a6a1f1dSLionel Sambuc };
1030*0a6a1f1dSLionel Sambuc
1031*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[5];
1032*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
1033*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_request_t xcb_out;
1034*0a6a1f1dSLionel Sambuc void *xcb_aux0 = 0;
1035*0a6a1f1dSLionel Sambuc
1036*0a6a1f1dSLionel Sambuc xcb_out.id = id;
1037*0a6a1f1dSLionel Sambuc xcb_out.value_mask = value_mask;
1038*0a6a1f1dSLionel Sambuc
1039*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1040*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1041*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
1042*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1043*0a6a1f1dSLionel Sambuc /* xcb_sync_create_alarm_value_list_t value_list */
1044*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len =
1045*0a6a1f1dSLionel Sambuc xcb_sync_create_alarm_value_list_serialize (&xcb_aux0, value_mask, value_list);
1046*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_base = xcb_aux0;
1047*0a6a1f1dSLionel Sambuc
1048*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1049*0a6a1f1dSLionel Sambuc free(xcb_aux0);
1050*0a6a1f1dSLionel Sambuc return xcb_ret;
1051*0a6a1f1dSLionel Sambuc }
1052*0a6a1f1dSLionel Sambuc
1053971bb1a5SLionel Sambuc int
xcb_sync_change_alarm_value_list_serialize(void ** _buffer,uint32_t value_mask,const xcb_sync_change_alarm_value_list_t * _aux)1054*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_value_list_serialize (void **_buffer /**< */,
1055*0a6a1f1dSLionel Sambuc uint32_t value_mask /**< */,
1056*0a6a1f1dSLionel Sambuc const xcb_sync_change_alarm_value_list_t *_aux /**< */)
1057*0a6a1f1dSLionel Sambuc {
1058*0a6a1f1dSLionel Sambuc char *xcb_out = *_buffer;
1059*0a6a1f1dSLionel Sambuc unsigned int xcb_buffer_len = 0;
1060*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1061*0a6a1f1dSLionel Sambuc
1062*0a6a1f1dSLionel Sambuc unsigned int xcb_pad = 0;
1063*0a6a1f1dSLionel Sambuc char xcb_pad0[3] = {0, 0, 0};
1064*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[7];
1065*0a6a1f1dSLionel Sambuc unsigned int xcb_parts_idx = 0;
1066*0a6a1f1dSLionel Sambuc unsigned int xcb_block_len = 0;
1067*0a6a1f1dSLionel Sambuc unsigned int i;
1068*0a6a1f1dSLionel Sambuc char *xcb_tmp;
1069*0a6a1f1dSLionel Sambuc
1070*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_COUNTER) {
1071*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.counter */
1072*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->counter;
1073*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_counter_t);
1074*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_sync_counter_t);
1075*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
1076*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_counter_t);
1077*0a6a1f1dSLionel Sambuc }
1078*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_VALUE_TYPE) {
1079*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.valueType */
1080*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->valueType;
1081*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
1082*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
1083*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
1084*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1085*0a6a1f1dSLionel Sambuc }
1086*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_VALUE) {
1087*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.value */
1088*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->value;
1089*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_int64_t);
1090*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_sync_int64_t);
1091*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
1092*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_int64_t);
1093*0a6a1f1dSLionel Sambuc }
1094*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_TEST_TYPE) {
1095*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.testType */
1096*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->testType;
1097*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
1098*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
1099*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
1100*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1101*0a6a1f1dSLionel Sambuc }
1102*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_DELTA) {
1103*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.delta */
1104*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->delta;
1105*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_int64_t);
1106*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_sync_int64_t);
1107*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
1108*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_int64_t);
1109*0a6a1f1dSLionel Sambuc }
1110*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_EVENTS) {
1111*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.events */
1112*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->events;
1113*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
1114*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
1115*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
1116*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1117*0a6a1f1dSLionel Sambuc }
1118*0a6a1f1dSLionel Sambuc /* insert padding */
1119*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1120*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1121*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
1122*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
1123*0a6a1f1dSLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
1124*0a6a1f1dSLionel Sambuc xcb_parts_idx++;
1125*0a6a1f1dSLionel Sambuc xcb_pad = 0;
1126*0a6a1f1dSLionel Sambuc }
1127*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1128*0a6a1f1dSLionel Sambuc
1129*0a6a1f1dSLionel Sambuc if (NULL == xcb_out) {
1130*0a6a1f1dSLionel Sambuc /* allocate memory */
1131*0a6a1f1dSLionel Sambuc xcb_out = malloc(xcb_buffer_len);
1132*0a6a1f1dSLionel Sambuc *_buffer = xcb_out;
1133*0a6a1f1dSLionel Sambuc }
1134*0a6a1f1dSLionel Sambuc
1135*0a6a1f1dSLionel Sambuc xcb_tmp = xcb_out;
1136*0a6a1f1dSLionel Sambuc for(i=0; i<xcb_parts_idx; i++) {
1137*0a6a1f1dSLionel Sambuc if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
1138*0a6a1f1dSLionel Sambuc memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
1139*0a6a1f1dSLionel Sambuc if (0 != xcb_parts[i].iov_len)
1140*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_parts[i].iov_len;
1141*0a6a1f1dSLionel Sambuc }
1142*0a6a1f1dSLionel Sambuc
1143*0a6a1f1dSLionel Sambuc return xcb_buffer_len;
1144*0a6a1f1dSLionel Sambuc }
1145*0a6a1f1dSLionel Sambuc
1146*0a6a1f1dSLionel Sambuc int
xcb_sync_change_alarm_value_list_unpack(const void * _buffer,uint32_t value_mask,xcb_sync_change_alarm_value_list_t * _aux)1147*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_value_list_unpack (const void *_buffer /**< */,
1148*0a6a1f1dSLionel Sambuc uint32_t value_mask /**< */,
1149*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_value_list_t *_aux /**< */)
1150971bb1a5SLionel Sambuc {
1151971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1152971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1153971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1154971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1155*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1156971bb1a5SLionel Sambuc
1157971bb1a5SLionel Sambuc
1158*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_COUNTER) {
1159*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.counter */
1160*0a6a1f1dSLionel Sambuc _aux->counter = *(xcb_sync_counter_t *)xcb_tmp;
1161*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_counter_t);
1162*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(xcb_sync_counter_t);
1163*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_counter_t);
1164*0a6a1f1dSLionel Sambuc }
1165*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_VALUE_TYPE) {
1166*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.valueType */
1167*0a6a1f1dSLionel Sambuc _aux->valueType = *(uint32_t *)xcb_tmp;
1168*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
1169*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(uint32_t);
1170971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1171*0a6a1f1dSLionel Sambuc }
1172*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_VALUE) {
1173*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.value */
1174*0a6a1f1dSLionel Sambuc _aux->value = *(xcb_sync_int64_t *)xcb_tmp;
1175*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_int64_t);
1176*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(xcb_sync_int64_t);
1177*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_int64_t);
1178*0a6a1f1dSLionel Sambuc }
1179*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_TEST_TYPE) {
1180*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.testType */
1181*0a6a1f1dSLionel Sambuc _aux->testType = *(uint32_t *)xcb_tmp;
1182*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
1183*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(uint32_t);
1184*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1185*0a6a1f1dSLionel Sambuc }
1186*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_DELTA) {
1187*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.delta */
1188*0a6a1f1dSLionel Sambuc _aux->delta = *(xcb_sync_int64_t *)xcb_tmp;
1189*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_sync_int64_t);
1190*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(xcb_sync_int64_t);
1191*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_int64_t);
1192*0a6a1f1dSLionel Sambuc }
1193*0a6a1f1dSLionel Sambuc if(value_mask & XCB_SYNC_CA_EVENTS) {
1194*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t.events */
1195*0a6a1f1dSLionel Sambuc _aux->events = *(uint32_t *)xcb_tmp;
1196*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(uint32_t);
1197*0a6a1f1dSLionel Sambuc xcb_tmp += sizeof(uint32_t);
1198*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1199*0a6a1f1dSLionel Sambuc }
1200971bb1a5SLionel Sambuc /* insert padding */
1201971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1202971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1203971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1204971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1205971bb1a5SLionel Sambuc xcb_pad = 0;
1206971bb1a5SLionel Sambuc }
1207971bb1a5SLionel Sambuc xcb_block_len = 0;
1208971bb1a5SLionel Sambuc
1209971bb1a5SLionel Sambuc return xcb_buffer_len;
1210971bb1a5SLionel Sambuc }
1211971bb1a5SLionel Sambuc
1212*0a6a1f1dSLionel Sambuc int
xcb_sync_change_alarm_value_list_sizeof(const void * _buffer,uint32_t value_mask)1213*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_value_list_sizeof (const void *_buffer /**< */,
1214*0a6a1f1dSLionel Sambuc uint32_t value_mask /**< */)
1215*0a6a1f1dSLionel Sambuc {
1216*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_value_list_t _aux;
1217*0a6a1f1dSLionel Sambuc return xcb_sync_change_alarm_value_list_unpack(_buffer, value_mask, &_aux);
1218*0a6a1f1dSLionel Sambuc }
1219971bb1a5SLionel Sambuc
1220971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_change_alarm_checked(xcb_connection_t * c,xcb_sync_alarm_t id,uint32_t value_mask,const void * value_list)1221971bb1a5SLionel Sambuc xcb_sync_change_alarm_checked (xcb_connection_t *c /**< */,
1222971bb1a5SLionel Sambuc xcb_sync_alarm_t id /**< */,
1223971bb1a5SLionel Sambuc uint32_t value_mask /**< */,
1224*0a6a1f1dSLionel Sambuc const void *value_list /**< */)
1225971bb1a5SLionel Sambuc {
1226971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1227*0a6a1f1dSLionel Sambuc /* count */ 3,
1228971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1229971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_CHANGE_ALARM,
1230971bb1a5SLionel Sambuc /* isvoid */ 1
1231971bb1a5SLionel Sambuc };
1232971bb1a5SLionel Sambuc
1233*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[5];
1234971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1235971bb1a5SLionel Sambuc xcb_sync_change_alarm_request_t xcb_out;
1236971bb1a5SLionel Sambuc
1237971bb1a5SLionel Sambuc xcb_out.id = id;
1238971bb1a5SLionel Sambuc xcb_out.value_mask = value_mask;
1239971bb1a5SLionel Sambuc
1240971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1241971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1242971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1243971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1244*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t value_list */
1245971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) value_list;
1246*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len =
1247*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_value_list_sizeof (value_list, value_mask);
1248971bb1a5SLionel Sambuc
1249971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1250971bb1a5SLionel Sambuc return xcb_ret;
1251971bb1a5SLionel Sambuc }
1252971bb1a5SLionel Sambuc
1253971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_change_alarm(xcb_connection_t * c,xcb_sync_alarm_t id,uint32_t value_mask,const void * value_list)1254971bb1a5SLionel Sambuc xcb_sync_change_alarm (xcb_connection_t *c /**< */,
1255971bb1a5SLionel Sambuc xcb_sync_alarm_t id /**< */,
1256971bb1a5SLionel Sambuc uint32_t value_mask /**< */,
1257*0a6a1f1dSLionel Sambuc const void *value_list /**< */)
1258971bb1a5SLionel Sambuc {
1259971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1260*0a6a1f1dSLionel Sambuc /* count */ 3,
1261971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1262971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_CHANGE_ALARM,
1263971bb1a5SLionel Sambuc /* isvoid */ 1
1264971bb1a5SLionel Sambuc };
1265971bb1a5SLionel Sambuc
1266*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[5];
1267971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1268971bb1a5SLionel Sambuc xcb_sync_change_alarm_request_t xcb_out;
1269971bb1a5SLionel Sambuc
1270971bb1a5SLionel Sambuc xcb_out.id = id;
1271971bb1a5SLionel Sambuc xcb_out.value_mask = value_mask;
1272971bb1a5SLionel Sambuc
1273971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1274971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1275971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1276971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1277*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t value_list */
1278971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) value_list;
1279*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len =
1280*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_value_list_sizeof (value_list, value_mask);
1281971bb1a5SLionel Sambuc
1282971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1283971bb1a5SLionel Sambuc return xcb_ret;
1284971bb1a5SLionel Sambuc }
1285971bb1a5SLionel Sambuc
1286*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_sync_change_alarm_aux_checked(xcb_connection_t * c,xcb_sync_alarm_t id,uint32_t value_mask,const xcb_sync_change_alarm_value_list_t * value_list)1287*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_aux_checked (xcb_connection_t *c /**< */,
1288*0a6a1f1dSLionel Sambuc xcb_sync_alarm_t id /**< */,
1289*0a6a1f1dSLionel Sambuc uint32_t value_mask /**< */,
1290*0a6a1f1dSLionel Sambuc const xcb_sync_change_alarm_value_list_t *value_list /**< */)
1291*0a6a1f1dSLionel Sambuc {
1292*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1293*0a6a1f1dSLionel Sambuc /* count */ 3,
1294*0a6a1f1dSLionel Sambuc /* ext */ &xcb_sync_id,
1295*0a6a1f1dSLionel Sambuc /* opcode */ XCB_SYNC_CHANGE_ALARM,
1296*0a6a1f1dSLionel Sambuc /* isvoid */ 1
1297*0a6a1f1dSLionel Sambuc };
1298971bb1a5SLionel Sambuc
1299*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[5];
1300*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
1301*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_request_t xcb_out;
1302*0a6a1f1dSLionel Sambuc void *xcb_aux0 = 0;
1303*0a6a1f1dSLionel Sambuc
1304*0a6a1f1dSLionel Sambuc xcb_out.id = id;
1305*0a6a1f1dSLionel Sambuc xcb_out.value_mask = value_mask;
1306*0a6a1f1dSLionel Sambuc
1307*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1308*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1309*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
1310*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1311*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t value_list */
1312*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len =
1313*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_value_list_serialize (&xcb_aux0, value_mask, value_list);
1314*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_base = xcb_aux0;
1315*0a6a1f1dSLionel Sambuc
1316*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1317*0a6a1f1dSLionel Sambuc free(xcb_aux0);
1318*0a6a1f1dSLionel Sambuc return xcb_ret;
1319*0a6a1f1dSLionel Sambuc }
1320*0a6a1f1dSLionel Sambuc
1321*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_sync_change_alarm_aux(xcb_connection_t * c,xcb_sync_alarm_t id,uint32_t value_mask,const xcb_sync_change_alarm_value_list_t * value_list)1322*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_aux (xcb_connection_t *c /**< */,
1323*0a6a1f1dSLionel Sambuc xcb_sync_alarm_t id /**< */,
1324*0a6a1f1dSLionel Sambuc uint32_t value_mask /**< */,
1325*0a6a1f1dSLionel Sambuc const xcb_sync_change_alarm_value_list_t *value_list /**< */)
1326*0a6a1f1dSLionel Sambuc {
1327*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1328*0a6a1f1dSLionel Sambuc /* count */ 3,
1329*0a6a1f1dSLionel Sambuc /* ext */ &xcb_sync_id,
1330*0a6a1f1dSLionel Sambuc /* opcode */ XCB_SYNC_CHANGE_ALARM,
1331*0a6a1f1dSLionel Sambuc /* isvoid */ 1
1332*0a6a1f1dSLionel Sambuc };
1333*0a6a1f1dSLionel Sambuc
1334*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[5];
1335*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
1336*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_request_t xcb_out;
1337*0a6a1f1dSLionel Sambuc void *xcb_aux0 = 0;
1338*0a6a1f1dSLionel Sambuc
1339*0a6a1f1dSLionel Sambuc xcb_out.id = id;
1340*0a6a1f1dSLionel Sambuc xcb_out.value_mask = value_mask;
1341*0a6a1f1dSLionel Sambuc
1342*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1343*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1344*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
1345*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1346*0a6a1f1dSLionel Sambuc /* xcb_sync_change_alarm_value_list_t value_list */
1347*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len =
1348*0a6a1f1dSLionel Sambuc xcb_sync_change_alarm_value_list_serialize (&xcb_aux0, value_mask, value_list);
1349*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_base = xcb_aux0;
1350*0a6a1f1dSLionel Sambuc
1351*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1352*0a6a1f1dSLionel Sambuc free(xcb_aux0);
1353*0a6a1f1dSLionel Sambuc return xcb_ret;
1354*0a6a1f1dSLionel Sambuc }
1355971bb1a5SLionel Sambuc
1356971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_destroy_alarm_checked(xcb_connection_t * c,xcb_sync_alarm_t alarm)1357971bb1a5SLionel Sambuc xcb_sync_destroy_alarm_checked (xcb_connection_t *c /**< */,
1358971bb1a5SLionel Sambuc xcb_sync_alarm_t alarm /**< */)
1359971bb1a5SLionel Sambuc {
1360971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1361971bb1a5SLionel Sambuc /* count */ 2,
1362971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1363971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_DESTROY_ALARM,
1364971bb1a5SLionel Sambuc /* isvoid */ 1
1365971bb1a5SLionel Sambuc };
1366971bb1a5SLionel Sambuc
1367971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1368971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1369971bb1a5SLionel Sambuc xcb_sync_destroy_alarm_request_t xcb_out;
1370971bb1a5SLionel Sambuc
1371971bb1a5SLionel Sambuc xcb_out.alarm = alarm;
1372971bb1a5SLionel Sambuc
1373971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1374971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1375971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1376971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1377971bb1a5SLionel Sambuc
1378971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1379971bb1a5SLionel Sambuc return xcb_ret;
1380971bb1a5SLionel Sambuc }
1381971bb1a5SLionel Sambuc
1382971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_destroy_alarm(xcb_connection_t * c,xcb_sync_alarm_t alarm)1383971bb1a5SLionel Sambuc xcb_sync_destroy_alarm (xcb_connection_t *c /**< */,
1384971bb1a5SLionel Sambuc xcb_sync_alarm_t alarm /**< */)
1385971bb1a5SLionel Sambuc {
1386971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1387971bb1a5SLionel Sambuc /* count */ 2,
1388971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1389971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_DESTROY_ALARM,
1390971bb1a5SLionel Sambuc /* isvoid */ 1
1391971bb1a5SLionel Sambuc };
1392971bb1a5SLionel Sambuc
1393971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1394971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1395971bb1a5SLionel Sambuc xcb_sync_destroy_alarm_request_t xcb_out;
1396971bb1a5SLionel Sambuc
1397971bb1a5SLionel Sambuc xcb_out.alarm = alarm;
1398971bb1a5SLionel Sambuc
1399971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1400971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1401971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1402971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1403971bb1a5SLionel Sambuc
1404971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1405971bb1a5SLionel Sambuc return xcb_ret;
1406971bb1a5SLionel Sambuc }
1407971bb1a5SLionel Sambuc
1408971bb1a5SLionel Sambuc xcb_sync_query_alarm_cookie_t
xcb_sync_query_alarm(xcb_connection_t * c,xcb_sync_alarm_t alarm)1409971bb1a5SLionel Sambuc xcb_sync_query_alarm (xcb_connection_t *c /**< */,
1410971bb1a5SLionel Sambuc xcb_sync_alarm_t alarm /**< */)
1411971bb1a5SLionel Sambuc {
1412971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1413971bb1a5SLionel Sambuc /* count */ 2,
1414971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1415971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_QUERY_ALARM,
1416971bb1a5SLionel Sambuc /* isvoid */ 0
1417971bb1a5SLionel Sambuc };
1418971bb1a5SLionel Sambuc
1419971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1420971bb1a5SLionel Sambuc xcb_sync_query_alarm_cookie_t xcb_ret;
1421971bb1a5SLionel Sambuc xcb_sync_query_alarm_request_t xcb_out;
1422971bb1a5SLionel Sambuc
1423971bb1a5SLionel Sambuc xcb_out.alarm = alarm;
1424971bb1a5SLionel Sambuc
1425971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1426971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1427971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1428971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1429971bb1a5SLionel Sambuc
1430971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1431971bb1a5SLionel Sambuc return xcb_ret;
1432971bb1a5SLionel Sambuc }
1433971bb1a5SLionel Sambuc
1434971bb1a5SLionel Sambuc xcb_sync_query_alarm_cookie_t
xcb_sync_query_alarm_unchecked(xcb_connection_t * c,xcb_sync_alarm_t alarm)1435971bb1a5SLionel Sambuc xcb_sync_query_alarm_unchecked (xcb_connection_t *c /**< */,
1436971bb1a5SLionel Sambuc xcb_sync_alarm_t alarm /**< */)
1437971bb1a5SLionel Sambuc {
1438971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1439971bb1a5SLionel Sambuc /* count */ 2,
1440971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1441971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_QUERY_ALARM,
1442971bb1a5SLionel Sambuc /* isvoid */ 0
1443971bb1a5SLionel Sambuc };
1444971bb1a5SLionel Sambuc
1445971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1446971bb1a5SLionel Sambuc xcb_sync_query_alarm_cookie_t xcb_ret;
1447971bb1a5SLionel Sambuc xcb_sync_query_alarm_request_t xcb_out;
1448971bb1a5SLionel Sambuc
1449971bb1a5SLionel Sambuc xcb_out.alarm = alarm;
1450971bb1a5SLionel Sambuc
1451971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1452971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1453971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1454971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1455971bb1a5SLionel Sambuc
1456971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1457971bb1a5SLionel Sambuc return xcb_ret;
1458971bb1a5SLionel Sambuc }
1459971bb1a5SLionel Sambuc
1460971bb1a5SLionel Sambuc xcb_sync_query_alarm_reply_t *
xcb_sync_query_alarm_reply(xcb_connection_t * c,xcb_sync_query_alarm_cookie_t cookie,xcb_generic_error_t ** e)1461971bb1a5SLionel Sambuc xcb_sync_query_alarm_reply (xcb_connection_t *c /**< */,
1462971bb1a5SLionel Sambuc xcb_sync_query_alarm_cookie_t cookie /**< */,
1463971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1464971bb1a5SLionel Sambuc {
1465971bb1a5SLionel Sambuc return (xcb_sync_query_alarm_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1466971bb1a5SLionel Sambuc }
1467971bb1a5SLionel Sambuc
1468971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_set_priority_checked(xcb_connection_t * c,uint32_t id,int32_t priority)1469971bb1a5SLionel Sambuc xcb_sync_set_priority_checked (xcb_connection_t *c /**< */,
1470971bb1a5SLionel Sambuc uint32_t id /**< */,
1471971bb1a5SLionel Sambuc int32_t priority /**< */)
1472971bb1a5SLionel Sambuc {
1473971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1474971bb1a5SLionel Sambuc /* count */ 2,
1475971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1476971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_SET_PRIORITY,
1477971bb1a5SLionel Sambuc /* isvoid */ 1
1478971bb1a5SLionel Sambuc };
1479971bb1a5SLionel Sambuc
1480971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1481971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1482971bb1a5SLionel Sambuc xcb_sync_set_priority_request_t xcb_out;
1483971bb1a5SLionel Sambuc
1484971bb1a5SLionel Sambuc xcb_out.id = id;
1485971bb1a5SLionel Sambuc xcb_out.priority = priority;
1486971bb1a5SLionel Sambuc
1487971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1488971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1489971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1490971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1491971bb1a5SLionel Sambuc
1492971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1493971bb1a5SLionel Sambuc return xcb_ret;
1494971bb1a5SLionel Sambuc }
1495971bb1a5SLionel Sambuc
1496971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_set_priority(xcb_connection_t * c,uint32_t id,int32_t priority)1497971bb1a5SLionel Sambuc xcb_sync_set_priority (xcb_connection_t *c /**< */,
1498971bb1a5SLionel Sambuc uint32_t id /**< */,
1499971bb1a5SLionel Sambuc int32_t priority /**< */)
1500971bb1a5SLionel Sambuc {
1501971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1502971bb1a5SLionel Sambuc /* count */ 2,
1503971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1504971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_SET_PRIORITY,
1505971bb1a5SLionel Sambuc /* isvoid */ 1
1506971bb1a5SLionel Sambuc };
1507971bb1a5SLionel Sambuc
1508971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1509971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1510971bb1a5SLionel Sambuc xcb_sync_set_priority_request_t xcb_out;
1511971bb1a5SLionel Sambuc
1512971bb1a5SLionel Sambuc xcb_out.id = id;
1513971bb1a5SLionel Sambuc xcb_out.priority = priority;
1514971bb1a5SLionel Sambuc
1515971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1516971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1517971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1518971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1519971bb1a5SLionel Sambuc
1520971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1521971bb1a5SLionel Sambuc return xcb_ret;
1522971bb1a5SLionel Sambuc }
1523971bb1a5SLionel Sambuc
1524971bb1a5SLionel Sambuc xcb_sync_get_priority_cookie_t
xcb_sync_get_priority(xcb_connection_t * c,uint32_t id)1525971bb1a5SLionel Sambuc xcb_sync_get_priority (xcb_connection_t *c /**< */,
1526971bb1a5SLionel Sambuc uint32_t id /**< */)
1527971bb1a5SLionel Sambuc {
1528971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1529971bb1a5SLionel Sambuc /* count */ 2,
1530971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1531971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_GET_PRIORITY,
1532971bb1a5SLionel Sambuc /* isvoid */ 0
1533971bb1a5SLionel Sambuc };
1534971bb1a5SLionel Sambuc
1535971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1536971bb1a5SLionel Sambuc xcb_sync_get_priority_cookie_t xcb_ret;
1537971bb1a5SLionel Sambuc xcb_sync_get_priority_request_t xcb_out;
1538971bb1a5SLionel Sambuc
1539971bb1a5SLionel Sambuc xcb_out.id = id;
1540971bb1a5SLionel Sambuc
1541971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1542971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1543971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1544971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1545971bb1a5SLionel Sambuc
1546971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1547971bb1a5SLionel Sambuc return xcb_ret;
1548971bb1a5SLionel Sambuc }
1549971bb1a5SLionel Sambuc
1550971bb1a5SLionel Sambuc xcb_sync_get_priority_cookie_t
xcb_sync_get_priority_unchecked(xcb_connection_t * c,uint32_t id)1551971bb1a5SLionel Sambuc xcb_sync_get_priority_unchecked (xcb_connection_t *c /**< */,
1552971bb1a5SLionel Sambuc uint32_t id /**< */)
1553971bb1a5SLionel Sambuc {
1554971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1555971bb1a5SLionel Sambuc /* count */ 2,
1556971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1557971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_GET_PRIORITY,
1558971bb1a5SLionel Sambuc /* isvoid */ 0
1559971bb1a5SLionel Sambuc };
1560971bb1a5SLionel Sambuc
1561971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1562971bb1a5SLionel Sambuc xcb_sync_get_priority_cookie_t xcb_ret;
1563971bb1a5SLionel Sambuc xcb_sync_get_priority_request_t xcb_out;
1564971bb1a5SLionel Sambuc
1565971bb1a5SLionel Sambuc xcb_out.id = id;
1566971bb1a5SLionel Sambuc
1567971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1568971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1569971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1570971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1571971bb1a5SLionel Sambuc
1572971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1573971bb1a5SLionel Sambuc return xcb_ret;
1574971bb1a5SLionel Sambuc }
1575971bb1a5SLionel Sambuc
1576971bb1a5SLionel Sambuc xcb_sync_get_priority_reply_t *
xcb_sync_get_priority_reply(xcb_connection_t * c,xcb_sync_get_priority_cookie_t cookie,xcb_generic_error_t ** e)1577971bb1a5SLionel Sambuc xcb_sync_get_priority_reply (xcb_connection_t *c /**< */,
1578971bb1a5SLionel Sambuc xcb_sync_get_priority_cookie_t cookie /**< */,
1579971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1580971bb1a5SLionel Sambuc {
1581971bb1a5SLionel Sambuc return (xcb_sync_get_priority_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1582971bb1a5SLionel Sambuc }
1583971bb1a5SLionel Sambuc
1584971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_create_fence_checked(xcb_connection_t * c,xcb_drawable_t drawable,xcb_sync_fence_t fence,uint8_t initially_triggered)1585971bb1a5SLionel Sambuc xcb_sync_create_fence_checked (xcb_connection_t *c /**< */,
1586971bb1a5SLionel Sambuc xcb_drawable_t drawable /**< */,
1587971bb1a5SLionel Sambuc xcb_sync_fence_t fence /**< */,
1588971bb1a5SLionel Sambuc uint8_t initially_triggered /**< */)
1589971bb1a5SLionel Sambuc {
1590971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1591971bb1a5SLionel Sambuc /* count */ 2,
1592971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1593971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_CREATE_FENCE,
1594971bb1a5SLionel Sambuc /* isvoid */ 1
1595971bb1a5SLionel Sambuc };
1596971bb1a5SLionel Sambuc
1597971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1598971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1599971bb1a5SLionel Sambuc xcb_sync_create_fence_request_t xcb_out;
1600971bb1a5SLionel Sambuc
1601971bb1a5SLionel Sambuc xcb_out.drawable = drawable;
1602971bb1a5SLionel Sambuc xcb_out.fence = fence;
1603971bb1a5SLionel Sambuc xcb_out.initially_triggered = initially_triggered;
1604971bb1a5SLionel Sambuc
1605971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1606971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1607971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1608971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1609971bb1a5SLionel Sambuc
1610971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1611971bb1a5SLionel Sambuc return xcb_ret;
1612971bb1a5SLionel Sambuc }
1613971bb1a5SLionel Sambuc
1614971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_create_fence(xcb_connection_t * c,xcb_drawable_t drawable,xcb_sync_fence_t fence,uint8_t initially_triggered)1615971bb1a5SLionel Sambuc xcb_sync_create_fence (xcb_connection_t *c /**< */,
1616971bb1a5SLionel Sambuc xcb_drawable_t drawable /**< */,
1617971bb1a5SLionel Sambuc xcb_sync_fence_t fence /**< */,
1618971bb1a5SLionel Sambuc uint8_t initially_triggered /**< */)
1619971bb1a5SLionel Sambuc {
1620971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1621971bb1a5SLionel Sambuc /* count */ 2,
1622971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1623971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_CREATE_FENCE,
1624971bb1a5SLionel Sambuc /* isvoid */ 1
1625971bb1a5SLionel Sambuc };
1626971bb1a5SLionel Sambuc
1627971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1628971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1629971bb1a5SLionel Sambuc xcb_sync_create_fence_request_t xcb_out;
1630971bb1a5SLionel Sambuc
1631971bb1a5SLionel Sambuc xcb_out.drawable = drawable;
1632971bb1a5SLionel Sambuc xcb_out.fence = fence;
1633971bb1a5SLionel Sambuc xcb_out.initially_triggered = initially_triggered;
1634971bb1a5SLionel Sambuc
1635971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1636971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1637971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1638971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1639971bb1a5SLionel Sambuc
1640971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1641971bb1a5SLionel Sambuc return xcb_ret;
1642971bb1a5SLionel Sambuc }
1643971bb1a5SLionel Sambuc
1644971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_trigger_fence_checked(xcb_connection_t * c,xcb_sync_fence_t fence)1645971bb1a5SLionel Sambuc xcb_sync_trigger_fence_checked (xcb_connection_t *c /**< */,
1646971bb1a5SLionel Sambuc xcb_sync_fence_t fence /**< */)
1647971bb1a5SLionel Sambuc {
1648971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1649971bb1a5SLionel Sambuc /* count */ 2,
1650971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1651971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_TRIGGER_FENCE,
1652971bb1a5SLionel Sambuc /* isvoid */ 1
1653971bb1a5SLionel Sambuc };
1654971bb1a5SLionel Sambuc
1655971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1656971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1657971bb1a5SLionel Sambuc xcb_sync_trigger_fence_request_t xcb_out;
1658971bb1a5SLionel Sambuc
1659971bb1a5SLionel Sambuc xcb_out.fence = fence;
1660971bb1a5SLionel Sambuc
1661971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1662971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1663971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1664971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1665971bb1a5SLionel Sambuc
1666971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1667971bb1a5SLionel Sambuc return xcb_ret;
1668971bb1a5SLionel Sambuc }
1669971bb1a5SLionel Sambuc
1670971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_trigger_fence(xcb_connection_t * c,xcb_sync_fence_t fence)1671971bb1a5SLionel Sambuc xcb_sync_trigger_fence (xcb_connection_t *c /**< */,
1672971bb1a5SLionel Sambuc xcb_sync_fence_t fence /**< */)
1673971bb1a5SLionel Sambuc {
1674971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1675971bb1a5SLionel Sambuc /* count */ 2,
1676971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1677971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_TRIGGER_FENCE,
1678971bb1a5SLionel Sambuc /* isvoid */ 1
1679971bb1a5SLionel Sambuc };
1680971bb1a5SLionel Sambuc
1681971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1682971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1683971bb1a5SLionel Sambuc xcb_sync_trigger_fence_request_t xcb_out;
1684971bb1a5SLionel Sambuc
1685971bb1a5SLionel Sambuc xcb_out.fence = fence;
1686971bb1a5SLionel Sambuc
1687971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1688971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1689971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1690971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1691971bb1a5SLionel Sambuc
1692971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1693971bb1a5SLionel Sambuc return xcb_ret;
1694971bb1a5SLionel Sambuc }
1695971bb1a5SLionel Sambuc
1696971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_reset_fence_checked(xcb_connection_t * c,xcb_sync_fence_t fence)1697971bb1a5SLionel Sambuc xcb_sync_reset_fence_checked (xcb_connection_t *c /**< */,
1698971bb1a5SLionel Sambuc xcb_sync_fence_t fence /**< */)
1699971bb1a5SLionel Sambuc {
1700971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1701971bb1a5SLionel Sambuc /* count */ 2,
1702971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1703971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_RESET_FENCE,
1704971bb1a5SLionel Sambuc /* isvoid */ 1
1705971bb1a5SLionel Sambuc };
1706971bb1a5SLionel Sambuc
1707971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1708971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1709971bb1a5SLionel Sambuc xcb_sync_reset_fence_request_t xcb_out;
1710971bb1a5SLionel Sambuc
1711971bb1a5SLionel Sambuc xcb_out.fence = fence;
1712971bb1a5SLionel Sambuc
1713971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1714971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1715971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1716971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1717971bb1a5SLionel Sambuc
1718971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1719971bb1a5SLionel Sambuc return xcb_ret;
1720971bb1a5SLionel Sambuc }
1721971bb1a5SLionel Sambuc
1722971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_reset_fence(xcb_connection_t * c,xcb_sync_fence_t fence)1723971bb1a5SLionel Sambuc xcb_sync_reset_fence (xcb_connection_t *c /**< */,
1724971bb1a5SLionel Sambuc xcb_sync_fence_t fence /**< */)
1725971bb1a5SLionel Sambuc {
1726971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1727971bb1a5SLionel Sambuc /* count */ 2,
1728971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1729971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_RESET_FENCE,
1730971bb1a5SLionel Sambuc /* isvoid */ 1
1731971bb1a5SLionel Sambuc };
1732971bb1a5SLionel Sambuc
1733971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1734971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1735971bb1a5SLionel Sambuc xcb_sync_reset_fence_request_t xcb_out;
1736971bb1a5SLionel Sambuc
1737971bb1a5SLionel Sambuc xcb_out.fence = fence;
1738971bb1a5SLionel Sambuc
1739971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1740971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1741971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1742971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1743971bb1a5SLionel Sambuc
1744971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1745971bb1a5SLionel Sambuc return xcb_ret;
1746971bb1a5SLionel Sambuc }
1747971bb1a5SLionel Sambuc
1748971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_destroy_fence_checked(xcb_connection_t * c,xcb_sync_fence_t fence)1749971bb1a5SLionel Sambuc xcb_sync_destroy_fence_checked (xcb_connection_t *c /**< */,
1750971bb1a5SLionel Sambuc xcb_sync_fence_t fence /**< */)
1751971bb1a5SLionel Sambuc {
1752971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1753971bb1a5SLionel Sambuc /* count */ 2,
1754971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1755971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_DESTROY_FENCE,
1756971bb1a5SLionel Sambuc /* isvoid */ 1
1757971bb1a5SLionel Sambuc };
1758971bb1a5SLionel Sambuc
1759971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1760971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1761971bb1a5SLionel Sambuc xcb_sync_destroy_fence_request_t xcb_out;
1762971bb1a5SLionel Sambuc
1763971bb1a5SLionel Sambuc xcb_out.fence = fence;
1764971bb1a5SLionel Sambuc
1765971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1766971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1767971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1768971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1769971bb1a5SLionel Sambuc
1770971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1771971bb1a5SLionel Sambuc return xcb_ret;
1772971bb1a5SLionel Sambuc }
1773971bb1a5SLionel Sambuc
1774971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_destroy_fence(xcb_connection_t * c,xcb_sync_fence_t fence)1775971bb1a5SLionel Sambuc xcb_sync_destroy_fence (xcb_connection_t *c /**< */,
1776971bb1a5SLionel Sambuc xcb_sync_fence_t fence /**< */)
1777971bb1a5SLionel Sambuc {
1778971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1779971bb1a5SLionel Sambuc /* count */ 2,
1780971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1781971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_DESTROY_FENCE,
1782971bb1a5SLionel Sambuc /* isvoid */ 1
1783971bb1a5SLionel Sambuc };
1784971bb1a5SLionel Sambuc
1785971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1786971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1787971bb1a5SLionel Sambuc xcb_sync_destroy_fence_request_t xcb_out;
1788971bb1a5SLionel Sambuc
1789971bb1a5SLionel Sambuc xcb_out.fence = fence;
1790971bb1a5SLionel Sambuc
1791971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1792971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1793971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1794971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1795971bb1a5SLionel Sambuc
1796971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1797971bb1a5SLionel Sambuc return xcb_ret;
1798971bb1a5SLionel Sambuc }
1799971bb1a5SLionel Sambuc
1800971bb1a5SLionel Sambuc xcb_sync_query_fence_cookie_t
xcb_sync_query_fence(xcb_connection_t * c,xcb_sync_fence_t fence)1801971bb1a5SLionel Sambuc xcb_sync_query_fence (xcb_connection_t *c /**< */,
1802971bb1a5SLionel Sambuc xcb_sync_fence_t fence /**< */)
1803971bb1a5SLionel Sambuc {
1804971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1805971bb1a5SLionel Sambuc /* count */ 2,
1806971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1807971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_QUERY_FENCE,
1808971bb1a5SLionel Sambuc /* isvoid */ 0
1809971bb1a5SLionel Sambuc };
1810971bb1a5SLionel Sambuc
1811971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1812971bb1a5SLionel Sambuc xcb_sync_query_fence_cookie_t xcb_ret;
1813971bb1a5SLionel Sambuc xcb_sync_query_fence_request_t xcb_out;
1814971bb1a5SLionel Sambuc
1815971bb1a5SLionel Sambuc xcb_out.fence = fence;
1816971bb1a5SLionel Sambuc
1817971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1818971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1819971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1820971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1821971bb1a5SLionel Sambuc
1822971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1823971bb1a5SLionel Sambuc return xcb_ret;
1824971bb1a5SLionel Sambuc }
1825971bb1a5SLionel Sambuc
1826971bb1a5SLionel Sambuc xcb_sync_query_fence_cookie_t
xcb_sync_query_fence_unchecked(xcb_connection_t * c,xcb_sync_fence_t fence)1827971bb1a5SLionel Sambuc xcb_sync_query_fence_unchecked (xcb_connection_t *c /**< */,
1828971bb1a5SLionel Sambuc xcb_sync_fence_t fence /**< */)
1829971bb1a5SLionel Sambuc {
1830971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1831971bb1a5SLionel Sambuc /* count */ 2,
1832971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1833971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_QUERY_FENCE,
1834971bb1a5SLionel Sambuc /* isvoid */ 0
1835971bb1a5SLionel Sambuc };
1836971bb1a5SLionel Sambuc
1837971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1838971bb1a5SLionel Sambuc xcb_sync_query_fence_cookie_t xcb_ret;
1839971bb1a5SLionel Sambuc xcb_sync_query_fence_request_t xcb_out;
1840971bb1a5SLionel Sambuc
1841971bb1a5SLionel Sambuc xcb_out.fence = fence;
1842971bb1a5SLionel Sambuc
1843971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1844971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1845971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1846971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1847971bb1a5SLionel Sambuc
1848971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1849971bb1a5SLionel Sambuc return xcb_ret;
1850971bb1a5SLionel Sambuc }
1851971bb1a5SLionel Sambuc
1852971bb1a5SLionel Sambuc xcb_sync_query_fence_reply_t *
xcb_sync_query_fence_reply(xcb_connection_t * c,xcb_sync_query_fence_cookie_t cookie,xcb_generic_error_t ** e)1853971bb1a5SLionel Sambuc xcb_sync_query_fence_reply (xcb_connection_t *c /**< */,
1854971bb1a5SLionel Sambuc xcb_sync_query_fence_cookie_t cookie /**< */,
1855971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1856971bb1a5SLionel Sambuc {
1857971bb1a5SLionel Sambuc return (xcb_sync_query_fence_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1858971bb1a5SLionel Sambuc }
1859971bb1a5SLionel Sambuc
1860971bb1a5SLionel Sambuc int
xcb_sync_await_fence_sizeof(const void * _buffer,uint32_t fence_list_len)1861971bb1a5SLionel Sambuc xcb_sync_await_fence_sizeof (const void *_buffer /**< */,
1862971bb1a5SLionel Sambuc uint32_t fence_list_len /**< */)
1863971bb1a5SLionel Sambuc {
1864971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1865971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1866971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1867971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1868*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1869971bb1a5SLionel Sambuc
1870971bb1a5SLionel Sambuc
1871971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_sync_await_fence_request_t);
1872971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1873*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1874*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1875971bb1a5SLionel Sambuc /* fence_list */
1876971bb1a5SLionel Sambuc xcb_block_len += fence_list_len * sizeof(xcb_sync_fence_t);
1877971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1878971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_sync_fence_t);
1879971bb1a5SLionel Sambuc /* insert padding */
1880971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1881971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1882971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1883971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1884971bb1a5SLionel Sambuc xcb_pad = 0;
1885971bb1a5SLionel Sambuc }
1886971bb1a5SLionel Sambuc xcb_block_len = 0;
1887971bb1a5SLionel Sambuc
1888971bb1a5SLionel Sambuc return xcb_buffer_len;
1889971bb1a5SLionel Sambuc }
1890971bb1a5SLionel Sambuc
1891971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_await_fence_checked(xcb_connection_t * c,uint32_t fence_list_len,const xcb_sync_fence_t * fence_list)1892971bb1a5SLionel Sambuc xcb_sync_await_fence_checked (xcb_connection_t *c /**< */,
1893971bb1a5SLionel Sambuc uint32_t fence_list_len /**< */,
1894971bb1a5SLionel Sambuc const xcb_sync_fence_t *fence_list /**< */)
1895971bb1a5SLionel Sambuc {
1896971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1897971bb1a5SLionel Sambuc /* count */ 4,
1898971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1899971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_AWAIT_FENCE,
1900971bb1a5SLionel Sambuc /* isvoid */ 1
1901971bb1a5SLionel Sambuc };
1902971bb1a5SLionel Sambuc
1903971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1904971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1905971bb1a5SLionel Sambuc xcb_sync_await_fence_request_t xcb_out;
1906971bb1a5SLionel Sambuc
1907971bb1a5SLionel Sambuc
1908971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1909971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1910971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1911971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1912971bb1a5SLionel Sambuc /* xcb_sync_fence_t fence_list */
1913971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) fence_list;
1914971bb1a5SLionel Sambuc xcb_parts[4].iov_len = fence_list_len * sizeof(xcb_sync_fence_t);
1915971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1916971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1917971bb1a5SLionel Sambuc
1918971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1919971bb1a5SLionel Sambuc return xcb_ret;
1920971bb1a5SLionel Sambuc }
1921971bb1a5SLionel Sambuc
1922971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_sync_await_fence(xcb_connection_t * c,uint32_t fence_list_len,const xcb_sync_fence_t * fence_list)1923971bb1a5SLionel Sambuc xcb_sync_await_fence (xcb_connection_t *c /**< */,
1924971bb1a5SLionel Sambuc uint32_t fence_list_len /**< */,
1925971bb1a5SLionel Sambuc const xcb_sync_fence_t *fence_list /**< */)
1926971bb1a5SLionel Sambuc {
1927971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1928971bb1a5SLionel Sambuc /* count */ 4,
1929971bb1a5SLionel Sambuc /* ext */ &xcb_sync_id,
1930971bb1a5SLionel Sambuc /* opcode */ XCB_SYNC_AWAIT_FENCE,
1931971bb1a5SLionel Sambuc /* isvoid */ 1
1932971bb1a5SLionel Sambuc };
1933971bb1a5SLionel Sambuc
1934971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1935971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1936971bb1a5SLionel Sambuc xcb_sync_await_fence_request_t xcb_out;
1937971bb1a5SLionel Sambuc
1938971bb1a5SLionel Sambuc
1939971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1940971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1941971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1942971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1943971bb1a5SLionel Sambuc /* xcb_sync_fence_t fence_list */
1944971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) fence_list;
1945971bb1a5SLionel Sambuc xcb_parts[4].iov_len = fence_list_len * sizeof(xcb_sync_fence_t);
1946971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1947971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1948971bb1a5SLionel Sambuc
1949971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1950971bb1a5SLionel Sambuc return xcb_ret;
1951971bb1a5SLionel Sambuc }
1952971bb1a5SLionel Sambuc
1953