1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
6 <!-- lifted from troff+ms+XMan by doclifter -->
10 <title>X Synchronization Extension Library</title>
11 <subtitle>X Consortium Standard</subtitle>
12 <releaseinfo>X Version 11, Release 6.4</releaseinfo>
15 <firstname>Tim</firstname><surname>Glauert</surname>
16 <affiliation><orgname>Olivetti Research/MultiWorks</orgname></affiliation>
19 <firstname>Dave</firstname>
20 <surname>Carver</surname>
21 <affiliation><orgname>Digital EquipmentCorporation, MIT/Project Athena</orgname></affiliation>
24 <firstname>Jim</firstname>
25 <surname>Gettys</surname>
26 <affiliation><orgname>Digital EquipmentCorporation, Cambridge Research Laboratory</orgname></affiliation>
29 <firstname>David</firstname>
30 <surname>Wiggins</surname>
31 <affiliation><orgname>X Consortium, Inc.</orgname></affiliation>
34 <copyright><year>1991</year><holder>Olivetti Research Limited, Cambridge England and Digital Equipment Corporation, Maynard, Massachusetts</holder></copyright>
35 <copyright><year>1991</year><holder>X Consortium</holder></copyright>
36 <releaseinfo>Version 3.0</releaseinfo>
37 <affiliation><orgname>X Consortium</orgname></affiliation>
38 <productnumber>X Version 11, Release 6.4</productnumber>
42 Permission to use, copy, modify, and distribute this documentation for any
43 purpose and without fee is hereby granted, provided that the above
44 copyright notice appear in all copies. Olivetti, Digital, MIT, and the
45 X Consortium make no representations about the suitability for any purpose
46 of the information in this document. This documentation is provided as
47 is without express or implied warranty.
51 Permission is hereby granted, free of charge, to any person obtaining
52 a copy of this software and associated documentation files
53 (the "Software"), to deal in the Software without
54 restriction, including without limitation the rights to use, copy,
55 modify, merge, publish, distribute, sublicense, and/or sell copies of
56 the Software, and to permit persons to whom the Software is furnished
57 to do so, subject to the following conditions:
61 The above copyright notice and this permission notice shall be included in
62 all copies or substantial portions of the Software.
65 <para>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
66 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
67 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
68 IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
69 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
70 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
71 OTHER DEALINGS IN THE SOFTWARE.
75 Except as contained in this notice, the name of the X Consortium shall
76 not be used in advertising or otherwise to promote the sale, use or other
77 dealings in this Software without prior written authorization from the
84 <chapter id="synchronization_protocol">
85 <title>Synchronization Protocol</title>
88 The core X protocol makes no guarantees about the relative order of
89 execution of requests for different clients. This means that any
90 synchronization between clients must be done at the client level in an
91 operating system-dependent and network-dependent manner. Even if there
92 was an accepted standard for such synchronization, the use of a network
93 introduces unpredictable delays between the synchronization of the clients and
94 the delivery of the resulting requests to the X server.
97 The core X protocol also makes no guarantees about the time at which
98 requests are executed, which means that all clients with real-time constraints
99 must implement their timing on the host computer. Any such timings are
100 subject to error introduced by delays within the operating system and
101 network and are inefficient because of the need for round-trip requests that
102 keep the client and server synchronized.
105 The synchronization extension provides primitives that allow synchronization
106 between clients to take place entirely within the X server. This removes any
107 error introduced by the network and makes it possible to synchronize clients
108 on different hosts running different operating systems. This is important for
109 multimedia applications, where audio, video, and graphics data streams are
110 being synchronized. The extension also provides internal timers within the X
111 server to which client requests can be synchronized. This allows simple
112 animation applications to be implemented without any round-trip requests
113 and makes best use of buffering within the client, network, and server.
116 <sect1 id="description">
117 <title>Description</title>
119 The mechanism used by this extension for synchronization within the X server
120 is to block the processing of requests from a client until a specific
121 synchronization condition occurs. When the condition occurs, the client is
122 released and processing of requests continues. Multiple clients may block on
123 the same condition to give inter-client synchronization. Alternatively, a single
124 client may block on a condition such as an animation frame marker.
127 The extension adds <function>Counter</function> and
128 <function>Alarm</function> to the set of resources managed by
129 the server. A counter has a 64-bit integer value that may be increased or
130 decreased by client requests or by the server internally. A client can
131 block by sending an <function>Await</function> request that waits until
132 one of a set of synchronization conditions, called TRIGGERs, becomes TRUE.
135 The <function>CreateCounter</function> request allows a client to create
136 a <function>Counter</function> that can be changed by explicit
137 <function>SetCounter</function> and <function>ChangeCounter</function>
138 requests. These can be used to implement synchronization between
142 There are some counters, called <function>System Counters</function>,
143 that are changed by the server internally rather than by client
144 requests. The effect of any change to a system counter is not visible
145 until the server has finished processing the current request. In other
146 words, system counters are apparently updated in the gaps between the
147 execution of requests rather than during the actual execution of a
148 request. The extension provides a system counter that advances with the
149 server time as defined by the core protocol, and it may also provide
150 counters that advance with the real-world time or that change each
151 time the CRT screen is refreshed. Other extensions may provide their own
152 extension-specific system counters.
155 The extension provides an <function>Alarm</function> mechanism that allows clients to receive an
156 event on a regular basis when a particular counter is changed.
161 <chapter id="c_language_binding">
162 <title>C Language Binding</title>
165 The C routines provide direct access to the protocol and add no additional
169 The include file for this extension is <X11/extensions/sync.h>.
170 Most of the names in the language binding are derived from the protocol
171 names by prepending XSync to the protocol name and changing the
175 <sect1 id="c_functions">
176 <title>C Functions</title>
179 Most of the following functions generate SYNC protocol requests.
184 <funcdef>Status <function>XSyncQueryExtension</function></funcdef>
185 <paramdef>Display <parameter> *dpy</parameter></paramdef>
186 <paramdef>int <parameter> *event_base_return</parameter></paramdef>
187 <paramdef>int <parameter> *error_base_return</parameter></paramdef>
192 If dpy supports the SYNC extension,
193 <function>XSyncQueryExtension</function> returns True,
194 sets *event_base_return to the event number for the first SYNC event, and
195 sets *error_base_return to the error number for the first SYNC error. If dpy
196 does not support the SYNC extension, it returns False.
201 <funcdef>Status <function>XSyncInitialize</function></funcdef>
202 <paramdef>Display <parameter> *dpy</parameter></paramdef>
203 <paramdef>int <parameter> *major_version_return</parameter></paramdef>
204 <paramdef>int <parameter> *minor_version_return</parameter></paramdef>
209 <function>XSyncInitialize</function> sets *major_version_return and
210 *minor version return to the major/minor SYNC protocol version supported
211 by the server. If the XSync library is compatible with the version
212 returned by the server, this function returns <function>True</function>.
213 If dpy does not support the SYNC extension, or if there was an error
214 during communication with the server, or if the server and library protocol
215 versions are incompatible, this function returns <function>False</function>.
216 The only XSync function that may be called before this function is
217 XSyncQueryExtension. If a client violates this rule, the effects of all XSync
218 calls that it makes are undefined.
223 <funcdef>XSyncSystemCounter *<function>XSyncListSystemCounters</function></funcdef>
224 <paramdef>Display <parameter> *dpy</parameter></paramdef>
225 <paramdef>int <parameter> *n_counters_return</parameter></paramdef>
230 <function>XSyncListSystemCounters</function> returns a pointer to an array
231 of system counters supported by the display and sets *n_counters_return
232 to the number of counters in the array. The array should be freed with
233 <function>XSyncFreeSystemCounterList</function>. If dpy does not support
234 the SYNC extension, or if there was an error during communication with
235 the server, or if the server does not support any system counters,
236 this function returns NULL.
240 XSyncSystemCounter has the following fields:
243 <literallayout remap='Ds'>
244 char * name; /* null-terminated name of system counter */
245 XSyncCounter counter; /* counter id of this system counter */
246 XSyncValue resolution; /* resolution of this system counter */
251 <funcdef>void <function>XSyncFreeSystemCounterList</function></funcdef>
252 <paramdef>XSyncSystemCounter <parameter> *list</parameter></paramdef>
257 <function>XSyncFreeSystemCounterList</function> frees the memory
258 associated with the system counter list returned by
259 <function>XSyncListSystemCounters</function>.
264 <funcdef>XSyncCounter <function>XSyncCreateCounter</function></funcdef>
265 <paramdef>Display<parameter> *dpy</parameter></paramdef>
266 <paramdef>XSyncValue<parameter> initial_value</parameter></paramdef>
271 <function>XSyncCreateCounter</function> creates a counter on the dpy
272 with the given initial value and returns the counter ID. It returns
273 <function>None</function> if dpy does not support the SYNC extension.
278 <funcdef>Status <function>XSyncSetCounter</function></funcdef>
279 <paramdef>Display<parameter> *dpy</parameter></paramdef>
280 <paramdef>XSyncCounter<parameter> counter</parameter></paramdef>
281 <paramdef>XSyncValue<parameter> value</parameter></paramdef>
287 <function>XSyncSetCounter</function> sets counter to value. It returns
288 <function>False </function> if dpy does not
289 support the SYNC extension; otherwise, it returns <function>True</function>.
294 <funcdef>Status <function>XSyncChangeCounter</function></funcdef>
295 <paramdef>Display<parameter> *dpy</parameter></paramdef>
296 <paramdef>XSyncCounter<parameter> counter</parameter></paramdef>
297 <paramdef>XSyncValue<parameter> value</parameter></paramdef>
302 <function>XSyncChangeCounter</function> adds value to counter. It returns
303 <function>False</function> if dpy does not support the SYNC extension;
304 otherwise, it returns
305 <function>True</function>.
309 <funcdef>Status <function>XSyncDestroyCounter</function></funcdef>
310 <paramdef>Display<parameter> *dpy</parameter></paramdef>
311 <paramdef>XSyncCounter<parameter> counter</parameter></paramdef>
316 <function>XSyncDestroyCounter</function> destroys counter. It returns
317 <function>False</function> if dpy does not support the SYNC extension;
318 otherwise, it returns <function>True</function>.
323 <funcdef>Status <function>XSyncQueryCounter</function></funcdef>
324 <paramdef>Display<parameter> *dpy</parameter></paramdef>
325 <paramdef>XSyncCounter<parameter> counter</parameter></paramdef>
326 <paramdef>XSyncValue<parameter> *value_return</parameter></paramdef>
331 <function>XSyncQueryCounter</function> sets *value_return to the current
332 value of counter. It returns <function>False</function> if there was an
333 error during communication with the server or if dpy does not support the
334 SYNC extension; otherwise, it returns <function>True</function>.
339 <funcdef>Status <function>XSyncAwait</function></funcdef>
340 <paramdef>Display<parameter> *dpy</parameter></paramdef>
341 <paramdef>XSyncWaitCondition<parameter> *wait_list</parameter></paramdef>
342 <paramdef>int<parameter> n_conditions</parameter></paramdef>
347 <function>XSyncAwait</function> awaits on the conditions in wait_list.
348 The n_conditions is the number of wait conditions in wait_list. It
349 returns <function>False</function> if dpy does not support the SYNC
350 extension; otherwise, it returns <function>True</function>. The await is
351 processed asynchronously by the server; this function always returns
352 immediately after issuing the request.
355 XSyncWaitCondition has the following fields:
358 <literallayout remap='Ds'>
359 XSyncCounter trigger.counter; /*counter to trigger on */
360 XSyncValueType trigger.value_type; /*absolute/relative */
361 XSyncValue trigger.wait_value; /*value to compare counter to */
362 XSyncTestType trigger.test_type; /*pos/neg comparison/transtion */
363 XSyncValue event_threshold; /*send event if past threshold */
367 <function>XSyncValueType</function> can be either
368 <function>XSyncAbsolute</function> or <function>XSyncRelative</function>.
372 <function>XSyncTestType</function> can be one of
373 <function>XSyncPositiveTransition</function>,
374 <function>XSyncNegativeTransition</function>,
375 <function>XSyncPositiveComparison</function>, or
376 <function>XSyncNegativeComparison</function>.
381 <funcdef>XSyncAlarm <function>XSyncCreateAlarm</function></funcdef>
382 <paramdef>Display<parameter> *dpy</parameter></paramdef>
383 <paramdef>unsigned long<parameter> values_mask</parameter></paramdef>
384 <paramdef>XSyncAlarmAttributes<parameter> *values`</parameter></paramdef>
389 <function>XSyncCreateAlarm</function> creates an alarm and returns the
390 alarm ID. It returns None if the display does not support the SYNC
391 extension. The values_mask and values specify the alarm attributes.
395 <function>XSyncAlarmAttributes</function> has the following fields. The
396 attribute_mask column specifies the symbol that the caller should OR
397 into values_mask to indicate that the value for the corresponding
398 attribute was actually supplied. Default values are used for all
399 attributes that do not have their attribute_mask OR’ed into values_mask.
400 See the protocol description for <function>CreateAlarm</function> for the
404 <literallayout remap='Ds'>
405 type field name attribute_mask
406 XSyncCounter trigger.counter; XSyncCACounter
407 XSyncValueType trigger.value_type; XSyncCAValueType
408 XSyncValue trigger.wait_value; XSyncCAValue
409 XSyncTestType trigger.test_type; XSyncCATestType
410 XSyncValue delta; XSyncCADelta
411 Bool events; XSyncCAEvents
412 XSyncAlarmState state; client cannot set this
417 <funcdef>Status <function>XSyncDestroyAlarm</function></funcdef>
418 <paramdef>Display<parameter> *dpy</parameter></paramdef>
419 <paramdef>XSyncAlarm<parameter> alarm</parameter></paramdef>
424 <function>XSyncDestroyAlarm</function> destroys alarm. It returns
425 <function>False</function> if dpy does not support
426 the SYNC extension; otherwise, it returns <function>True</function>.
431 <funcdef>Status <function>XSyncQueryAlarm</function></funcdef>
432 <paramdef>Display<parameter> *dpy</parameter></paramdef>
433 <paramdef>XSyncAlarm<parameter> alarm</parameter></paramdef>
434 <paramdef>XSyncAlarmAttributes<parameter> *values_return</parameter></paramdef>
440 <function>XSyncQueryAlarm</function> sets *values_return to the alarm’s
441 attributes. It returns <function>False</function> if there was an error
442 during communication with the server or if dpy does not support the
443 SYNC extension; otherwise, it returns <function>True</function>.
448 <funcdef>Status <function>XSyncChangeAlarm</function></funcdef>
449 <paramdef>Display<parameter> *dpy</parameter></paramdef>
450 <paramdef>XSyncAlarm<parameter> alarm</parameter></paramdef>
451 <paramdef>unsigned long<parameter> values_mask</parameter></paramdef>
452 <paramdef>XSyncAlarmAttributes<parameter> *values</parameter></paramdef>
457 <function>XSyncChangeAlarm</function> changes alarm’s attributes. The
458 attributes to change are specified as in
459 <function>XSyncCreateAlarm</function>. It returns
460 <function>False</function> if dpy does not support
461 the SYNC extension; otherwise, it returns <function>True</function>.
466 <funcdef>Status <function>XSyncSetPriority</function></funcdef>
467 <paramdef>Display<parameter> *dpy</parameter></paramdef>
468 <paramdef>XID<parameter> client_resource_id</parameter></paramdef>
469 <paramdef>int<parameter> priority</parameter></paramdef>
474 <function>XSyncSetPriority</function> sets the priority of the client
475 owning client_resource_id to priority. If client_resource_id is None, it
476 sets the caller’s priority. It returns
477 <function>False</function> if dpy does not support the SYNC extension;
478 otherwise, it returns <function>True</function>.
483 <funcdef>Status <function>XSyncGetPriority</function></funcdef>
484 <paramdef>Display<parameter> *dpy</parameter></paramdef>
485 <paramdef>XID<parameter> client_resource_id</parameter></paramdef>
486 <paramdef>int<parameter> *return_priority</parameter></paramdef>
491 <function>XSyncGetPriority</function> sets *return_priority to the
492 priority of the client owning client_resource_id. If client_resource_id
493 is None, it sets *return_priority to the caller’s priority. It returns
494 <function>False</function> if there was an error during communication
495 with the server or if dpy does not support the SYNC extension; otherwise, it
496 returns <function>True</function>.
501 <sect1 id="c_macros_functions">
502 <title>C Macros/Functions</title>
505 The following procedures manipulate 64-bit values. They are defined both as
506 macros and as functions. By default, the macro form is used. To use the
507 function form, #undef the macro name to uncover the function.
512 <funcdef>void <function>XSyncIntToValue</function></funcdef>
513 <paramdef>XSyncValue<parameter> *pv</parameter></paramdef>
514 <paramdef>int<parameter> i</parameter></paramdef>
519 Converts i to an <function>XSyncValue</function> and stores it in *pv.
520 Performs sign extension (*pv will have the same sign as i.)
525 <funcdef>void <function>XSyncIntsToValue</function></funcdef>
526 <paramdef>XSyncValue<parameter> *pv</parameter></paramdef>
527 <paramdef>unsigned int<parameter> low</parameter></paramdef>
528 <paramdef>int<parameter> high</parameter></paramdef>
533 Stores low in the low 32 bits of *pv and high in the high 32 bits of *pv.
539 <funcdef>Bool <function>XSyncValueGreaterThan</function></funcdef>
540 <paramdef>XSyncValue<parameter> a</parameter></paramdef>
541 <paramdef>XSyncValue<parameter> b</parameter></paramdef>
546 Returns <function>True</function> if a is greater than b, else returns
547 <function>False</function>.
552 <funcdef>Bool <function>XSyncValueLessThan</function></funcdef>
553 <paramdef>XSyncValue<parameter> a</parameter></paramdef>
554 <paramdef>XSyncValue<parameter> b</parameter></paramdef>
559 Returns <function>True</function> if a is less than b, else returns
560 <function>False</function>.
566 <funcdef>Bool <function>XSyncValueGreaterOrEqual</function></funcdef>
567 <paramdef>XSyncValue<parameter> a</parameter></paramdef>
568 <paramdef>XSyncValue<parameter> b</parameter></paramdef>
573 Returns <function>True</function> if a is greater than or equal to b,
574 else returns <function>False</function>.
579 <funcdef>Bool <function>XSyncValueLessOrEqual</function></funcdef>
580 <paramdef>XSyncValue<parameter> a</parameter></paramdef>
581 <paramdef>XSyncValue<parameter> b</parameter></paramdef>
586 Returns <function>True</function> if a is less than or equal to b,
587 else returns <function>False</function>.
592 <funcdef>Bool <function>XSyncValueEqual</function></funcdef>
593 <paramdef>XSyncValue<parameter> a</parameter></paramdef>
594 <paramdef>XSyncValue<parameter> b</parameter></paramdef>
599 Returns <function>True</function> if a is equal to b,
600 else returns <function>False</function>.
605 <funcdef>Bool <function>XSyncValueIsNegative</function></funcdef>
606 <paramdef>XSyncValue<parameter> v</parameter></paramdef>
611 Returns <function>True</function> if v is negative,
612 else returns <function>False</function>.
617 <funcdef>Bool <function>XSyncValueIsZero</function></funcdef>
618 <paramdef>XSyncValue<parameter> v</parameter></paramdef>
623 Returns <function>True</function> if v is zero,
624 else returns <function>False</function>.
629 <funcdef>Bool <function>XSyncValueIsPositive</function></funcdef>
630 <paramdef>XSyncValue<parameter> v</parameter></paramdef>
635 Returns <function>True</function> if v is positive,
636 else returns <function>False</function>.
641 <funcdef>unsigned int <function>XSyncValueLow32</function></funcdef>
642 <paramdef>XSyncValue<parameter> v</parameter></paramdef>
647 Returns the low 32 bits of v.
652 <funcdef>unsigned int <function>XSyncValueHigh32</function></funcdef>
653 <paramdef>XSyncValue<parameter> v</parameter></paramdef>
658 Returns the high 32 bits of v.
663 <funcdef>void <function>XSyncValueAdd</function></funcdef>
664 <paramdef>XSyncValue<parameter> *presult</parameter></paramdef>
665 <paramdef>XSyncValue<parameter> a</parameter></paramdef>
666 <paramdef>XSyncValue<parameter> b</parameter></paramdef>
667 <paramdef>Bool<parameter> *poverflow</parameter></paramdef>
672 Adds a to b and stores the result in *presult. If the result could not
673 fit in 64 bits, *poverflow is set to <function>True</function>, else it is
674 set to <function>False</function>.
679 <funcdef>void <function>XSyncValueSubtract</function></funcdef>
680 <paramdef>XSyncValue<parameter> *presult</parameter></paramdef>
681 <paramdef>XSyncValue<parameter> a</parameter></paramdef>
682 <paramdef>XSyncValue<parameter> b</parameter></paramdef>
683 <paramdef>Bool<parameter> *poverflow</parameter></paramdef>
688 Subtracts b from a and stores the result in *presult. If the result could not
689 fit in 64 bits, *poverflow is set to <function>True</function>, else it is
690 set to <function>False</function>.
695 <funcdef>void <function>XSyncMaxValue</function></funcdef>
696 <paramdef>XSyncValue<parameter> *pv</parameter></paramdef>
701 Sets *pv to the maximum value expressible in 64 bits.
706 <funcdef>void <function>XSyncMinValue</function></funcdef>
707 <paramdef>XSyncValue<parameter> *pv</parameter></paramdef>
712 Sets *pv to the minimum value expressible in 64 bits.
718 <title>Events</title>
721 Let <emphasis remap='I'>event_base</emphasis> be the value event base return as defined in the function
722 <function>XSyncQueryExtension</function>.
726 An <function>XSyncCounterNotifyEvent</function>’s type field has the value
727 event_base + <function>XSyncCounterNotify</function>. The fields of this
731 <literallayout remap='Ds'>
732 int type; /* event base + XSyncCounterNotify */
733 unsigned long serial; /* number of last request processed by server */
734 Bool send event; /* true if this came from a SendEvent request */
735 Display * display; /* Display the event was read from */
736 XSyncCounter counter; /* counter involved in await */
737 XSyncValue wait_value; /* value being waited for */
738 XSyncValue counter_value; /* counter value when this event was sent */
739 Time time; /* milliseconds */
740 int count; /* how many more events to come */
741 Bool destroyed; /* True if counter was destroyed */
745 An <function>XSyncAlarmNotifyEvent</function>’s type field has the value
746 event_base + <function>XSyncAlarmNotify</function>. The fields of
750 <literallayout remap='Ds'>
751 int type; /* event_base + XSyncAlarmNotify */
752 unsigned long serial; /* number of last request processed by server */
753 Bool send_event; /* true if this came from a SendEvent request */
754 Display * display; /*Display the event was read from */
755 XSyncAlarm alarm; /* alarm that triggered */
756 XSyncValue counter_value /* value that triggered the alarm */
757 XSyncValue alarm_value /* test value of trigger in alarm */
758 Time time; /* milliseconds */
759 XSyncAlarmState state; /* new state of alarm */
765 <title>Errors</title>
767 Let <emphasis remap='I'>error_base</emphasis> be the value
768 <emphasis remap='I'>error_base_return</emphasis> as defined in the function
769 <function>XSyncQueryExtension</function>.
773 An <function>XSyncAlarmError</function>’s error_code field has
774 <function>XSyncBadAlarm</function>. The fields of this structure are:
777 <literallayout remap='Ds'>
779 Display * display; /* Display the event was read from */
780 XSyncCounter counter; /* resource id */
781 unsigned long serial; /* serial number of failed request */
782 unsigned char error_code; /* error_base + XSyncBadAlarm */
783 unsigned char request_code; /* Major op-code of failed request */
784 unsigned char minor_code; /* Minor op-code of failed request */
788 An <function>XSyncCounterError</function>’s error code field has the value
789 error_base + <function>XSyncBadCounter</function>. The fields of this
792 <literallayout remap='Ds'>
794 Display * display; /* Display the event was read from */
795 XSyncCounter counter; /* resource id */
796 unsigned long serial; /* serial number of failed request */
797 unsigned char error_code; /* error_base + XSyncBadCounter */
798 unsigned char request_code; /* Major op-code of failed request */
799 unsigned char minor_code; /* Minor op-code of failed request */