Home | History | Annotate | Download | only in extensions
      1 /*
      2 
      3 Copyright 1991, 1993, 1994, 1998  The Open Group
      4 
      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
      9 documentation.
     10 
     11 The above copyright notice and this permission notice shall be included in
     12 all copies or substantial portions of the Software.
     13 
     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.
     20 
     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.
     24 
     25 */
     26 
     27 /***********************************************************
     28 Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
     29 and Olivetti Research Limited, Cambridge, England.
     30 
     31                         All Rights Reserved
     32 
     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.
     40 
     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.
     48 
     49 ******************************************************************/
     50 
     51 #ifndef _SYNCPROTO_H_
     52 #define _SYNCPROTO_H_
     53 
     54 #include <X11/extensions/syncconst.h>
     55 
     56 #define X_SyncInitialize		0
     57 #define X_SyncListSystemCounters	1
     58 #define X_SyncCreateCounter		2
     59 #define X_SyncSetCounter		3
     60 #define X_SyncChangeCounter		4
     61 #define X_SyncQueryCounter              5
     62 #define X_SyncDestroyCounter		6
     63 #define X_SyncAwait			7
     64 #define X_SyncCreateAlarm               8
     65 #define X_SyncChangeAlarm	        9
     66 #define X_SyncQueryAlarm	       10
     67 #define X_SyncDestroyAlarm	       11
     68 #define X_SyncSetPriority   	       12
     69 #define X_SyncGetPriority   	       13
     70 
     71 /* cover up types from sync.h to make sure they're the right size for
     72  * protocol packaging.  These will be undef'ed after all the protocol
     73  * structures are defined.
     74  */
     75 #define XSyncCounter CARD32
     76 #define XSyncAlarm   CARD32
     77 
     78 /*
     79  * Initialize
     80  */
     81 typedef struct _xSyncInitialize {
     82     CARD8	reqType;
     83     CARD8	syncReqType;
     84     CARD16	length B16;
     85     CARD8	majorVersion;
     86     CARD8	minorVersion;
     87     CARD16	pad B16;
     88 } xSyncInitializeReq;
     89 #define sz_xSyncInitializeReq		8
     90 
     91 typedef struct {
     92     BYTE	type;
     93     CARD8	unused;
     94     CARD16	sequenceNumber B16;
     95     CARD32	length B32;
     96     CARD8	majorVersion;
     97     CARD8	minorVersion;
     98     CARD16	pad B16;
     99     CARD32	pad0 B32;
    100     CARD32	pad1 B32;
    101     CARD32	pad2 B32;
    102     CARD32	pad3 B32;
    103     CARD32	pad4 B32;
    104 } xSyncInitializeReply;
    105 #define sz_xSyncInitializeReply	32
    106 
    107 /*
    108  * ListSystemCounters
    109  */
    110 typedef struct _xSyncListSystemCounters
    111 {
    112     CARD8	reqType;
    113     CARD8	syncReqType;
    114     CARD16	length B16;
    115 } xSyncListSystemCountersReq;
    116 #define sz_xSyncListSystemCountersReq	4
    117 
    118 typedef struct {
    119     BYTE	type;
    120     CARD8	unused;
    121     CARD16	sequenceNumber B16;
    122     CARD32	length B32;
    123     INT32	nCounters B32;
    124     CARD32	pad0 B32;
    125     CARD32	pad1 B32;
    126     CARD32	pad2 B32;
    127     CARD32	pad3 B32;
    128     CARD32	pad4 B32;
    129 } xSyncListSystemCountersReply;
    130 #define sz_xSyncListSystemCountersReply	32
    131 
    132 typedef struct {
    133     XSyncCounter counter B32;
    134     INT32	resolution_hi B32;
    135     CARD32	resolution_lo B32;
    136     CARD16	name_length B16;
    137 } xSyncSystemCounter;
    138 #define sz_xSyncSystemCounter 14
    139 
    140 /*
    141  * Create Counter
    142  */
    143 typedef struct _xSyncCreateCounterReq {
    144     CARD8	reqType;
    145     CARD8	syncReqType;
    146     CARD16	length B16;
    147     XSyncCounter cid B32;
    148     INT32       initial_value_hi B32;
    149     CARD32	initial_value_lo B32;
    150 } xSyncCreateCounterReq;
    151 #define sz_xSyncCreateCounterReq	16
    152 
    153 /*
    154  * Change Counter
    155  */
    156 typedef struct _xSyncChangeCounterReq {
    157     CARD8	reqType;
    158     CARD8	syncReqType;
    159     CARD16	length B16;
    160     XSyncCounter cid B32;
    161     INT32       value_hi B32;
    162     CARD32	value_lo B32;
    163 } xSyncChangeCounterReq;
    164 #define sz_xSyncChangeCounterReq	16
    165 
    166 /*
    167  * Set Counter
    168  */
    169 typedef struct _xSyncSetCounterReq {
    170     CARD8	reqType;
    171     CARD8	syncReqType;
    172     CARD16	length B16;
    173     XSyncCounter cid B32;
    174     INT32       value_hi B32;
    175     CARD32	value_lo B32;
    176 } xSyncSetCounterReq;
    177 #define sz_xSyncSetCounterReq	16
    178 
    179 /*
    180  * Destroy Counter
    181  */
    182 typedef struct _xSyncDestroyCounterReq {
    183     CARD8	reqType;
    184     CARD8	syncReqType;
    185     CARD16	length B16;
    186     XSyncCounter counter B32;
    187 } xSyncDestroyCounterReq;
    188 #define sz_xSyncDestroyCounterReq	8
    189 
    190 /*
    191  * Query Counter
    192  */
    193 typedef struct _xSyncQueryCounterReq {
    194     CARD8	reqType;
    195     CARD8	syncReqType;
    196     CARD16	length B16;
    197     XSyncCounter counter B32;
    198 } xSyncQueryCounterReq;
    199 #define sz_xSyncQueryCounterReq		8
    200 
    201 
    202 typedef struct {
    203     BYTE	type;
    204     CARD8	unused;
    205     CARD16	sequenceNumber B16;
    206     CARD32	length B32;
    207     INT32	value_hi B32;
    208     CARD32	value_lo B32;
    209     CARD32	pad0 B32;
    210     CARD32	pad1 B32;
    211     CARD32	pad2 B32;
    212     CARD32	pad3 B32;
    213 } xSyncQueryCounterReply;
    214 #define sz_xSyncQueryCounterReply	32
    215 
    216 /*
    217  * Await
    218  */
    219 typedef struct _xSyncAwaitReq {
    220     CARD8	reqType;
    221     CARD8	syncReqType;
    222     CARD16	length B16;
    223 } xSyncAwaitReq;
    224 #define sz_xSyncAwaitReq		4
    225 
    226 typedef struct _xSyncWaitCondition {
    227     XSyncCounter counter B32;
    228     CARD32	value_type B32;
    229     INT32       wait_value_hi B32;
    230     CARD32      wait_value_lo B32;
    231     CARD32	test_type B32;
    232     INT32	event_threshold_hi B32;
    233     CARD32	event_threshold_lo B32;
    234 } xSyncWaitCondition;
    235 #define sz_xSyncWaitCondition		28
    236 
    237 /*
    238  * Create Alarm
    239  */
    240 typedef struct _xSyncCreateAlarmReq {
    241     CARD8	reqType;
    242     CARD8	syncReqType;
    243     CARD16	length B16;
    244     XSyncAlarm	id B32;
    245     CARD32      valueMask B32;
    246 } xSyncCreateAlarmReq;
    247 #define sz_xSyncCreateAlarmReq		12
    248 
    249 /*
    250  * Destroy Alarm
    251  */
    252 typedef struct _xSyncDestroyAlarmReq {
    253     CARD8	reqType;
    254     CARD8	syncReqType;
    255     CARD16	length B16;
    256     XSyncAlarm	alarm B32;
    257 } xSyncDestroyAlarmReq;
    258 #define sz_xSyncDestroyAlarmReq		8
    259 
    260 /*
    261  * Query Alarm
    262  */
    263 typedef struct _xSyncQueryAlarmReq {
    264     CARD8	reqType;
    265     CARD8	syncReqType;
    266     CARD16	length B16;
    267     XSyncAlarm	alarm B32;
    268 } xSyncQueryAlarmReq;
    269 #define sz_xSyncQueryAlarmReq		8
    270 
    271 typedef struct {
    272     BYTE	type;
    273     CARD8	unused;
    274     CARD16	sequenceNumber B16;
    275     CARD32	length B32;
    276     XSyncCounter counter B32;
    277     CARD32	value_type B32;
    278     INT32	wait_value_hi B32;
    279     CARD32	wait_value_lo B32;
    280     CARD32	test_type      B32;
    281     INT32	delta_hi B32;
    282     CARD32	delta_lo B32;
    283     BOOL        events;
    284     BYTE        state;
    285     BYTE	pad0;
    286     BYTE	pad1;
    287 } xSyncQueryAlarmReply;
    288 #define sz_xSyncQueryAlarmReply		40
    289 
    290 /*
    291  * Change Alarm
    292  */
    293 typedef struct _xSyncChangeAlarmReq {
    294     CARD8	reqType;
    295     CARD8	syncReqType;
    296     CARD16	length B16;
    297     XSyncAlarm	alarm B32;
    298     CARD32	valueMask B32;
    299 } xSyncChangeAlarmReq;
    300 #define sz_xSyncChangeAlarmReq		12
    301 
    302 /*
    303  * SetPriority
    304  */
    305 typedef struct _xSyncSetPriority{
    306     CARD8   	reqType;
    307     CARD8   	syncReqType;
    308     CARD16  	length B16;
    309     CARD32  	id B32;
    310     INT32  	priority B32;
    311 } xSyncSetPriorityReq;
    312 #define sz_xSyncSetPriorityReq	    	12
    313 
    314 /*
    315  * Get Priority
    316  */
    317 typedef struct _xSyncGetPriority{
    318     CARD8   	reqType;
    319     CARD8   	syncReqType;
    320     CARD16  	length B16;
    321     CARD32  	id B32; /*XXX XID? */
    322 } xSyncGetPriorityReq;
    323 #define sz_xSyncGetPriorityReq	    	 8
    324 
    325 typedef struct {
    326     BYTE	type;
    327     CARD8	unused;
    328     CARD16	sequenceNumber B16;
    329     CARD32	length B32;
    330     INT32  	priority B32;
    331     CARD32  	pad0 B32;
    332     CARD32  	pad1 B32;
    333     CARD32  	pad2 B32;
    334     CARD32  	pad3 B32;
    335     CARD32  	pad4 B32;
    336 } xSyncGetPriorityReply;
    337 #define sz_xSyncGetPriorityReply	32
    338 
    339 /*
    340  * Events
    341  */
    342 
    343 typedef struct _xSyncCounterNotifyEvent {
    344     BYTE	type;
    345     BYTE	kind;
    346     CARD16	sequenceNumber B16;
    347     XSyncCounter counter B32;
    348     INT32	wait_value_hi B32;
    349     CARD32	wait_value_lo B32;
    350     INT32	counter_value_hi B32;
    351     CARD32	counter_value_lo B32;
    352     CARD32	time B32;
    353     CARD16	count B16;
    354     BOOL	destroyed;
    355     BYTE        pad0;
    356 } xSyncCounterNotifyEvent;
    357 
    358 typedef struct _xSyncAlarmNotifyEvent {
    359     BYTE	type;
    360     BYTE	kind;
    361     CARD16	sequenceNumber B16;
    362     XSyncAlarm	alarm B32;
    363     INT32	counter_value_hi B32;
    364     CARD32	counter_value_lo B32;
    365     INT32	alarm_value_hi B32;
    366     CARD32	alarm_value_lo B32;
    367     CARD32	time B32;
    368     CARD8       state;
    369     BYTE        pad0;
    370     BYTE        pad1;
    371     BYTE        pad2;
    372 } xSyncAlarmNotifyEvent;
    373 
    374 #undef XSyncCounter
    375 #undef XSyncAlarm
    376 
    377 
    378 #endif /* _SYNCPROTO_H_ */
    379