3 Copyright 1991, 1993, 1994, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
27 /***********************************************************
28 Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
29 and Olivetti Research Limited, Cambridge, England.
33 Permission to use, copy, modify, and distribute this software and its
34 documentation for any purpose and without fee is hereby granted,
35 provided that the above copyright notice appear in all copies and that
36 both that copyright notice and this permission notice appear in
37 supporting documentation, and that the names of Digital or Olivetti
38 not be used in advertising or publicity pertaining to distribution of the
39 software without specific, written prior permission.
41 DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
42 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
43 FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR
44 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
45 USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
46 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
47 PERFORMANCE OF THIS SOFTWARE.
49 ******************************************************************/
54 #include <X11/Xfuncproto.h>
55 #include <X11/extensions/syncconst.h>
58 #include <X11/extensions/syncproto.h>
62 /* get rid of macros so we can define corresponding functions */
63 #undef XSyncIntToValue
64 #undef XSyncIntsToValue
65 #undef XSyncValueGreaterThan
66 #undef XSyncValueLessThan
67 #undef XSyncValueGreaterOrEqual
68 #undef XSyncValueLessOrEqual
69 #undef XSyncValueEqual
70 #undef XSyncValueIsNegative
71 #undef XSyncValueIsZero
72 #undef XSyncValueIsPositive
73 #undef XSyncValueLow32
74 #undef XSyncValueHigh32
76 #undef XSyncValueSubtract
80 extern void XSyncIntToValue(
85 extern void XSyncIntsToValue(
91 extern Bool XSyncValueGreaterThan(
96 extern Bool XSyncValueLessThan(
101 extern Bool XSyncValueGreaterOrEqual(
106 extern Bool XSyncValueLessOrEqual(
111 extern Bool XSyncValueEqual(
116 extern Bool XSyncValueIsNegative(
120 extern Bool XSyncValueIsZero(
124 extern Bool XSyncValueIsPositive(
128 extern unsigned int XSyncValueLow32(
132 extern int XSyncValueHigh32(
136 extern void XSyncValueAdd(
137 XSyncValue* /*presult*/,
143 extern void XSyncValueSubtract(
144 XSyncValue* /*presult*/,
150 extern void XSyncMaxValue(
154 extern void XSyncMinValue(
161 typedef struct _XSyncSystemCounter {
162 char *name; /* null-terminated name of system counter */
163 XSyncCounter counter; /* counter id of this system counter */
164 XSyncValue resolution; /* resolution of this system counter */
165 } XSyncSystemCounter;
169 XSyncCounter counter; /* counter to trigger on */
170 XSyncValueType value_type; /* absolute/relative */
171 XSyncValue wait_value; /* value to compare counter to */
172 XSyncTestType test_type; /* pos/neg comparison/transtion */
176 XSyncTrigger trigger; /* trigger for await */
177 XSyncValue event_threshold; /* send event if past threshold */
178 } XSyncWaitCondition;
182 XSyncTrigger trigger;
185 XSyncAlarmState state;
186 } XSyncAlarmAttributes;
193 int type; /* event base + XSyncCounterNotify */
194 unsigned long serial; /* # of last request processed by server */
195 Bool send_event; /* true if this came from a SendEvent request */
196 Display *display; /* Display the event was read from */
197 XSyncCounter counter; /* counter involved in await */
198 XSyncValue wait_value; /* value being waited for */
199 XSyncValue counter_value; /* counter value when this event was sent */
200 Time time; /* milliseconds */
201 int count; /* how many more events to come */
202 Bool destroyed; /* True if counter was destroyed */
203 } XSyncCounterNotifyEvent;
206 int type; /* event base + XSyncCounterNotify */
207 unsigned long serial; /* # of last request processed by server */
208 Bool send_event; /* true if this came from a SendEvent request */
209 Display *display; /* Display the event was read from */
210 XSyncAlarm alarm; /* alarm that triggered */
211 XSyncValue counter_value; /* value that triggered the alarm */
212 XSyncValue alarm_value; /* test value of trigger in alarm */
213 Time time; /* milliseconds */
214 XSyncAlarmState state; /* new state of alarm */
215 } XSyncAlarmNotifyEvent;
223 Display *display; /* Display the event was read from */
224 XSyncAlarm alarm; /* resource id */
225 unsigned long serial; /* serial number of failed request */
226 unsigned char error_code; /* error base + XSyncBadAlarm */
227 unsigned char request_code; /* Major op-code of failed request */
228 unsigned char minor_code; /* Minor op-code of failed request */
233 Display *display; /* Display the event was read from */
234 XSyncCounter counter; /* resource id */
235 unsigned long serial; /* serial number of failed request */
236 unsigned char error_code; /* error base + XSyncBadCounter */
237 unsigned char request_code; /* Major op-code of failed request */
238 unsigned char minor_code; /* Minor op-code of failed request */
247 extern Status XSyncQueryExtension(
249 int* /*event_base_return*/,
250 int* /*error_base_return*/
253 extern Status XSyncInitialize(
255 int* /*major_version_return*/,
256 int* /*minor_version_return*/
259 extern XSyncSystemCounter *XSyncListSystemCounters(
261 int* /*n_counters_return*/
264 extern void XSyncFreeSystemCounterList(
265 XSyncSystemCounter* /*list*/
268 extern XSyncCounter XSyncCreateCounter(
270 XSyncValue /*initial_value*/
273 extern Status XSyncSetCounter(
275 XSyncCounter /*counter*/,
279 extern Status XSyncChangeCounter(
281 XSyncCounter /*counter*/,
285 extern Status XSyncDestroyCounter(
287 XSyncCounter /*counter*/
290 extern Status XSyncQueryCounter(
292 XSyncCounter /*counter*/,
293 XSyncValue* /*value_return*/
296 extern Status XSyncAwait(
298 XSyncWaitCondition* /*wait_list*/,
302 extern XSyncAlarm XSyncCreateAlarm(
304 unsigned long /*values_mask*/,
305 XSyncAlarmAttributes* /*values*/
308 extern Status XSyncDestroyAlarm(
313 extern Status XSyncQueryAlarm(
315 XSyncAlarm /*alarm*/,
316 XSyncAlarmAttributes* /*values_return*/
319 extern Status XSyncChangeAlarm(
321 XSyncAlarm /*alarm*/,
322 unsigned long /*values_mask*/,
323 XSyncAlarmAttributes* /*values*/
326 extern Status XSyncSetPriority(
328 XID /*client_resource_id*/,
332 extern Status XSyncGetPriority(
334 XID /*client_resource_id*/,
335 int* /*return_priority*/
338 extern XSyncFence XSyncCreateFence(
341 Bool /*initially_triggered*/
344 extern Bool XSyncTriggerFence(
349 extern Bool XSyncResetFence(
354 extern Bool XSyncDestroyFence(
359 extern Bool XSyncQueryFence(
361 XSyncFence /*fence*/,
365 extern Bool XSyncAwaitFence(
367 const XSyncFence* /*fence_list*/,
373 #endif /* _SYNC_SERVER */
375 #endif /* _SYNC_H_ */