Initial commit
[xorg_rtime.git] / xextproto-7.0.2 / lbxopts.h
blob02e87fd26b05d33cd85915bc2677ec2a0ced57a9
1 /* $Xorg: lbxopts.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
2 /*
3 * Copyright 1994 Network Computing Devices, Inc.
5 * Permission to use, copy, modify, distribute, and sell this software and
6 * its documentation for any purpose is hereby granted without fee, provided
7 * that the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name Network Computing Devices, Inc. not be
10 * used in advertising or publicity pertaining to distribution of this
11 * software without specific, written prior permission.
13 * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
14 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
15 * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
17 * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
18 * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
19 * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
20 * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 /* $XFree86: xc/include/extensions/lbxopts.h,v 1.5 2001/01/17 17:53:21 dawes Exp $ */
26 #ifndef _LBX_OPTS_H_
27 #define _LBX_OPTS_H_
30 * Negotiable configuration options
32 #define LBX_OPT_DELTA_PROXY 0
33 #define LBX_OPT_DELTA_SERVER 1
34 #define LBX_OPT_STREAM_COMP 2
35 #define LBX_OPT_BITMAP_COMP 3
36 #define LBX_OPT_PIXMAP_COMP 4
37 #define LBX_OPT_MSG_COMP 5 /* aka "squishing" */
38 #define LBX_OPT_USE_TAGS 6
39 #define LBX_OPT_CMAP_ALL 7
40 #define LBX_OPT_EXTENSION 255
43 * Length fields are encoded in 1 or 3 bytes
45 #define LBX_OPT_SMALLLEN_SIZE 1
46 #define LBX_OPT_BIGLEN_SIZE 3
47 #define LBX_OPT_BIGLEN_MIN 256
49 #define LBX_OPT_DECODE_LEN(p, len, size) \
50 if ((p)[0]) { \
51 (len) = (p)[0]; \
52 (size) = LBX_OPT_SMALLLEN_SIZE; \
53 } \
54 else { \
55 (len) = ((LBX_OPT_BIGLEN_MIN + (p)[1]) << 8) | (p)[2]; \
56 (size) = LBX_OPT_BIGLEN_SIZE; \
60 * Option header lengths
62 #define LBX_OPT_SMALLHDR_LEN (1 + LBX_OPT_SMALLLEN_SIZE)
63 #define LBX_OPT_BIGHDR_LEN (1 + LBX_OPT_BIGLEN_SIZE)
66 * Delta compression parameters
68 #define LBX_OPT_DELTA_REQLEN 6
69 #define LBX_OPT_DELTA_REPLYLEN 2
70 #define LBX_OPT_DELTA_NCACHE_DFLT 16
71 #define LBX_OPT_DELTA_MSGLEN_MIN 32
72 #define LBX_OPT_DELTA_MSGLEN_DFLT 64
76 * Stream compression opts
79 #include <sys/types.h>
81 #if defined(WIN32) || (defined(USG) && !defined(CRAY) && !defined(umips) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__))
83 struct iovec {
84 caddr_t iov_base;
85 int iov_len;
88 #else
89 #ifndef Lynx
90 #include <sys/uio.h>
91 #else
92 #include <uio.h>
93 #endif
94 #endif
96 typedef void *LbxStreamCompHandle;
98 typedef struct _LbxStreamOpts {
99 LbxStreamCompHandle (*streamCompInit)(int fd, pointer arg);
100 pointer streamCompArg;
101 int (*streamCompStuffInput)(
102 int fd,
103 unsigned char *buf,
104 int buflen
106 int (*streamCompInputAvail)(
107 int fd
109 int (*streamCompFlush)(
110 int fd
112 int (*streamCompRead)(
113 int fd,
114 unsigned char *buf,
115 int buflen
117 int (*streamCompWriteV)(
118 int fd,
119 struct iovec *iov,
120 int iovcnt
122 void (*streamCompOn)(
123 int fd
125 void (*streamCompOff)(
126 int fd
128 void (*streamCompFreeHandle)(
129 LbxStreamCompHandle handle
131 } LbxStreamOpts;
133 #endif /* _LBX_OPTS_H_ */