summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-12-04 14:38:06 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-12-04 15:06:17 -0800
commit134281ecae212803bf26e18692629a0e150e5bb7 (patch)
tree0ba9e37e9d6d5fee5a63d4ad5328c91b0a7612cd
parent1756503394390624245e4e6caca41f4229c6aa0b (diff)
Make compatible with xextproto 7.1
Move headers here that used to be in xextproto but are really for liblbxutil functions. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r--configure.ac2
-rw-r--r--include/X11/extensions/lbxbuf.h51
-rw-r--r--include/X11/extensions/lbxbufstr.h45
-rw-r--r--include/X11/extensions/lbxdeltastr.h105
-rw-r--r--include/X11/extensions/lbximage.h151
-rw-r--r--include/X11/extensions/lbxopts.h133
-rw-r--r--include/X11/extensions/lbxzlib.h64
-rw-r--r--src/Makefile.am10
-rw-r--r--src/delta/lbxdelta.c2
9 files changed, 561 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index fc79447..d17e1a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,7 +40,7 @@ AC_PROG_LIBTOOL
XORG_DEFAULT_OPTIONS
# Check for X
-PKG_CHECK_MODULES(LBXUTIL, xextproto xproto)
+PKG_CHECK_MODULES(LBXUTIL, [xextproto >= 7.0.99.1] xproto)
AC_CHECK_LIB(z,deflate,[LBXUTIL_LIBS="${LBXUTIL_LIBS} -lz"],
AC_MSG_ERROR([zlib is required to build liblbxutil]))
diff --git a/include/X11/extensions/lbxbuf.h b/include/X11/extensions/lbxbuf.h
new file mode 100644
index 0000000..ace94f4
--- /dev/null
+++ b/include/X11/extensions/lbxbuf.h
@@ -0,0 +1,51 @@
+/* $Xorg: lbxbuf.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1988, 1989, 1990, 1994 Network Computing Devices, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name Network Computing Devices, Inc. not be
+ * used in advertising or publicity pertaining to distribution of this
+ * software without specific, written prior permission.
+ *
+ * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
+ * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
+ * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
+ * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE,
+ * DATA, OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND
+ * REGARDLESS OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _BUFFER_H_
+#define _BUFFER_H_
+
+#define INBUFFER_SIZE (1 << 13) /* 8K */
+#define OUTBUFFER_SIZE (1 << 12) /* 4K */
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+typedef struct _zlibbuffer *ZlibBufferPtr;
+
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
+
+extern int InitZlibBuffer(ZlibBufferPtr b, int size);
+extern void FreeZlibBuffer(ZlibBufferPtr b);
+extern char *ReserveOutBuf(ZlibBufferPtr outbuf, int outlen);
+
+_XFUNCPROTOEND
+
+#endif /* _BUFFER_H_ */
diff --git a/include/X11/extensions/lbxbufstr.h b/include/X11/extensions/lbxbufstr.h
new file mode 100644
index 0000000..8dbac0a
--- /dev/null
+++ b/include/X11/extensions/lbxbufstr.h
@@ -0,0 +1,45 @@
+/* $Xorg: lbxbufstr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1988, 1989, 1990, 1994 Network Computing Devices, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name Network Computing Devices, Inc. not be
+ * used in advertising or publicity pertaining to distribution of this
+ * software without specific, written prior permission.
+ *
+ * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
+ * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
+ * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
+ * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE,
+ * DATA, OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND
+ * REGARDLESS OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ */
+/* $XFree86$ */
+
+#ifndef _BUFFERSTR_H_
+#define _BUFFERSTR_H_
+
+#include <X11/extensions/lbxbuf.h>
+
+/*
+ * ZLIB Input/Output buffer
+ */
+typedef struct _zlibbuffer {
+ char *bufbase;
+ char *bufend;
+ char *bufptr;
+ int bufcnt;
+} ZlibBuffer;
+
+#define BYTES_AVAIL(inbuf, len) \
+ (((inbuf)->bufcnt >= (len)) ? (inbuf)->bufptr : NULL)
+
+#endif /* _BUFFERSTR_H_ */
diff --git a/include/X11/extensions/lbxdeltastr.h b/include/X11/extensions/lbxdeltastr.h
new file mode 100644
index 0000000..d7586aa
--- /dev/null
+++ b/include/X11/extensions/lbxdeltastr.h
@@ -0,0 +1,105 @@
+/* $Xorg: lbxdeltastr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1993 Network Computing Devices
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of NCD. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. NCD. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifndef LBX_DELTA_STRUCT_H
+#define LBX_DELTA_STRUCT_H
+
+#define MIN_CACHEABLE_LEN 8
+
+#define DELTA_CACHEABLE(pcache, len) \
+ ((len) > MIN_CACHEABLE_LEN && (len) <= (pcache)->maxDeltasize)
+
+/*
+ * An entry in the delta compactor cache
+ */
+typedef struct _LBXDeltaElem {
+ int length;
+ unsigned char *buf;
+} LBXDeltaElemRec, *LBXDeltaElemPtr;
+
+
+/*
+ * Delta compactor cache
+ */
+typedef struct _LBXDeltas {
+ unsigned short nDeltas;
+ unsigned short maxDeltasize;
+ LBXDeltaElemPtr deltas;
+ unsigned short nextDelta;
+ unsigned short activeDeltas; /* only needed for outgoing */
+} LBXDeltasRec, *LBXDeltasPtr;
+
+
+/*
+ * Motion delta cache
+ */
+
+typedef struct {
+ BYTE swapped;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ Window root B32, event B32, child B32;
+ INT16 rootX B16, rootY B16, eventX B16, eventY B16;
+ KeyButMask state B16;
+ BOOL sameScreen;
+} lbxMotionCache;
+
+
+/*
+ * Motion delta events
+ */
+
+typedef struct {
+ BYTE type; /* always eventBase + LbxQuickMotionDeltaEvent */
+ CARD8 deltaTime;
+ INT8 deltaX;
+ INT8 deltaY;
+} lbxQuickMotionDeltaEvent;
+#define sz_lbxQuickMotionDeltaEvent 4
+
+typedef struct {
+ BYTE type; /* always eventBase + LbxEvent */
+ BYTE lbxType; /* LbxMotionDeltaEvent */
+ INT8 deltaX;
+ INT8 deltaY;
+ CARD16 deltaTime B16;
+ CARD16 deltaSequence B16;
+} lbxMotionDeltaEvent;
+#define sz_lbxMotionDeltaEvent 8
+
+extern int LBXInitDeltaCache ( LBXDeltasPtr pcache, int nDeltas,
+ int maxDeltasize );
+extern void LBXFreeDeltaCache ( LBXDeltasPtr pcache );
+extern int LBXDeltaMinDiffs ( LBXDeltasPtr pcache, unsigned char *inmsg,
+ int inmsglen, int maxdiff, int *pindex );
+extern void LBXEncodeDelta ( LBXDeltasPtr pcache, unsigned char *inmsg,
+ int ndiff, int index, unsigned char *buf );
+extern int LBXDecodeDelta ( LBXDeltasPtr pcache, xLbxDiffItem *deltas,
+ int ndiff, int index, unsigned char **buf );
+extern void LBXAddDeltaOut ( LBXDeltasPtr pcache, unsigned char *inmsg,
+ int inmsglen );
+extern void LBXAddDeltaIn ( LBXDeltasPtr pcache, unsigned char *inmsg,
+ int inmsglen );
+
+#endif /* LBX_DELTA_STRUCT_H */
diff --git a/include/X11/extensions/lbximage.h b/include/X11/extensions/lbximage.h
new file mode 100644
index 0000000..10627cf
--- /dev/null
+++ b/include/X11/extensions/lbximage.h
@@ -0,0 +1,151 @@
+/* $Xorg: lbximage.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+/******************************************************************************
+
+Copyright 1994, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+******************************************************************************/
+/* $XFree86: xc/include/extensions/lbximage.h,v 1.4 2001/12/20 19:28:54 tsi Exp $ */
+
+#ifndef _LBX_IMAGE_H_
+#define _LBX_IMAGE_H_
+
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
+
+typedef struct _LbxBitmapCompMethod {
+
+ char *methodName;
+ int inited;
+ int methodOpCode; /* to be filled on reply from server */
+
+ int (*compInit)(
+ void
+ );
+
+ int (*compFunc)(
+ unsigned char * /* inbuf */,
+ unsigned char * /* outbuf */,
+ int /* outbufSize */,
+ int /* image_bytes */,
+ int /* pixels_per_line */,
+ int /* padded_bytes_per_scanline */,
+ int /* reverse_bits */,
+ int * /* bytesCompressed */
+ );
+
+ int (*decompFunc)(
+ unsigned char * /* inbuf */,
+ unsigned char * /* outbuf */,
+ int /* image_bytes */,
+ int /* pixels_per_line */,
+ int /* padded_bytes_per_scanline */,
+ int /* reverse_bits */
+ );
+
+} LbxBitmapCompMethod;
+
+
+#define LBX_MAX_DEPTHS 5
+
+typedef struct _LbxPixmapCompMethod {
+
+ char *methodName;
+ unsigned formatMask;
+ int depthCount;
+ int depths[LBX_MAX_DEPTHS];
+ int inited;
+ int methodOpCode; /* to be filled on reply from server */
+
+ int (*compInit)(
+ void
+ );
+
+ int (*compFunc)(
+ char * /* inbuf */,
+ char * /* outbuf */,
+ int /* outbufSize */,
+ int /* format */,
+ int /* depth */,
+ int /* num_scan_lines */,
+ int /* scan_line_size */,
+ int * /* bytesCompressed */
+ );
+
+ int (*decompFunc)(
+ char * /* inbuf */,
+ char * /* outbuf */,
+ int /* num_scan_lines */,
+ int /* scan_line_size */
+ );
+
+} LbxPixmapCompMethod;
+
+
+extern int LbxImageEncodePackBits (
+char * /* inbuf */,
+char * /* outbuf */,
+int /* outbufSize */,
+int /* format */,
+int /* depth */,
+int /* num_scan_lines */,
+int /* scan_line_size */,
+int * /* bytesCompressed */
+);
+
+extern int LbxImageEncodeFaxG42D (
+unsigned char * /* inbuf */,
+unsigned char * /* outbuf */,
+int /* outbufSize */,
+int /* image_bytes */,
+int /* pixels_per_line */,
+int /* padded_bytes_per_scanline */,
+int /* reverse_bits */,
+int * /* bytesCompressed */
+);
+
+extern int LbxImageDecodePackBits (
+char * /* inbuf */,
+char * /* outbuf */,
+int /* num_scan_lines */,
+int /* scan_line_size */
+);
+
+extern int LbxImageDecodeFaxG42D (
+unsigned char * /* inbuf */,
+unsigned char * /* outbuf */,
+int /* image_bytes */,
+int /* pixels_per_line */,
+int /* padded_bytes_per_scanline */,
+int /* reverse_bits */
+);
+
+_XFUNCPROTOEND
+
+#define LBX_IMAGE_COMPRESS_SUCCESS 0
+#define LBX_IMAGE_COMPRESS_NO_SUPPORT 1
+#define LBX_IMAGE_COMPRESS_BAD_MALLOC 2
+#define LBX_IMAGE_COMPRESS_NOT_WORTH_IT 3
+
+#endif /* _LBX_IMAGE_H_ */
diff --git a/include/X11/extensions/lbxopts.h b/include/X11/extensions/lbxopts.h
new file mode 100644
index 0000000..02e87fd
--- /dev/null
+++ b/include/X11/extensions/lbxopts.h
@@ -0,0 +1,133 @@
+/* $Xorg: lbxopts.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1994 Network Computing Devices, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name Network Computing Devices, Inc. not be
+ * used in advertising or publicity pertaining to distribution of this
+ * software without specific, written prior permission.
+ *
+ * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
+ * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
+ * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
+ * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
+ * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
+ * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+/* $XFree86: xc/include/extensions/lbxopts.h,v 1.5 2001/01/17 17:53:21 dawes Exp $ */
+
+#ifndef _LBX_OPTS_H_
+#define _LBX_OPTS_H_
+
+/*
+ * Negotiable configuration options
+ */
+#define LBX_OPT_DELTA_PROXY 0
+#define LBX_OPT_DELTA_SERVER 1
+#define LBX_OPT_STREAM_COMP 2
+#define LBX_OPT_BITMAP_COMP 3
+#define LBX_OPT_PIXMAP_COMP 4
+#define LBX_OPT_MSG_COMP 5 /* aka "squishing" */
+#define LBX_OPT_USE_TAGS 6
+#define LBX_OPT_CMAP_ALL 7
+#define LBX_OPT_EXTENSION 255
+
+/*
+ * Length fields are encoded in 1 or 3 bytes
+ */
+#define LBX_OPT_SMALLLEN_SIZE 1
+#define LBX_OPT_BIGLEN_SIZE 3
+#define LBX_OPT_BIGLEN_MIN 256
+
+#define LBX_OPT_DECODE_LEN(p, len, size) \
+ if ((p)[0]) { \
+ (len) = (p)[0]; \
+ (size) = LBX_OPT_SMALLLEN_SIZE; \
+ } \
+ else { \
+ (len) = ((LBX_OPT_BIGLEN_MIN + (p)[1]) << 8) | (p)[2]; \
+ (size) = LBX_OPT_BIGLEN_SIZE; \
+ }
+
+/*
+ * Option header lengths
+ */
+#define LBX_OPT_SMALLHDR_LEN (1 + LBX_OPT_SMALLLEN_SIZE)
+#define LBX_OPT_BIGHDR_LEN (1 + LBX_OPT_BIGLEN_SIZE)
+
+/*
+ * Delta compression parameters
+ */
+#define LBX_OPT_DELTA_REQLEN 6
+#define LBX_OPT_DELTA_REPLYLEN 2
+#define LBX_OPT_DELTA_NCACHE_DFLT 16
+#define LBX_OPT_DELTA_MSGLEN_MIN 32
+#define LBX_OPT_DELTA_MSGLEN_DFLT 64
+
+
+/*
+ * Stream compression opts
+ */
+
+#include <sys/types.h>
+
+#if defined(WIN32) || (defined(USG) && !defined(CRAY) && !defined(umips) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__))
+
+struct iovec {
+ caddr_t iov_base;
+ int iov_len;
+};
+
+#else
+#ifndef Lynx
+#include <sys/uio.h>
+#else
+#include <uio.h>
+#endif
+#endif
+
+typedef void *LbxStreamCompHandle;
+
+typedef struct _LbxStreamOpts {
+ LbxStreamCompHandle (*streamCompInit)(int fd, pointer arg);
+ pointer streamCompArg;
+ int (*streamCompStuffInput)(
+ int fd,
+ unsigned char *buf,
+ int buflen
+ );
+ int (*streamCompInputAvail)(
+ int fd
+ );
+ int (*streamCompFlush)(
+ int fd
+ );
+ int (*streamCompRead)(
+ int fd,
+ unsigned char *buf,
+ int buflen
+ );
+ int (*streamCompWriteV)(
+ int fd,
+ struct iovec *iov,
+ int iovcnt
+ );
+ void (*streamCompOn)(
+ int fd
+ );
+ void (*streamCompOff)(
+ int fd
+ );
+ void (*streamCompFreeHandle)(
+ LbxStreamCompHandle handle
+ );
+} LbxStreamOpts;
+
+#endif /* _LBX_OPTS_H_ */
diff --git a/include/X11/extensions/lbxzlib.h b/include/X11/extensions/lbxzlib.h
new file mode 100644
index 0000000..271f800
--- /dev/null
+++ b/include/X11/extensions/lbxzlib.h
@@ -0,0 +1,64 @@
+/* $Xorg: lbxzlib.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1993 Network Computing Devices
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of NCD. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. NCD. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Dale Tonogai, Network Computing Devices
+ */
+
+#ifndef _ZLIB_H_
+#define _ZLIB_H_
+
+#define ZLIB_STRCOMP_OPT "XC-ZLIB"
+#define ZLIB_STRCOMP_OPT_LEN 7
+
+#define ZLIB_PACKET_HDRLEN 2
+#define ZLIB_MAX_DATALEN 0xfff
+#define ZLIB_MAX_PLAIN 270
+#define ZLIB_MAX_OUTLEN (ZLIB_MAX_PLAIN << 1)
+
+#define ZLIB_COMPRESS_FLAG 0x80
+#define ZLIB_DATALEN_MASK 0x0f
+
+#define ZLIB_PUT_PKTHDR(p, len, compflag) \
+ { \
+ (p)[0] = ((unsigned)(len)) >> 8 | ((compflag) ? ZLIB_COMPRESS_FLAG : 0);\
+ (p)[1] = (len) & 0xff; \
+ }
+
+#define ZLIB_GET_DATALEN(p) \
+ ((((unsigned)((p)[0] & ZLIB_DATALEN_MASK)) << 8) | (unsigned)(p)[1])
+
+#define ZLIB_COMPRESSED(p) ((p)[0] & ZLIB_COMPRESS_FLAG)
+
+struct ZlibInfo;
+
+extern void * ZlibInit ( int fd, int level );
+extern void ZlibFree ( struct ZlibInfo *comp );
+extern int ZlibFlush ( int fd );
+extern int ZlibStuffInput ( int fd, unsigned char *buffer, int buflen );
+extern void ZlibCompressOn ( int fd );
+extern void ZlibCompressOff ( int fd );
+extern int ZlibWrite ( int fd, unsigned char *buffer, int buflen );
+extern int ZlibWriteV ( int fd, struct iovec *iov, int iovcnt );
+extern int ZlibRead ( int fd, unsigned char *buffer, int buflen );
+extern int ZlibInputAvail ( int fd );
+
+
+#endif /* _ZLIB_H_ */
diff --git a/src/Makefile.am b/src/Makefile.am
index a38c303..3627acc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,7 @@
lib_LTLIBRARIES = liblbxutil.la
AM_CFLAGS = $(CWARNFLAGS) $(LBXUTIL_CFLAGS)
+INCLUDES = -I$(top_srcdir)/include
noinst_PROGRAMS = mkg3states
@@ -22,6 +23,15 @@ liblbxutil_la_SOURCES = \
$(srcdir)/image/lbxbwcodes.h \
$(srcdir)/delta/lbxdelta.c
+extensiondir=${includedir}/X11/extensions
+extension_HEADERS = \
+ $(top_srcdir)/include/X11/extensions/lbxbuf.h \
+ $(top_srcdir)/include/X11/extensions/lbxbufstr.h \
+ $(top_srcdir)/include/X11/extensions/lbxdeltastr.h \
+ $(top_srcdir)/include/X11/extensions/lbximage.h \
+ $(top_srcdir)/include/X11/extensions/lbxopts.h \
+ $(top_srcdir)/include/X11/extensions/lbxzlib.h
+
nodist_liblbxutil_la_SOURCES = g3states.h
liblbxutil_la_LIBADD = $(LBXUTIL_LIBS)
diff --git a/src/delta/lbxdelta.c b/src/delta/lbxdelta.c
index 78a1c74..abf26ef 100644
--- a/src/delta/lbxdelta.c
+++ b/src/delta/lbxdelta.c
@@ -29,7 +29,7 @@
#include <X11/X.h>
#include <X11/Xproto.h>
#define _XLBX_SERVER_
-#include <X11/extensions/lbxstr.h>
+#include <X11/extensions/lbxproto.h>
#include <X11/extensions/lbxdeltastr.h>
#include <stddef.h>