Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-03-13 09:29:38

0001 /*
0002 
0003 Copyright 1991, 1993, 1994, 1998  The Open Group
0004 
0005 Permission to use, copy, modify, distribute, and sell this software and its
0006 documentation for any purpose is hereby granted without fee, provided that
0007 the above copyright notice appear in all copies and that both that
0008 copyright notice and this permission notice appear in supporting
0009 documentation.
0010 
0011 The above copyright notice and this permission notice shall be included in
0012 all copies or substantial portions of the Software.
0013 
0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0017 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0020 
0021 Except as contained in this notice, the name of The Open Group shall not be
0022 used in advertising or otherwise to promote the sale, use or other dealings
0023 in this Software without prior written authorization from The Open Group.
0024 
0025 */
0026 
0027 /***********************************************************
0028 Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
0029 and Olivetti Research Limited, Cambridge, England.
0030 
0031                         All Rights Reserved
0032 
0033 Permission to use, copy, modify, and distribute this software and its
0034 documentation for any purpose and without fee is hereby granted,
0035 provided that the above copyright notice appear in all copies and that
0036 both that copyright notice and this permission notice appear in
0037 supporting documentation, and that the names of Digital or Olivetti
0038 not be used in advertising or publicity pertaining to distribution of the
0039 software without specific, written prior permission.
0040 
0041 DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
0042 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
0043 FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR
0044 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
0045 USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
0046 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
0047 PERFORMANCE OF THIS SOFTWARE.
0048 
0049 ******************************************************************/
0050 
0051 #ifndef _SYNC_H_
0052 #define _SYNC_H_
0053 
0054 #include <X11/Xfuncproto.h>
0055 #include <X11/extensions/syncconst.h>
0056 
0057 #ifdef _SYNC_SERVER
0058 #include <X11/extensions/syncproto.h>
0059 #else
0060 
0061 _XFUNCPROTOBEGIN
0062 /* get rid of macros so we can define corresponding functions */
0063 #undef XSyncIntToValue
0064 #undef XSyncIntsToValue
0065 #undef XSyncValueGreaterThan
0066 #undef XSyncValueLessThan
0067 #undef XSyncValueGreaterOrEqual
0068 #undef XSyncValueLessOrEqual
0069 #undef XSyncValueEqual
0070 #undef XSyncValueIsNegative
0071 #undef XSyncValueIsZero
0072 #undef XSyncValueIsPositive
0073 #undef XSyncValueLow32
0074 #undef XSyncValueHigh32
0075 #undef XSyncValueAdd
0076 #undef XSyncValueSubtract
0077 #undef XSyncMaxValue
0078 #undef XSyncMinValue
0079 
0080 extern void XSyncIntToValue(
0081     XSyncValue* /*pv*/,
0082     int /*i*/
0083 );
0084 
0085 extern void XSyncIntsToValue(
0086     XSyncValue* /*pv*/,
0087     unsigned int /*l*/,
0088     int /*h*/
0089 );
0090 
0091 extern Bool XSyncValueGreaterThan(
0092     XSyncValue /*a*/,
0093     XSyncValue /*b*/
0094 );
0095 
0096 extern Bool XSyncValueLessThan(
0097     XSyncValue /*a*/,
0098     XSyncValue /*b*/
0099 );
0100 
0101 extern Bool XSyncValueGreaterOrEqual(
0102     XSyncValue /*a*/,
0103     XSyncValue /*b*/
0104 );
0105 
0106 extern Bool XSyncValueLessOrEqual(
0107     XSyncValue /*a*/,
0108     XSyncValue /*b*/
0109 );
0110 
0111 extern Bool XSyncValueEqual(
0112     XSyncValue /*a*/,
0113     XSyncValue /*b*/
0114 );
0115 
0116 extern Bool XSyncValueIsNegative(
0117     XSyncValue /*v*/
0118 );
0119 
0120 extern Bool XSyncValueIsZero(
0121     XSyncValue /*a*/
0122 );
0123 
0124 extern Bool XSyncValueIsPositive(
0125     XSyncValue /*v*/
0126 );
0127 
0128 extern unsigned int XSyncValueLow32(
0129     XSyncValue /*v*/
0130 );
0131 
0132 extern int XSyncValueHigh32(
0133     XSyncValue /*v*/
0134 );
0135 
0136 extern void XSyncValueAdd(
0137     XSyncValue* /*presult*/,
0138     XSyncValue /*a*/,
0139     XSyncValue /*b*/,
0140     int* /*poverflow*/
0141 );
0142 
0143 extern void XSyncValueSubtract(
0144     XSyncValue* /*presult*/,
0145     XSyncValue /*a*/,
0146     XSyncValue /*b*/,
0147     int* /*poverflow*/
0148 );
0149 
0150 extern void XSyncMaxValue(
0151     XSyncValue* /*pv*/
0152 );
0153 
0154 extern void XSyncMinValue(
0155     XSyncValue* /*pv*/
0156 );
0157 
0158 _XFUNCPROTOEND
0159 
0160 
0161 typedef struct _XSyncSystemCounter {
0162     char *name;         /* null-terminated name of system counter */
0163     XSyncCounter counter;   /* counter id of this system counter */
0164     XSyncValue resolution;  /* resolution of this system counter */
0165 } XSyncSystemCounter;
0166 
0167 
0168 typedef struct {
0169     XSyncCounter counter;   /* counter to trigger on */
0170     XSyncValueType value_type;  /* absolute/relative */
0171     XSyncValue wait_value;  /* value to compare counter to */
0172     XSyncTestType test_type;    /* pos/neg comparison/transition */
0173 } XSyncTrigger;
0174 
0175 typedef struct {
0176     XSyncTrigger trigger;   /* trigger for await */
0177     XSyncValue event_threshold; /* send event if past threshold */
0178 } XSyncWaitCondition;
0179 
0180 
0181 typedef struct {
0182     XSyncTrigger trigger;
0183     XSyncValue  delta;
0184     Bool events;
0185     XSyncAlarmState state;
0186 } XSyncAlarmAttributes;
0187 
0188 /*
0189  *  Events
0190  */
0191 
0192 typedef struct {
0193     int type;           /* event base + XSyncCounterNotify */
0194     unsigned long serial;   /* # of last request processed by server */
0195     Bool send_event;        /* true if this came from a SendEvent request */
0196     Display *display;       /* Display the event was read from */
0197     XSyncCounter counter;   /* counter involved in await */
0198     XSyncValue wait_value;  /* value being waited for */
0199     XSyncValue counter_value;   /* counter value when this event was sent */
0200     Time time;          /* milliseconds */
0201     int count;          /* how many more events to come */
0202     Bool destroyed;     /* True if counter was destroyed */
0203 } XSyncCounterNotifyEvent;
0204 
0205 typedef struct {
0206     int type;           /* event base + XSyncAlarmNotify */
0207     unsigned long serial;   /* # of last request processed by server */
0208     Bool send_event;        /* true if this came from a SendEvent request */
0209     Display *display;       /* Display the event was read from */
0210     XSyncAlarm alarm;       /* alarm that triggered */
0211     XSyncValue counter_value;   /* value that triggered the alarm */
0212     XSyncValue alarm_value; /* test  value of trigger in alarm */
0213     Time time;          /* milliseconds */
0214     XSyncAlarmState state;  /* new state of alarm */
0215 } XSyncAlarmNotifyEvent;
0216 
0217 /*
0218  *  Errors
0219  */
0220 
0221 typedef struct {
0222     int type;
0223     Display *display;       /* Display the event was read from */
0224     XSyncAlarm alarm;       /* resource id */
0225     unsigned long serial;   /* serial number of failed request */
0226     unsigned char error_code;   /* error base + XSyncBadAlarm */
0227     unsigned char request_code; /* Major op-code of failed request */
0228     unsigned char minor_code;   /* Minor op-code of failed request */
0229 } XSyncAlarmError;
0230 
0231 typedef struct {
0232     int type;
0233     Display *display;       /* Display the event was read from */
0234     XSyncCounter counter;   /* resource id */
0235     unsigned long serial;   /* serial number of failed request */
0236     unsigned char error_code;   /* error base + XSyncBadCounter */
0237     unsigned char request_code; /* Major op-code of failed request */
0238     unsigned char minor_code;   /* Minor op-code of failed request */
0239 } XSyncCounterError;
0240 
0241 /*
0242  *  Prototypes
0243  */
0244 
0245 _XFUNCPROTOBEGIN
0246 
0247 extern Status XSyncQueryExtension(
0248     Display* /*dpy*/,
0249     int* /*event_base_return*/,
0250     int* /*error_base_return*/
0251 );
0252 
0253 extern Status XSyncInitialize(
0254     Display* /*dpy*/,
0255     int* /*major_version_return*/,
0256     int* /*minor_version_return*/
0257 );
0258 
0259 extern XSyncSystemCounter *XSyncListSystemCounters(
0260     Display* /*dpy*/,
0261     int* /*n_counters_return*/
0262 );
0263 
0264 extern void XSyncFreeSystemCounterList(
0265     XSyncSystemCounter* /*list*/
0266 );
0267 
0268 extern XSyncCounter XSyncCreateCounter(
0269     Display* /*dpy*/,
0270     XSyncValue /*initial_value*/
0271 );
0272 
0273 extern Status XSyncSetCounter(
0274     Display* /*dpy*/,
0275     XSyncCounter /*counter*/,
0276     XSyncValue /*value*/
0277 );
0278 
0279 extern Status XSyncChangeCounter(
0280     Display* /*dpy*/,
0281     XSyncCounter /*counter*/,
0282     XSyncValue /*value*/
0283 );
0284 
0285 extern Status XSyncDestroyCounter(
0286     Display* /*dpy*/,
0287     XSyncCounter /*counter*/
0288 );
0289 
0290 extern Status XSyncQueryCounter(
0291     Display* /*dpy*/,
0292     XSyncCounter /*counter*/,
0293     XSyncValue* /*value_return*/
0294 );
0295 
0296 extern Status XSyncAwait(
0297     Display* /*dpy*/,
0298     XSyncWaitCondition* /*wait_list*/,
0299     int /*n_conditions*/
0300 );
0301 
0302 extern XSyncAlarm XSyncCreateAlarm(
0303     Display* /*dpy*/,
0304     unsigned long /*values_mask*/,
0305     XSyncAlarmAttributes* /*values*/
0306 );
0307 
0308 extern Status XSyncDestroyAlarm(
0309     Display* /*dpy*/,
0310     XSyncAlarm /*alarm*/
0311 );
0312 
0313 extern Status XSyncQueryAlarm(
0314     Display* /*dpy*/,
0315     XSyncAlarm /*alarm*/,
0316     XSyncAlarmAttributes* /*values_return*/
0317 );
0318 
0319 extern Status XSyncChangeAlarm(
0320     Display* /*dpy*/,
0321     XSyncAlarm /*alarm*/,
0322     unsigned long /*values_mask*/,
0323     XSyncAlarmAttributes* /*values*/
0324 );
0325 
0326 extern Status XSyncSetPriority(
0327     Display* /*dpy*/,
0328     XID /*client_resource_id*/,
0329     int /*priority*/
0330 );
0331 
0332 extern Status XSyncGetPriority(
0333     Display* /*dpy*/,
0334     XID /*client_resource_id*/,
0335     int* /*return_priority*/
0336 );
0337 
0338 extern XSyncFence XSyncCreateFence(
0339     Display* /*dpy*/,
0340     Drawable /*d*/,
0341     Bool /*initially_triggered*/
0342 );
0343 
0344 extern Bool XSyncTriggerFence(
0345     Display* /*dpy*/,
0346     XSyncFence /*fence*/
0347 );
0348 
0349 extern Bool XSyncResetFence(
0350     Display* /*dpy*/,
0351     XSyncFence /*fence*/
0352 );
0353 
0354 extern Bool XSyncDestroyFence(
0355     Display* /*dpy*/,
0356     XSyncFence /*fence*/
0357 );
0358 
0359 extern Bool XSyncQueryFence(
0360     Display* /*dpy*/,
0361     XSyncFence /*fence*/,
0362     Bool* /*triggered*/
0363 );
0364 
0365 extern Bool XSyncAwaitFence(
0366     Display* /*dpy*/,
0367     const XSyncFence* /*fence_list*/,
0368     int /*n_fences*/
0369 );
0370 
0371 _XFUNCPROTOEND
0372 
0373 #endif /* _SYNC_SERVER */
0374 
0375 #endif /* _SYNC_H_ */