Initial revision

pull/1/head
dscho 24 years ago
commit 757fdc2454

BIN
.DS_Store vendored

Binary file not shown.

@ -0,0 +1,369 @@
main.o: main.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/alloca.h /usr/include/errno.h /usr/include/bits/errno.h \
/usr/include/linux/errno.h /usr/include/asm/errno.h \
/usr/include/sys/socket.h /usr/include/bits/socket.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/limits.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
/usr/include/netinet/in.h /usr/include/stdint.h \
/usr/include/bits/wordsize.h /usr/include/bits/in.h \
/usr/include/bits/byteswap.h /usr/include/unistd.h \
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
/usr/include/getopt.h /usr/include/signal.h \
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h rfb.h \
include/Xserver/scrnintstr.h include/Xserver/screenint.h \
include/Xserver/misc.h include/X11/Xosdefs.h include/X11/Xfuncproto.h \
include/X11/Xmd.h include/X11/X.h include/Xserver/os.h \
include/X11/Xalloca.h /usr/include/string.h include/X11/Xfuncs.h \
include/Xserver/miscstruct.h include/X11/Xprotostr.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/pixmap.h include/Xserver/gc.h include/X11/Xproto.h \
include/Xserver/colormap.h include/Xserver/window.h \
include/Xserver/cursor.h include/Xserver/validate.h \
include/Xserver/dix.h include/Xserver/input.h rfbproto.h \
libvncauth/vncauth.h
rfbserver.o: rfbserver.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/alloca.h /usr/include/unistd.h \
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
/usr/include/getopt.h /usr/include/pwd.h /usr/include/sys/socket.h \
/usr/include/bits/socket.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/limits.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
/usr/include/netinet/in.h /usr/include/stdint.h \
/usr/include/bits/wordsize.h /usr/include/bits/in.h \
/usr/include/bits/byteswap.h /usr/include/arpa/inet.h rfb.h \
include/Xserver/scrnintstr.h include/Xserver/screenint.h \
include/Xserver/misc.h include/X11/Xosdefs.h include/X11/Xfuncproto.h \
include/X11/Xmd.h include/X11/X.h include/Xserver/os.h \
include/X11/Xalloca.h /usr/include/string.h include/X11/Xfuncs.h \
include/Xserver/miscstruct.h include/X11/Xprotostr.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/pixmap.h include/Xserver/gc.h include/X11/Xproto.h \
include/Xserver/colormap.h include/Xserver/window.h \
include/Xserver/cursor.h include/Xserver/validate.h \
include/Xserver/dix.h include/Xserver/input.h rfbproto.h \
libvncauth/vncauth.h
miregion.o: miregion.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/alloca.h include/Xserver/miscstruct.h \
include/Xserver/misc.h include/X11/Xosdefs.h include/X11/Xfuncproto.h \
include/X11/Xmd.h include/X11/X.h include/Xserver/os.h \
include/X11/Xalloca.h /usr/include/string.h include/X11/Xfuncs.h \
include/X11/Xprotostr.h include/Xserver/regionstr.h \
include/Xserver/gc.h include/X11/Xproto.h include/Xserver/screenint.h \
include/Xserver/pixmap.h
auth.o: auth.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/alloca.h rfb.h include/Xserver/scrnintstr.h \
include/Xserver/screenint.h include/Xserver/misc.h \
include/X11/Xosdefs.h include/X11/Xfuncproto.h include/X11/Xmd.h \
include/X11/X.h include/Xserver/os.h include/X11/Xalloca.h \
/usr/include/string.h include/X11/Xfuncs.h \
include/Xserver/miscstruct.h include/X11/Xprotostr.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/pixmap.h include/Xserver/gc.h include/X11/Xproto.h \
include/Xserver/colormap.h include/Xserver/window.h \
include/Xserver/cursor.h include/Xserver/validate.h \
include/Xserver/dix.h include/Xserver/input.h rfbproto.h \
libvncauth/vncauth.h /usr/include/netinet/in.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/limits.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
/usr/include/asm/sockios.h /usr/include/bits/in.h \
/usr/include/bits/byteswap.h
sockets.o: sockets.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/sys/time.h \
/usr/include/bits/time.h /usr/include/sys/socket.h \
/usr/include/bits/socket.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/limits.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
/usr/include/netinet/in.h /usr/include/stdint.h \
/usr/include/bits/wordsize.h /usr/include/bits/in.h \
/usr/include/bits/byteswap.h /usr/include/netinet/tcp.h \
/usr/include/netdb.h /usr/include/rpc/netdb.h /usr/include/fcntl.h \
/usr/include/bits/fcntl.h /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/unistd.h \
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
/usr/include/getopt.h /usr/include/pthread.h /usr/include/sched.h \
/usr/include/bits/sched.h /usr/include/signal.h \
/usr/include/bits/pthreadtypes.h /usr/include/bits/sigthread.h rfb.h \
include/Xserver/scrnintstr.h include/Xserver/screenint.h \
include/Xserver/misc.h include/X11/Xosdefs.h include/X11/Xfuncproto.h \
include/X11/Xmd.h include/X11/X.h include/Xserver/os.h \
include/X11/Xalloca.h /usr/include/string.h include/X11/Xfuncs.h \
include/Xserver/miscstruct.h include/X11/Xprotostr.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/pixmap.h include/Xserver/gc.h include/X11/Xproto.h \
include/Xserver/colormap.h include/Xserver/window.h \
include/Xserver/cursor.h include/Xserver/validate.h \
include/Xserver/dix.h include/Xserver/input.h rfbproto.h \
libvncauth/vncauth.h
xalloc.o: xalloc.c include/X11/Xos.h include/X11/Xosdefs.h \
/usr/include/sys/types.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/include/bits/types.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/string.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/confname.h /usr/include/getopt.h \
/usr/include/sys/time.h /usr/include/bits/time.h /usr/include/stdio.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h include/Xserver/misc.h \
include/X11/Xfuncproto.h include/X11/Xmd.h include/X11/X.h \
include/Xserver/os.h include/X11/Xalloca.h include/X11/Xfuncs.h \
include/Xserver/input.h include/Xserver/screenint.h \
include/X11/Xproto.h include/X11/Xprotostr.h include/Xserver/window.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/miscstruct.h include/Xserver/opaque.h \
/usr/include/signal.h /usr/include/bits/signum.h \
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
/usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \
/usr/include/bits/sigstack.h /usr/include/sys/resource.h \
/usr/include/bits/resource.h /usr/include/sys/stat.h \
/usr/include/bits/stat.h /usr/include/ctype.h /usr/include/stdlib.h \
/usr/include/alloca.h
stats.o: stats.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/alloca.h rfb.h include/Xserver/scrnintstr.h \
include/Xserver/screenint.h include/Xserver/misc.h \
include/X11/Xosdefs.h include/X11/Xfuncproto.h include/X11/Xmd.h \
include/X11/X.h include/Xserver/os.h include/X11/Xalloca.h \
/usr/include/string.h include/X11/Xfuncs.h \
include/Xserver/miscstruct.h include/X11/Xprotostr.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/pixmap.h include/Xserver/gc.h include/X11/Xproto.h \
include/Xserver/colormap.h include/Xserver/window.h \
include/Xserver/cursor.h include/Xserver/validate.h \
include/Xserver/dix.h include/Xserver/input.h rfbproto.h \
libvncauth/vncauth.h /usr/include/netinet/in.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/limits.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
/usr/include/asm/sockios.h /usr/include/bits/in.h \
/usr/include/bits/byteswap.h
corre.o: corre.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/alloca.h rfb.h include/Xserver/scrnintstr.h \
include/Xserver/screenint.h include/Xserver/misc.h \
include/X11/Xosdefs.h include/X11/Xfuncproto.h include/X11/Xmd.h \
include/X11/X.h include/Xserver/os.h include/X11/Xalloca.h \
/usr/include/string.h include/X11/Xfuncs.h \
include/Xserver/miscstruct.h include/X11/Xprotostr.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/pixmap.h include/Xserver/gc.h include/X11/Xproto.h \
include/Xserver/colormap.h include/Xserver/window.h \
include/Xserver/cursor.h include/Xserver/validate.h \
include/Xserver/dix.h include/Xserver/input.h rfbproto.h \
libvncauth/vncauth.h /usr/include/netinet/in.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/limits.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
/usr/include/asm/sockios.h /usr/include/bits/in.h \
/usr/include/bits/byteswap.h
hextile.o: hextile.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h rfb.h \
include/Xserver/scrnintstr.h include/Xserver/screenint.h \
include/Xserver/misc.h include/X11/Xosdefs.h include/X11/Xfuncproto.h \
include/X11/Xmd.h include/X11/X.h include/Xserver/os.h \
include/X11/Xalloca.h /usr/include/string.h include/X11/Xfuncs.h \
include/Xserver/miscstruct.h include/X11/Xprotostr.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/pixmap.h include/Xserver/gc.h include/X11/Xproto.h \
include/Xserver/colormap.h include/Xserver/window.h \
include/Xserver/cursor.h include/Xserver/validate.h \
include/Xserver/dix.h include/Xserver/input.h rfbproto.h \
libvncauth/vncauth.h /usr/include/netinet/in.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/limits.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
/usr/include/bits/wordsize.h /usr/include/sys/types.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/bits/socket.h /usr/include/bits/sockaddr.h \
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
/usr/include/bits/in.h /usr/include/bits/byteswap.h
rre.o: rre.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h rfb.h \
include/Xserver/scrnintstr.h include/Xserver/screenint.h \
include/Xserver/misc.h include/X11/Xosdefs.h include/X11/Xfuncproto.h \
include/X11/Xmd.h include/X11/X.h include/Xserver/os.h \
include/X11/Xalloca.h /usr/include/string.h include/X11/Xfuncs.h \
include/Xserver/miscstruct.h include/X11/Xprotostr.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/pixmap.h include/Xserver/gc.h include/X11/Xproto.h \
include/Xserver/colormap.h include/Xserver/window.h \
include/Xserver/cursor.h include/Xserver/validate.h \
include/Xserver/dix.h include/Xserver/input.h rfbproto.h \
libvncauth/vncauth.h /usr/include/netinet/in.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/limits.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
/usr/include/bits/wordsize.h /usr/include/sys/types.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/bits/socket.h /usr/include/bits/sockaddr.h \
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
/usr/include/bits/in.h /usr/include/bits/byteswap.h
translate.o: translate.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/alloca.h rfb.h include/Xserver/scrnintstr.h \
include/Xserver/screenint.h include/Xserver/misc.h \
include/X11/Xosdefs.h include/X11/Xfuncproto.h include/X11/Xmd.h \
include/X11/X.h include/Xserver/os.h include/X11/Xalloca.h \
/usr/include/string.h include/X11/Xfuncs.h \
include/Xserver/miscstruct.h include/X11/Xprotostr.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/pixmap.h include/Xserver/gc.h include/X11/Xproto.h \
include/Xserver/colormap.h include/Xserver/window.h \
include/Xserver/cursor.h include/Xserver/validate.h \
include/Xserver/dix.h include/Xserver/input.h rfbproto.h \
libvncauth/vncauth.h /usr/include/netinet/in.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/limits.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
/usr/include/asm/sockios.h /usr/include/bits/in.h \
/usr/include/bits/byteswap.h tableinittctemplate.c \
tabletranstemplate.c
cutpaste.o: cutpaste.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stddef.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h rfb.h \
include/Xserver/scrnintstr.h include/Xserver/screenint.h \
include/Xserver/misc.h include/X11/Xosdefs.h include/X11/Xfuncproto.h \
include/X11/Xmd.h include/X11/X.h include/Xserver/os.h \
include/X11/Xalloca.h /usr/include/string.h include/X11/Xfuncs.h \
include/Xserver/miscstruct.h include/X11/Xprotostr.h \
include/Xserver/region.h include/Xserver/regionstr.h \
include/Xserver/pixmap.h include/Xserver/gc.h include/X11/Xproto.h \
include/Xserver/colormap.h include/Xserver/window.h \
include/Xserver/cursor.h include/Xserver/validate.h \
include/Xserver/dix.h include/Xserver/input.h rfbproto.h \
libvncauth/vncauth.h /usr/include/netinet/in.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/limits.h \
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
/usr/include/bits/wordsize.h /usr/include/sys/types.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/bits/socket.h /usr/include/bits/sockaddr.h \
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
/usr/include/bits/in.h /usr/include/bits/byteswap.h

@ -0,0 +1,21 @@
set args -desktop 'foobie bletch'
r
quit
where
info thread
info threads
thr 1
where
quit
quit
r
where
info threads
thr 2
where
f 31
kill
r
r
r
quit

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

@ -0,0 +1,63 @@
CC=gcc
CFLAGS=-g -Wall
#CFLAGS=-O2 -Wall
RANLIB=ranlib
INCLUDES=-I. -Ilibvncauth -Iinclude -Iinclude/X11 -Iinclude/Xserver
VNCAUTHLIB=-Llibvncauth -lvncauth
VNCSERVERLIB=-L. -lvncserver -lz -ljpeg
# These two lines enable useage of PThreads
CFLAGS += -DHAVE_PTHREADS
VNCSERVERLIB += -lpthread
LIBS=$(VNCSERVERLIB) $(VNCAUTHLIB)
# for Mac OS X
OSX_LIBS = -framework ApplicationServices -framework Carbon
# for Example
PTHREAD_LIBS = -lpthread
SOURCES=main.c rfbserver.c miregion.c auth.c sockets.c xalloc.c \
stats.c corre.c hextile.c rre.c translate.c cutpaste.c \
zlib.c tight.c
OBJS=main.o rfbserver.o miregion.o auth.o sockets.o xalloc.o \
stats.o corre.o hextile.o rre.o translate.o cutpaste.o \
zlib.o tight.o
all: example storepasswd
install_OSX: OSXvnc-server
cp OSXvnc-server storepasswd ../OSXvnc/build/OSXvnc.app/Contents/MacOS
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $<
libvncserver.a: $(OBJS)
$(AR) cru $@ $(OBJS)
$(RANLIB) $@
example: example.o libvncauth/libvncauth.a libvncserver.a
$(CC) -o example example.o $(LIBS) $(PTHREAD_LIBS)
OSXvnc-server: mac.o libvncauth/libvncauth.a libvncserver.a
$(CC) -o OSXvnc-server mac.o $(LIBS) $(OSX_LIBS)
storepasswd: storepasswd.o libvncauth/libvncauth.a
$(CC) -o storepasswd storepasswd.o $(VNCAUTHLIB)
libvncauth/libvncauth.a:
(cd libvncauth; make)
clean:
rm -f $(OBJS) *~ core "#"* *.bak *.orig storepasswd.o *.a example.o \
libvncauth/*.o libvncauth/*~ libvncauth/*.a
realclean: clean
rm -f OSXvnc-server storepasswd
depend:
$(CC) -M $(INCLUDES) $(SOURCES) >.depend
#include .depend

@ -0,0 +1,19 @@
OSXvnc: a VNC server for Mac OS X
Copyright (C) 2001 Dan McGuirk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.dfdf
For help with OSXvnc, please visit http://www.osxvnc.com/.

17
TODO

@ -0,0 +1,17 @@
.cutpaste
httpd
.other encodings
adapt rdp2vnc (rdesktop)
udp
rfbCloseClient, rfbConnect, ConnectToTcpAddr
CORBA
translate.c: warning about non 8-bit colourmaps
cursors

141
auth.c

@ -0,0 +1,141 @@
/*
* auth.c - deal with authentication.
*
* This file implements the VNC authentication protocol when setting up an RFB
* connection.
*/
/*
* OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.
* Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.
* All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include "rfb.h"
char *rfbAuthPasswdFile = NULL;
/*
* rfbAuthNewClient is called when we reach the point of authenticating
* a new client. If authentication isn't being used then we simply send
* rfbNoAuth. Otherwise we send rfbVncAuth plus the challenge.
*/
void
rfbAuthNewClient(cl)
rfbClientPtr cl;
{
char buf[4 + CHALLENGESIZE];
int len;
cl->state = RFB_AUTHENTICATION;
if (rfbAuthPasswdFile && !cl->reverseConnection) {
*(CARD32 *)buf = Swap32IfLE(rfbVncAuth);
vncRandomBytes(cl->authChallenge);
memcpy(&buf[4], (char *)cl->authChallenge, CHALLENGESIZE);
len = 4 + CHALLENGESIZE;
} else {
*(CARD32 *)buf = Swap32IfLE(rfbNoAuth);
len = 4;
cl->state = RFB_INITIALISATION;
}
if (WriteExact(cl, buf, len) < 0) {
rfbLogPerror("rfbAuthNewClient: write");
rfbCloseClient(cl);
return;
}
}
/*
* rfbAuthProcessClientMessage is called when the client sends its
* authentication response.
*/
void
rfbAuthProcessClientMessage(cl)
rfbClientPtr cl;
{
char *passwd;
int i, n;
CARD8 response[CHALLENGESIZE];
CARD32 authResult;
if ((n = ReadExact(cl, (char *)response, CHALLENGESIZE)) <= 0) {
if (n != 0)
rfbLogPerror("rfbAuthProcessClientMessage: read");
rfbCloseClient(cl);
return;
}
passwd = vncDecryptPasswdFromFile(rfbAuthPasswdFile);
if (passwd == NULL) {
rfbLog("rfbAuthProcessClientMessage: could not get password from %s\n",
rfbAuthPasswdFile);
authResult = Swap32IfLE(rfbVncAuthFailed);
if (WriteExact(cl, (char *)&authResult, 4) < 0) {
rfbLogPerror("rfbAuthProcessClientMessage: write");
}
rfbCloseClient(cl);
return;
}
vncEncryptBytes(cl->authChallenge, passwd);
/* Lose the password from memory */
for (i = strlen(passwd); i >= 0; i--) {
passwd[i] = '\0';
}
free((char *)passwd);
if (memcmp(cl->authChallenge, response, CHALLENGESIZE) != 0) {
rfbLog("rfbAuthProcessClientMessage: authentication failed from %s\n",
cl->host);
authResult = Swap32IfLE(rfbVncAuthFailed);
if (WriteExact(cl, (char *)&authResult, 4) < 0) {
rfbLogPerror("rfbAuthProcessClientMessage: write");
}
rfbCloseClient(cl);
return;
}
authResult = Swap32IfLE(rfbVncAuthOK);
if (WriteExact(cl, (char *)&authResult, 4) < 0) {
rfbLogPerror("rfbAuthProcessClientMessage: write");
rfbCloseClient(cl);
return;
}
cl->state = RFB_INITIALISATION;
}

@ -0,0 +1,355 @@
/*
* corre.c
*
* Routines to implement Compact Rise-and-Run-length Encoding (CoRRE). This
* code is based on krw's original javatel rfbserver.
*/
/*
* OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.
* Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.
* All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include "rfb.h"
/*
* rreBeforeBuf contains pixel data in the client's format.
* rreAfterBuf contains the RRE encoded version. If the RRE encoded version is
* larger than the raw data or if it exceeds rreAfterBufSize then
* raw encoding is used instead.
*/
static int rreBeforeBufSize = 0;
static char *rreBeforeBuf = NULL;
static int rreAfterBufSize = 0;
static char *rreAfterBuf = NULL;
static int rreAfterBufLen;
static int subrectEncode8(CARD8 *data, int w, int h);
static int subrectEncode16(CARD16 *data, int w, int h);
static int subrectEncode32(CARD32 *data, int w, int h);
static CARD32 getBgColour(char *data, int size, int bpp);
static Bool rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl, int x, int y,
int w, int h);
/*
* rfbSendRectEncodingCoRRE - send an arbitrary size rectangle using CoRRE
* encoding.
*/
Bool
rfbSendRectEncodingCoRRE(cl, x, y, w, h)
rfbClientPtr cl;
int x, y, w, h;
{
if (h > cl->correMaxHeight) {
rfbSendRectEncodingCoRRE(cl, x, y, w, cl->correMaxHeight );
rfbSendRectEncodingCoRRE(cl, x, y + cl->correMaxHeight, w,
h - cl->correMaxHeight);
return FALSE;
}
if (w > cl->correMaxWidth) {
rfbSendRectEncodingCoRRE(cl, x, y, cl->correMaxWidth, h);
rfbSendRectEncodingCoRRE(cl, x + cl->correMaxWidth, y,
w - cl->correMaxWidth, h);
return FALSE;
}
rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h);
return TRUE;
}
/*
* rfbSendSmallRectEncodingCoRRE - send a small (guaranteed < 256x256)
* rectangle using CoRRE encoding.
*/
static Bool
rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h)
rfbClientPtr cl;
int x, y, w, h;
{
rfbFramebufferUpdateRectHeader rect;
rfbRREHeader hdr;
int nSubrects;
int i;
char *fbptr = (cl->screen->frameBuffer + (cl->screen->paddedWidthInBytes * y)
+ (x * (cl->screen->bitsPerPixel / 8)));
int maxRawSize = (cl->screen->width * cl->screen->height
* (cl->format.bitsPerPixel / 8));
if (rreBeforeBufSize < maxRawSize) {
rreBeforeBufSize = maxRawSize;
if (rreBeforeBuf == NULL)
rreBeforeBuf = (char *)xalloc(rreBeforeBufSize);
else
rreBeforeBuf = (char *)xrealloc(rreBeforeBuf, rreBeforeBufSize);
}
if (rreAfterBufSize < maxRawSize) {
rreAfterBufSize = maxRawSize;
if (rreAfterBuf == NULL)
rreAfterBuf = (char *)xalloc(rreAfterBufSize);
else
rreAfterBuf = (char *)xrealloc(rreAfterBuf, rreAfterBufSize);
}
(*cl->translateFn)(cl->translateLookupTable,&(cl->screen->rfbServerFormat),
&cl->format, fbptr, rreBeforeBuf,
cl->screen->paddedWidthInBytes, w, h);
switch (cl->format.bitsPerPixel) {
case 8:
nSubrects = subrectEncode8((CARD8 *)rreBeforeBuf, w, h);
break;
case 16:
nSubrects = subrectEncode16((CARD16 *)rreBeforeBuf, w, h);
break;
case 32:
nSubrects = subrectEncode32((CARD32 *)rreBeforeBuf, w, h);
break;
default:
rfbLog("getBgColour: bpp %d?\n",cl->format.bitsPerPixel);
exit(1);
}
if (nSubrects < 0) {
/* RRE encoding was too large, use raw */
return rfbSendRectEncodingRaw(cl, x, y, w, h);
}
cl->rfbRectanglesSent[rfbEncodingCoRRE]++;
cl->rfbBytesSent[rfbEncodingCoRRE] += (sz_rfbFramebufferUpdateRectHeader
+ sz_rfbRREHeader + rreAfterBufLen);
if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader
> UPDATE_BUF_SIZE)
{
if (!rfbSendUpdateBuf(cl))
return FALSE;
}
rect.r.x = Swap16IfLE(x);
rect.r.y = Swap16IfLE(y);
rect.r.w = Swap16IfLE(w);
rect.r.h = Swap16IfLE(h);
rect.encoding = Swap32IfLE(rfbEncodingCoRRE);
memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
sz_rfbFramebufferUpdateRectHeader);
cl->ublen += sz_rfbFramebufferUpdateRectHeader;
hdr.nSubrects = Swap32IfLE(nSubrects);
memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbRREHeader);
cl->ublen += sz_rfbRREHeader;
for (i = 0; i < rreAfterBufLen;) {
int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
if (i + bytesToCopy > rreAfterBufLen) {
bytesToCopy = rreAfterBufLen - i;
}
memcpy(&cl->updateBuf[cl->ublen], &rreAfterBuf[i], bytesToCopy);
cl->ublen += bytesToCopy;
i += bytesToCopy;
if (cl->ublen == UPDATE_BUF_SIZE) {
if (!rfbSendUpdateBuf(cl))
return FALSE;
}
}
return TRUE;
}
/*
* subrectEncode() encodes the given multicoloured rectangle as a background
* colour overwritten by single-coloured rectangles. It returns the number
* of subrectangles in the encoded buffer, or -1 if subrect encoding won't
* fit in the buffer. It puts the encoded rectangles in rreAfterBuf. The
* single-colour rectangle partition is not optimal, but does find the biggest
* horizontal or vertical rectangle top-left anchored to each consecutive
* coordinate position.
*
* The coding scheme is simply [<bgcolour><subrect><subrect>...] where each
* <subrect> is [<colour><x><y><w><h>].
*/
#define DEFINE_SUBRECT_ENCODE(bpp) \
static int \
subrectEncode##bpp(data,w,h) \
CARD##bpp *data; \
int w; \
int h; \
{ \
CARD##bpp cl; \
rfbCoRRERectangle subrect; \
int x,y; \
int i,j; \
int hx=0,hy,vx=0,vy; \
int hyflag; \
CARD##bpp *seg; \
CARD##bpp *line; \
int hw,hh,vw,vh; \
int thex,they,thew,theh; \
int numsubs = 0; \
int newLen; \
CARD##bpp bg = (CARD##bpp)getBgColour((char*)data,w*h,bpp); \
\
*((CARD##bpp*)rreAfterBuf) = bg; \
\
rreAfterBufLen = (bpp/8); \
\
for (y=0; y<h; y++) { \
line = data+(y*w); \
for (x=0; x<w; x++) { \
if (line[x] != bg) { \
cl = line[x]; \
hy = y-1; \
hyflag = 1; \
for (j=y; j<h; j++) { \
seg = data+(j*w); \
if (seg[x] != cl) {break;} \
i = x; \
while ((seg[i] == cl) && (i < w)) i += 1; \
i -= 1; \
if (j == y) vx = hx = i; \
if (i < vx) vx = i; \
if ((hyflag > 0) && (i >= hx)) {hy += 1;} else {hyflag = 0;} \
} \
vy = j-1; \
\
/* We now have two possible subrects: (x,y,hx,hy) and (x,y,vx,vy) \
* We'll choose the bigger of the two. \
*/ \
hw = hx-x+1; \
hh = hy-y+1; \
vw = vx-x+1; \
vh = vy-y+1; \
\
thex = x; \
they = y; \
\
if ((hw*hh) > (vw*vh)) { \
thew = hw; \
theh = hh; \
} else { \
thew = vw; \
theh = vh; \
} \
\
subrect.x = thex; \
subrect.y = they; \
subrect.w = thew; \
subrect.h = theh; \
\
newLen = rreAfterBufLen + (bpp/8) + sz_rfbCoRRERectangle; \
if ((newLen > (w * h * (bpp/8))) || (newLen > rreAfterBufSize)) \
return -1; \
\
numsubs += 1; \
*((CARD##bpp*)(rreAfterBuf + rreAfterBufLen)) = cl; \
rreAfterBufLen += (bpp/8); \
memcpy(&rreAfterBuf[rreAfterBufLen],&subrect,sz_rfbCoRRERectangle); \
rreAfterBufLen += sz_rfbCoRRERectangle; \
\
/* \
* Now mark the subrect as done. \
*/ \
for (j=they; j < (they+theh); j++) { \
for (i=thex; i < (thex+thew); i++) { \
data[j*w+i] = bg; \
} \
} \
} \
} \
} \
\
return numsubs; \
}
DEFINE_SUBRECT_ENCODE(8)
DEFINE_SUBRECT_ENCODE(16)
DEFINE_SUBRECT_ENCODE(32)
/*
* getBgColour() gets the most prevalent colour in a byte array.
*/
static CARD32
getBgColour(data,size,bpp)
char *data;
int size;
int bpp;
{
#define NUMCLRS 256
static int counts[NUMCLRS];
int i,j,k;
int maxcount = 0;
CARD8 maxclr = 0;
if (bpp != 8) {
if (bpp == 16) {
return ((CARD16 *)data)[0];
} else if (bpp == 32) {
return ((CARD32 *)data)[0];
} else {
rfbLog("getBgColour: bpp %d?\n",bpp);
exit(1);
}
}
for (i=0; i<NUMCLRS; i++) {
counts[i] = 0;
}
for (j=0; j<size; j++) {
k = (int)(((CARD8 *)data)[j]);
if (k >= NUMCLRS) {
rfbLog("getBgColour: unusual colour = %d\n", k);
exit(1);
}
counts[k] += 1;
if (counts[k] > maxcount) {
maxcount = counts[k];
maxclr = ((CARD8 *)data)[j];
}
}
return maxclr;
}

@ -0,0 +1,39 @@
/*
* cutpaste.c - routines to deal with cut & paste buffers / selection.
*/
/*
* OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.
* Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.
* All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include "rfb.h"
/*
* rfbSetXCutText sets the cut buffer to be the given string. We also clear
* the primary selection. Ideally we'd like to set it to the same thing, but I
* can't work out how to do that without some kind of helper X client.
*/
void rfbGotXCutText(rfbScreenInfoPtr rfbScreen, char *str, int len)
{
rfbSendServerCutText(rfbScreen, str, len);
}

@ -0,0 +1,76 @@
/*
*
* This is an example of how to use libvncserver.
*
* libvncserver example
* Copyright (C) 2001 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include <netinet/in.h>
#ifdef __IRIX__
#include <netdb.h>
#endif
#define XK_MISCELLANY
#include "rfb.h"
#include "keysymdef.h"
const int maxx=640, maxy=480, bpp=4;
void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
{
if(buttonMask && x>=0 && y>=0 && x<maxx && y<maxy) {
int i;
for(i=0;i<bpp;i++)
cl->screen->frameBuffer[y*cl->screen->paddedWidthInBytes+x*bpp+i]^=0xff;
rfbMarkRectAsModified(cl->screen,x,y,x+1,y+1);
rfbGotXCutText(cl->screen,"Hallo",5);
}
}
void dokey(Bool down,KeySym key,rfbClientPtr cl)
{
if(down && key==XK_Escape)
rfbCloseClient(cl);
}
int main(int argc,char** argv)
{
int i,j;
rfbScreenInfoPtr rfbScreen = rfbDefaultScreenInit(argc,argv);
rfbScreen->desktopName="LibVNCServer Example";
rfbScreen->frameBuffer = (char*)malloc(maxx*maxy*bpp);
rfbScreen->width=maxx;
rfbScreen->height=maxy;
rfbScreen->paddedWidthInBytes=maxx*bpp;
rfbScreen->ptrAddEvent=doptr;
rfbScreen->kbdAddEvent=dokey;
for(i=0;i<maxx;++i)
for(j=0;j<maxy;++j) {
rfbScreen->frameBuffer[(j*maxx+i)*bpp]=i*256/maxx;
rfbScreen->frameBuffer[(j*maxx+i)*bpp+1]=j*256/maxy;
rfbScreen->frameBuffer[(j*maxx+i)*bpp+2]=(i+j)*256/(maxx*maxy);
}
runEventLoop(rfbScreen,40000,FALSE);
runEventLoop(rfbScreen,40000,TRUE);
while(1);
return(0);
}

1
go

@ -0,0 +1 @@
<EFBFBD><EFBFBD>#

@ -0,0 +1,347 @@
/*
* hextile.c
*
* Routines to implement Hextile Encoding
*/
/*
* OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.
* Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.
* All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include "rfb.h"
static Bool sendHextiles8(rfbClientPtr cl, int x, int y, int w, int h);
static Bool sendHextiles16(rfbClientPtr cl, int x, int y, int w, int h);
static Bool sendHextiles32(rfbClientPtr cl, int x, int y, int w, int h);
/*
* rfbSendRectEncodingHextile - send a rectangle using hextile encoding.
*/
Bool
rfbSendRectEncodingHextile(cl, x, y, w, h)
rfbClientPtr cl;
int x, y, w, h;
{
rfbFramebufferUpdateRectHeader rect;
if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {
if (!rfbSendUpdateBuf(cl))
return FALSE;
}
rect.r.x = Swap16IfLE(x);
rect.r.y = Swap16IfLE(y);
rect.r.w = Swap16IfLE(w);
rect.r.h = Swap16IfLE(h);
rect.encoding = Swap32IfLE(rfbEncodingHextile);
memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
sz_rfbFramebufferUpdateRectHeader);
cl->ublen += sz_rfbFramebufferUpdateRectHeader;
cl->rfbRectanglesSent[rfbEncodingHextile]++;
cl->rfbBytesSent[rfbEncodingHextile] += sz_rfbFramebufferUpdateRectHeader;
switch (cl->format.bitsPerPixel) {
case 8:
return sendHextiles8(cl, x, y, w, h);
case 16:
return sendHextiles16(cl, x, y, w, h);
case 32:
return sendHextiles32(cl, x, y, w, h);
}
rfbLog("rfbSendRectEncodingHextile: bpp %d?\n", cl->format.bitsPerPixel);
return FALSE;
}
#define PUT_PIXEL8(pix) (cl->updateBuf[cl->ublen++] = (pix))
#define PUT_PIXEL16(pix) (cl->updateBuf[cl->ublen++] = ((char*)&(pix))[0], \
cl->updateBuf[cl->ublen++] = ((char*)&(pix))[1])
#define PUT_PIXEL32(pix) (cl->updateBuf[cl->ublen++] = ((char*)&(pix))[0], \
cl->updateBuf[cl->ublen++] = ((char*)&(pix))[1], \
cl->updateBuf[cl->ublen++] = ((char*)&(pix))[2], \
cl->updateBuf[cl->ublen++] = ((char*)&(pix))[3])
#define DEFINE_SEND_HEXTILES(bpp) \
\
\
static Bool subrectEncode##bpp(rfbClientPtr cli, CARD##bpp *data, int w, int h, \
CARD##bpp bg, CARD##bpp fg, Bool mono); \
static void testColours##bpp(CARD##bpp *data, int size, Bool *mono, \
Bool *solid, CARD##bpp *bg, CARD##bpp *fg); \
\
\
/* \
* rfbSendHextiles \
*/ \
\
static Bool \
sendHextiles##bpp(cl, rx, ry, rw, rh) \
rfbClientPtr cl; \
int rx, ry, rw, rh; \
{ \
int x, y, w, h; \
int startUblen; \
char *fbptr; \
CARD##bpp bg = 0, fg = 0, newBg, newFg; \
Bool mono, solid; \
Bool validBg = FALSE; \
Bool validFg = FALSE; \
CARD##bpp clientPixelData[16*16*(bpp/8)]; \
\
for (y = ry; y < ry+rh; y += 16) { \
for (x = rx; x < rx+rw; x += 16) { \
w = h = 16; \
if (rx+rw - x < 16) \
w = rx+rw - x; \
if (ry+rh - y < 16) \
h = ry+rh - y; \
\
if ((cl->ublen + 1 + (2 + 16 * 16) * (bpp/8)) > \
UPDATE_BUF_SIZE) { \
if (!rfbSendUpdateBuf(cl)) \
return FALSE; \
} \
\
fbptr = (cl->screen->frameBuffer + (cl->screen->paddedWidthInBytes * y) \
+ (x * (cl->screen->bitsPerPixel / 8))); \
\
(*cl->translateFn)(cl->translateLookupTable, &(cl->screen->rfbServerFormat), \
&cl->format, fbptr, (char *)clientPixelData, \
cl->screen->paddedWidthInBytes, w, h); \
\
startUblen = cl->ublen; \
cl->updateBuf[startUblen] = 0; \
cl->ublen++; \
\
testColours##bpp(clientPixelData, w * h, \
&mono, &solid, &newBg, &newFg); \
\
if (!validBg || (newBg != bg)) { \
validBg = TRUE; \
bg = newBg; \
cl->updateBuf[startUblen] |= rfbHextileBackgroundSpecified; \
PUT_PIXEL##bpp(bg); \
} \
\
if (solid) { \
cl->rfbBytesSent[rfbEncodingHextile] += cl->ublen - startUblen; \
continue; \
} \
\
cl->updateBuf[startUblen] |= rfbHextileAnySubrects; \
\
if (mono) { \
if (!validFg || (newFg != fg)) { \
validFg = TRUE; \
fg = newFg; \
cl->updateBuf[startUblen] |= rfbHextileForegroundSpecified; \
PUT_PIXEL##bpp(fg); \
} \
} else { \
validFg = FALSE; \
cl->updateBuf[startUblen] |= rfbHextileSubrectsColoured; \
} \
\
if (!subrectEncode##bpp(cl, clientPixelData, w, h, bg, fg, mono)) { \
/* encoding was too large, use raw */ \
validBg = FALSE; \
validFg = FALSE; \
cl->ublen = startUblen; \
cl->updateBuf[cl->ublen++] = rfbHextileRaw; \
(*cl->translateFn)(cl->translateLookupTable, \
&(cl->screen->rfbServerFormat), &cl->format, fbptr, \
(char *)clientPixelData, \
cl->screen->paddedWidthInBytes, w, h); \
\
memcpy(&cl->updateBuf[cl->ublen], (char *)clientPixelData, \
w * h * (bpp/8)); \
\
cl->ublen += w * h * (bpp/8); \
} \
\
cl->rfbBytesSent[rfbEncodingHextile] += cl->ublen - startUblen; \
} \
} \
\
return TRUE; \
} \
\
\
static Bool \
subrectEncode##bpp(rfbClientPtr cl, CARD##bpp *data, int w, int h, \
CARD##bpp bg, CARD##bpp fg, Bool mono) \
{ \
CARD##bpp cl2; \
int x,y; \
int i,j; \
int hx=0,hy,vx=0,vy; \
int hyflag; \
CARD##bpp *seg; \
CARD##bpp *line; \
int hw,hh,vw,vh; \
int thex,they,thew,theh; \
int numsubs = 0; \
int newLen; \
int nSubrectsUblen; \
\
nSubrectsUblen = cl->ublen; \
cl->ublen++; \
\
for (y=0; y<h; y++) { \
line = data+(y*w); \
for (x=0; x<w; x++) { \
if (line[x] != bg) { \
cl2 = line[x]; \
hy = y-1; \
hyflag = 1; \
for (j=y; j<h; j++) { \
seg = data+(j*w); \
if (seg[x] != cl2) {break;} \
i = x; \
while ((seg[i] == cl2) && (i < w)) i += 1; \
i -= 1; \
if (j == y) vx = hx = i; \
if (i < vx) vx = i; \
if ((hyflag > 0) && (i >= hx)) { \
hy += 1; \
} else { \
hyflag = 0; \
} \
} \
vy = j-1; \
\
/* We now have two possible subrects: (x,y,hx,hy) and \
* (x,y,vx,vy). We'll choose the bigger of the two. \
*/ \
hw = hx-x+1; \
hh = hy-y+1; \
vw = vx-x+1; \
vh = vy-y+1; \
\
thex = x; \
they = y; \
\
if ((hw*hh) > (vw*vh)) { \
thew = hw; \
theh = hh; \
} else { \
thew = vw; \
theh = vh; \
} \
\
if (mono) { \
newLen = cl->ublen - nSubrectsUblen + 2; \
} else { \
newLen = cl->ublen - nSubrectsUblen + bpp/8 + 2; \
} \
\
if (newLen > (w * h * (bpp/8))) \
return FALSE; \
\
numsubs += 1; \
\
if (!mono) PUT_PIXEL##bpp(cl2); \
\
cl->updateBuf[cl->ublen++] = rfbHextilePackXY(thex,they); \
cl->updateBuf[cl->ublen++] = rfbHextilePackWH(thew,theh); \
\
/* \
* Now mark the subrect as done. \
*/ \
for (j=they; j < (they+theh); j++) { \
for (i=thex; i < (thex+thew); i++) { \
data[j*w+i] = bg; \
} \
} \
} \
} \
} \
\
cl->updateBuf[nSubrectsUblen] = numsubs; \
\
return TRUE; \
} \
\
\
/* \
* testColours() tests if there are one (solid), two (mono) or more \
* colours in a tile and gets a reasonable guess at the best background \
* pixel, and the foreground pixel for mono. \
*/ \
\
static void \
testColours##bpp(data,size,mono,solid,bg,fg) \
CARD##bpp *data; \
int size; \
Bool *mono; \
Bool *solid; \
CARD##bpp *bg; \
CARD##bpp *fg; \
{ \
CARD##bpp colour1 = 0, colour2 = 0; \
int n1 = 0, n2 = 0; \
*mono = TRUE; \
*solid = TRUE; \
\
for (; size > 0; size--, data++) { \
\
if (n1 == 0) \
colour1 = *data; \
\
if (*data == colour1) { \
n1++; \
continue; \
} \
\
if (n2 == 0) { \
*solid = FALSE; \
colour2 = *data; \
} \
\
if (*data == colour2) { \
n2++; \
continue; \
} \
\
*mono = FALSE; \
break; \
} \
\
if (n1 > n2) { \
*bg = colour1; \
*fg = colour2; \
} else { \
*bg = colour2; \
*fg = colour1; \
} \
}
DEFINE_SEND_HEXTILES(8)
DEFINE_SEND_HEXTILES(16)
DEFINE_SEND_HEXTILES(32)

@ -0,0 +1,693 @@
/*
* $XConsortium: X.h,v 1.69 94/04/17 20:10:48 dpw Exp $
*/
/* Definitions for the X window system likely to be used by applications */
#ifndef X_H
#define X_H
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
******************************************************************/
#define X_PROTOCOL 11 /* current protocol version */
#define X_PROTOCOL_REVISION 0 /* current minor version */
/* Resources */
/*
* _XSERVER64 must ONLY be defined when compiling X server sources on
* systems where unsigned long is not 32 bits, must NOT be used in
* client or library code.
*/
#ifndef _XSERVER64
typedef unsigned long XID;
typedef unsigned long Mask;
typedef unsigned long Atom;
typedef unsigned long VisualID;
typedef unsigned long Time;
#else
#include <X11/Xmd.h>
typedef CARD32 XID;
typedef CARD32 Mask;
typedef CARD32 Atom;
typedef CARD32 VisualID;
typedef CARD32 Time;
#endif
typedef XID Window;
typedef XID Drawable;
typedef XID Font;
typedef XID Pixmap;
typedef XID X11Cursor; /* conflict with CoreGraphics */
typedef XID Colormap;
typedef XID GContext;
typedef XID KeySym;
typedef unsigned char KeyCode;
/*****************************************************************
* RESERVED RESOURCE AND CONSTANT DEFINITIONS
*****************************************************************/
#define None 0L /* universal null resource or null atom */
#define ParentRelative 1L /* background pixmap in CreateWindow
and ChangeWindowAttributes */
#define CopyFromParent 0L /* border pixmap in CreateWindow
and ChangeWindowAttributes
special VisualID and special window
class passed to CreateWindow */
#define PointerWindow 0L /* destination window in SendEvent */
#define InputFocus 1L /* destination window in SendEvent */
#define PointerRoot 1L /* focus window in SetInputFocus */
#define AnyPropertyType 0L /* special Atom, passed to GetProperty */
#define AnyKey 0L /* special Key Code, passed to GrabKey */
#define AnyButton 0L /* special Button Code, passed to GrabButton */
#define AllTemporary 0L /* special Resource ID passed to KillClient */
#define CurrentTime 0L /* special Time */
#define NoSymbol 0L /* special KeySym */
/*****************************************************************
* EVENT DEFINITIONS
*****************************************************************/
/* Input Event Masks. Used as event-mask window attribute and as arguments
to Grab requests. Not to be confused with event names. */
#define NoEventMask 0L
#define KeyPressMask (1L<<0)
#define KeyReleaseMask (1L<<1)
#define ButtonPressMask (1L<<2)
#define ButtonReleaseMask (1L<<3)
#define EnterWindowMask (1L<<4)
#define LeaveWindowMask (1L<<5)
#define PointerMotionMask (1L<<6)
#define PointerMotionHintMask (1L<<7)
#define Button1MotionMask (1L<<8)
#define Button2MotionMask (1L<<9)
#define Button3MotionMask (1L<<10)
#define Button4MotionMask (1L<<11)
#define Button5MotionMask (1L<<12)
#define ButtonMotionMask (1L<<13)
#define KeymapStateMask (1L<<14)
#define ExposureMask (1L<<15)
#define VisibilityChangeMask (1L<<16)
#define StructureNotifyMask (1L<<17)
#define ResizeRedirectMask (1L<<18)
#define SubstructureNotifyMask (1L<<19)
#define SubstructureRedirectMask (1L<<20)
#define FocusChangeMask (1L<<21)
#define PropertyChangeMask (1L<<22)
#define ColormapChangeMask (1L<<23)
#define OwnerGrabButtonMask (1L<<24)
/* Event names. Used in "type" field in XEvent structures. Not to be
confused with event masks above. They start from 2 because 0 and 1
are reserved in the protocol for errors and replies. */
#define KeyPress 2
#define KeyRelease 3
#define ButtonPress 4
#define ButtonRelease 5
#define MotionNotify 6
#define EnterNotify 7
#define LeaveNotify 8
#define FocusIn 9
#define FocusOut 10
#define KeymapNotify 11
#define Expose 12
#define GraphicsExpose 13
#define NoExpose 14
#define VisibilityNotify 15
#define CreateNotify 16
#define DestroyNotify 17
#define UnmapNotify 18
#define MapNotify 19
#define MapRequest 20
#define ReparentNotify 21
#define ConfigureNotify 22
#define ConfigureRequest 23
#define GravityNotify 24
#define ResizeRequest 25
#define CirculateNotify 26
#define CirculateRequest 27
#define PropertyNotify 28
#define SelectionClear 29
#define SelectionRequest 30
#define SelectionNotify 31
#define ColormapNotify 32
#define ClientMessage 33
#define MappingNotify 34
#define LASTEvent 35 /* must be bigger than any event # */
/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
state in various key-, mouse-, and button-related events. */
#define ShiftMask (1<<0)
#define LockMask (1<<1)
#define ControlMask (1<<2)
#define Mod1Mask (1<<3)
#define Mod2Mask (1<<4)
#define Mod3Mask (1<<5)
#define Mod4Mask (1<<6)
#define Mod5Mask (1<<7)
/* modifier names. Used to build a SetModifierMapping request or
to read a GetModifierMapping request. These correspond to the
masks defined above. */
#define ShiftMapIndex 0
#define LockMapIndex 1
#define ControlMapIndex 2
#define Mod1MapIndex 3
#define Mod2MapIndex 4
#define Mod3MapIndex 5
#define Mod4MapIndex 6
#define Mod5MapIndex 7
/* button masks. Used in same manner as Key masks above. Not to be confused
with button names below. */
#define Button1Mask (1<<8)
#define Button2Mask (1<<9)
#define Button3Mask (1<<10)
#define Button4Mask (1<<11)
#define Button5Mask (1<<12)
#define AnyModifier (1<<15) /* used in GrabButton, GrabKey */
/* button names. Used as arguments to GrabButton and as detail in ButtonPress
and ButtonRelease events. Not to be confused with button masks above.
Note that 0 is already defined above as "AnyButton". */
#define Button1 1
#define Button2 2
#define Button3 3
#define Button4 4
#define Button5 5
/* Notify modes */
#define NotifyNormal 0
#define NotifyGrab 1
#define NotifyUngrab 2
#define NotifyWhileGrabbed 3
#define NotifyHint 1 /* for MotionNotify events */
/* Notify detail */
#define NotifyAncestor 0
#define NotifyVirtual 1
#define NotifyInferior 2
#define NotifyNonlinear 3
#define NotifyNonlinearVirtual 4
#define NotifyPointer 5
#define NotifyPointerRoot 6
#define NotifyDetailNone 7
/* Visibility notify */
#define VisibilityUnobscured 0
#define VisibilityPartiallyObscured 1
#define VisibilityFullyObscured 2
/* Circulation request */
#define PlaceOnTop 0
#define PlaceOnBottom 1
/* protocol families */
#define FamilyInternet 0
#define FamilyDECnet 1
#define FamilyChaos 2
/* Property notification */
#define PropertyNewValue 0
#define PropertyDelete 1
/* Color Map notification */
#define ColormapUninstalled 0
#define ColormapInstalled 1
/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
#define GrabModeSync 0
#define GrabModeAsync 1
/* GrabPointer, GrabKeyboard reply status */
#define GrabSuccess 0
#define AlreadyGrabbed 1
#define GrabInvalidTime 2
#define GrabNotViewable 3
#define GrabFrozen 4
/* AllowEvents modes */
#define AsyncPointer 0
#define SyncPointer 1
#define ReplayPointer 2
#define AsyncKeyboard 3
#define SyncKeyboard 4
#define ReplayKeyboard 5
#define AsyncBoth 6
#define SyncBoth 7
/* Used in SetInputFocus, GetInputFocus */
#define RevertToNone (int)None
#define RevertToPointerRoot (int)PointerRoot
#define RevertToParent 2
/*****************************************************************
* ERROR CODES
*****************************************************************/
#define Success 0 /* everything's okay */
#define BadRequest 1 /* bad request code */
#define BadValue 2 /* int parameter out of range */
#define BadWindow 3 /* parameter not a Window */
#define BadPixmap 4 /* parameter not a Pixmap */
#define BadAtom 5 /* parameter not an Atom */
#define BadCursor 6 /* parameter not a Cursor */
#define BadFont 7 /* parameter not a Font */
#define BadMatch 8 /* parameter mismatch */
#define BadDrawable 9 /* parameter not a Pixmap or Window */
#define BadAccess 10 /* depending on context:
- key/button already grabbed
- attempt to free an illegal
cmap entry
- attempt to store into a read-only
color map entry.
- attempt to modify the access control
list from other than the local host.
*/
#define BadAlloc 11 /* insufficient resources */
#define BadColor 12 /* no such colormap */
#define BadGC 13 /* parameter not a GC */
#define BadIDChoice 14 /* choice not in range or already used */
#define BadName 15 /* font or color name doesn't exist */
#define BadLength 16 /* Request length incorrect */
#define BadImplementation 17 /* server is defective */
#define FirstExtensionError 128
#define LastExtensionError 255
/*****************************************************************
* WINDOW DEFINITIONS
*****************************************************************/
/* Window classes used by CreateWindow */
/* Note that CopyFromParent is already defined as 0 above */
#define InputOutput 1
#define InputOnly 2
/* Window attributes for CreateWindow and ChangeWindowAttributes */
#define CWBackPixmap (1L<<0)
#define CWBackPixel (1L<<1)
#define CWBorderPixmap (1L<<2)
#define CWBorderPixel (1L<<3)
#define CWBitGravity (1L<<4)
#define CWWinGravity (1L<<5)
#define CWBackingStore (1L<<6)
#define CWBackingPlanes (1L<<7)
#define CWBackingPixel (1L<<8)
#define CWOverrideRedirect (1L<<9)
#define CWSaveUnder (1L<<10)
#define CWEventMask (1L<<11)
#define CWDontPropagate (1L<<12)
#define CWColormap (1L<<13)
#define CWCursor (1L<<14)
/* ConfigureWindow structure */
#define CWX (1<<0)
#define CWY (1<<1)
#define CWWidth (1<<2)
#define CWHeight (1<<3)
#define CWBorderWidth (1<<4)
#define CWSibling (1<<5)
#define CWStackMode (1<<6)
/* Bit Gravity */
#define ForgetGravity 0
#define NorthWestGravity 1
#define NorthGravity 2
#define NorthEastGravity 3
#define WestGravity 4
#define CenterGravity 5
#define EastGravity 6
#define SouthWestGravity 7
#define SouthGravity 8
#define SouthEastGravity 9
#define StaticGravity 10
/* Window gravity + bit gravity above */
#define UnmapGravity 0
/* Used in CreateWindow for backing-store hint */
#define NotUseful 0
#define WhenMapped 1
#define Always 2
/* Used in GetWindowAttributes reply */
#define IsUnmapped 0
#define IsUnviewable 1
#define IsViewable 2
/* Used in ChangeSaveSet */
#define SetModeInsert 0
#define SetModeDelete 1
/* Used in ChangeCloseDownMode */
#define DestroyAll 0
#define RetainPermanent 1
#define RetainTemporary 2
/* Window stacking method (in configureWindow) */
#define Above 0
#define Below 1
#define TopIf 2
#define BottomIf 3
#define Opposite 4
/* Circulation direction */
#define RaiseLowest 0
#define LowerHighest 1
/* Property modes */
#define PropModeReplace 0
#define PropModePrepend 1
#define PropModeAppend 2
/*****************************************************************
* GRAPHICS DEFINITIONS
*****************************************************************/
/* graphics functions, as in GC.alu */
#define GXclear 0x0 /* 0 */
#define GXand 0x1 /* src AND dst */
#define GXandReverse 0x2 /* src AND NOT dst */
#define GXcopy 0x3 /* src */
#define GXandInverted 0x4 /* NOT src AND dst */
#define GXnoop 0x5 /* dst */
#define GXxor 0x6 /* src XOR dst */
#define GXor 0x7 /* src OR dst */
#define GXnor 0x8 /* NOT src AND NOT dst */
#define GXequiv 0x9 /* NOT src XOR dst */
#define GXinvert 0xa /* NOT dst */
#define GXorReverse 0xb /* src OR NOT dst */
#define GXcopyInverted 0xc /* NOT src */
#define GXorInverted 0xd /* NOT src OR dst */
#define GXnand 0xe /* NOT src OR NOT dst */
#define GXset 0xf /* 1 */
/* LineStyle */
#define LineSolid 0
#define LineOnOffDash 1
#define LineDoubleDash 2
/* capStyle */
#define CapNotLast 0
#define CapButt 1
#define CapRound 2
#define CapProjecting 3
/* joinStyle */
#define JoinMiter 0
#define JoinRound 1
#define JoinBevel 2
/* fillStyle */
#define FillSolid 0
#define FillTiled 1
#define FillStippled 2
#define FillOpaqueStippled 3
/* fillRule */
#define EvenOddRule 0
#define WindingRule 1
/* subwindow mode */
#define ClipByChildren 0
#define IncludeInferiors 1
/* SetClipRectangles ordering */
#define Unsorted 0
#define YSorted 1
#define YXSorted 2
#define YXBanded 3
/* CoordinateMode for drawing routines */
#define CoordModeOrigin 0 /* relative to the origin */
#define CoordModePrevious 1 /* relative to previous point */
/* Polygon shapes */
#define Complex 0 /* paths may intersect */
#define Nonconvex 1 /* no paths intersect, but not convex */
#define Convex 2 /* wholly convex */
/* Arc modes for PolyFillArc */
#define ArcChord 0 /* join endpoints of arc */
#define ArcPieSlice 1 /* join endpoints to center of arc */
/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
GC.stateChanges */
#define GCFunction (1L<<0)
#define GCPlaneMask (1L<<1)
#define GCForeground (1L<<2)
#define GCBackground (1L<<3)
#define GCLineWidth (1L<<4)
#define GCLineStyle (1L<<5)
#define GCCapStyle (1L<<6)
#define GCJoinStyle (1L<<7)
#define GCFillStyle (1L<<8)
#define GCFillRule (1L<<9)
#define GCTile (1L<<10)
#define GCStipple (1L<<11)
#define GCTileStipXOrigin (1L<<12)
#define GCTileStipYOrigin (1L<<13)
#define GCFont (1L<<14)
#define GCSubwindowMode (1L<<15)
#define GCGraphicsExposures (1L<<16)
#define GCClipXOrigin (1L<<17)
#define GCClipYOrigin (1L<<18)
#define GCClipMask (1L<<19)
#define GCDashOffset (1L<<20)
#define GCDashList (1L<<21)
#define GCArcMode (1L<<22)
#define GCLastBit 22
/*****************************************************************
* FONTS
*****************************************************************/
/* used in QueryFont -- draw direction */
#define FontLeftToRight 0
#define FontRightToLeft 1
#define FontChange 255
/*****************************************************************
* IMAGING
*****************************************************************/
/* ImageFormat -- PutImage, GetImage */
#define XYBitmap 0 /* depth 1, XYFormat */
#define XYPixmap 1 /* depth == drawable depth */
#define ZPixmap 2 /* depth == drawable depth */
/*****************************************************************
* COLOR MAP STUFF
*****************************************************************/
/* For CreateColormap */
#define AllocNone 0 /* create map with no entries */
#define AllocAll 1 /* allocate entire map writeable */
/* Flags used in StoreNamedColor, StoreColors */
#define DoRed (1<<0)
#define DoGreen (1<<1)
#define DoBlue (1<<2)
/*****************************************************************
* CURSOR STUFF
*****************************************************************/
/* QueryBestSize Class */
#define CursorShape 0 /* largest size that can be displayed */
#define TileShape 1 /* size tiled fastest */
#define StippleShape 2 /* size stippled fastest */
/*****************************************************************
* KEYBOARD/POINTER STUFF
*****************************************************************/
#define AutoRepeatModeOff 0
#define AutoRepeatModeOn 1
#define AutoRepeatModeDefault 2
#define LedModeOff 0
#define LedModeOn 1
/* masks for ChangeKeyboardControl */
#define KBKeyClickPercent (1L<<0)
#define KBBellPercent (1L<<1)
#define KBBellPitch (1L<<2)
#define KBBellDuration (1L<<3)
#define KBLed (1L<<4)
#define KBLedMode (1L<<5)
#define KBKey (1L<<6)
#define KBAutoRepeatMode (1L<<7)
#define MappingSuccess 0
#define MappingBusy 1
#define MappingFailed 2
#define MappingModifier 0
#define MappingKeyboard 1
#define MappingPointer 2
/*****************************************************************
* SCREEN SAVER STUFF
*****************************************************************/
#define DontPreferBlanking 0
#define PreferBlanking 1
#define DefaultBlanking 2
#define DisableScreenSaver 0
#define DisableScreenInterval 0
#define DontAllowExposures 0
#define AllowExposures 1
#define DefaultExposures 2
/* for ForceScreenSaver */
#define ScreenSaverReset 0
#define ScreenSaverActive 1
/*****************************************************************
* HOSTS AND CONNECTIONS
*****************************************************************/
/* for ChangeHosts */
#define HostInsert 0
#define HostDelete 1
/* for ChangeAccessControl */
#define EnableAccess 1
#define DisableAccess 0
/* Display classes used in opening the connection
* Note that the statically allocated ones are even numbered and the
* dynamically changeable ones are odd numbered */
#define StaticGray 0
#define GrayScale 1
#define StaticColor 2
#define PseudoColor 3
#define TrueColor 4
#define DirectColor 5
/* Byte order used in imageByteOrder and bitmapBitOrder */
#define LSBFirst 0
#define MSBFirst 1
#endif /* X_H */

@ -0,0 +1,137 @@
/* $XConsortium: Xalloca.h /main/6 1996/09/28 16:17:22 rws $ */
/*
Copyright (c) 1995 X Consortium
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
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 X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
/*
* The purpose of this header is to define the macros ALLOCATE_LOCAL and
* DEALLOCATE_LOCAL appropriately for the platform being compiled on.
* These macros are used to make fast, function-local memory allocations.
* Their characteristics are as follows:
*
* void *ALLOCATE_LOCAL(int size)
* Returns a pointer to size bytes of memory, or NULL if the allocation
* failed. The memory must be freed with DEALLOCATE_LOCAL before the
* function that made the allocation returns. You should not ask for
* large blocks of memory with this function, since on many platforms
* the memory comes from the stack, which may have limited size.
*
* void DEALLOCATE_LOCAL(void *)
* Frees the memory allocated by ALLOCATE_LOCAL. Omission of this
* step may be harmless on some platforms, but will result in
* memory leaks or worse on others.
*
* Before including this file, you should define two macros,
* ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK, that have the
* same characteristics as ALLOCATE_LOCAL and DEALLOCATE_LOCAL. The
* header uses the fallbacks if it doesn't know a "better" way to define
* ALLOCATE_LOCAL and DEALLOCATE_LOCAL. Typical usage would be:
*
* #define ALLOCATE_LOCAL_FALLBACK(_size) malloc(_size)
* #define DEALLOCATE_LOCAL_FALLBACK(_ptr) free(_ptr)
* #include "Xalloca.h"
*/
#ifndef XALLOCA_H
#define XALLOCA_H 1
#ifdef INCLUDE_ALLOCA_H
# include <alloca.h>
#endif
#ifndef NO_ALLOCA
/*
* os-dependent definition of local allocation and deallocation
* If you want something other than (DE)ALLOCATE_LOCAL_FALLBACK
* for ALLOCATE/DEALLOCATE_LOCAL then you add that in here.
*/
# if defined(__HIGHC__)
# ifndef NCR
extern char *alloca();
# if HCVERSION < 21003
# define ALLOCATE_LOCAL(size) alloca((int)(size))
pragma on(alloca);
# else /* HCVERSION >= 21003 */
# define ALLOCATE_LOCAL(size) _Alloca((int)(size))
# endif /* HCVERSION < 21003 */
# else /* NCR */
# define ALLOCATE_LOCAL(size) alloca(size)
# endif
# define DEALLOCATE_LOCAL(ptr) /* as nothing */
# endif /* defined(__HIGHC__) */
# ifdef __GNUC__
# ifndef alloca
# define alloca __builtin_alloca
# endif /* !alloca */
# define ALLOCATE_LOCAL(size) alloca((int)(size))
# define DEALLOCATE_LOCAL(ptr) /* as nothing */
# else /* ! __GNUC__ */
/*
* warning: old mips alloca (pre 2.10) is unusable, new one is built in
* Test is easy, the new one is named __builtin_alloca and comes
* from alloca.h which #defines alloca.
*/
# ifndef NCR
# if defined(vax) || defined(sun) || defined(apollo) || defined(stellar) || defined(USL) || defined(alloca)
/*
* Some System V boxes extract alloca.o from /lib/libPW.a; if you
* decide that you don't want to use alloca, you might want to fix it here.
*/
/* alloca might be a macro taking one arg (hi, Sun!), so give it one. */
# ifndef __sgi /* IRIX 5/6 has definition */
# define __Xnullarg /* as nothing */
# ifndef X_NOT_STDC_ENV
extern void *alloca(__Xnullarg);
# else
extern char *alloca(__Xnullarg);
# endif
# endif /* __sgi */
# define ALLOCATE_LOCAL(size) alloca((int)(size))
# define DEALLOCATE_LOCAL(ptr) /* as nothing */
# endif /* who does alloca */
# endif /* NCR */
# endif /* __GNUC__ */
#endif /* NO_ALLOCA */
#if !defined(ALLOCATE_LOCAL)
# if defined(ALLOCATE_LOCAL_FALLBACK) && defined(DEALLOCATE_LOCAL_FALLBACK)
# define ALLOCATE_LOCAL(_size) ALLOCATE_LOCAL_FALLBACK(_size)
# define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK(_ptr)
# else /* no fallbacks supplied; error */
# define ALLOCATE_LOCAL(_size) ALLOCATE_LOCAL_FALLBACK undefined!
# define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK undefined!
# endif /* defined(ALLOCATE_LOCAL_FALLBACK && DEALLOCATE_LOCAL_FALLBACK) */
#endif /* !defined(ALLOCATE_LOCAL) */
#endif /* XALLOCA_H */

@ -0,0 +1,88 @@
/* $XConsortium: Xfuncproto.h,v 1.9 95/06/08 23:20:39 gildea Exp $ */
/*
*
Copyright (c) 1989, 1991 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
*
*/
/* Definitions to make function prototypes manageable */
#ifndef _XFUNCPROTO_H_
#define _XFUNCPROTO_H_
#ifndef NeedFunctionPrototypes
#if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
#define NeedFunctionPrototypes 1
#else
#define NeedFunctionPrototypes 0
#endif
#endif /* NeedFunctionPrototypes */
#ifndef NeedVarargsPrototypes
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&2)
#define NeedVarargsPrototypes 1
#else
#define NeedVarargsPrototypes 0
#endif
#endif /* NeedVarargsPrototypes */
#if NeedFunctionPrototypes
#ifndef NeedNestedPrototypes
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&8)
#define NeedNestedPrototypes 1
#else
#define NeedNestedPrototypes 0
#endif
#endif /* NeedNestedPrototypes */
#ifndef _Xconst
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
#define _Xconst const
#else
#define _Xconst
#endif
#endif /* _Xconst */
#ifndef NeedWidePrototypes
#ifdef NARROWPROTO
#define NeedWidePrototypes 0
#else
#define NeedWidePrototypes 1 /* default to make interropt. easier */
#endif
#endif /* NeedWidePrototypes */
#endif /* NeedFunctionPrototypes */
#ifndef _XFUNCPROTOBEGIN
#ifdef __cplusplus /* for C++ V2.0 */
#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
#define _XFUNCPROTOEND }
#else
#define _XFUNCPROTOBEGIN
#define _XFUNCPROTOEND
#endif
#endif /* _XFUNCPROTOBEGIN */
#endif /* _XFUNCPROTO_H_ */

@ -0,0 +1,98 @@
/*
* $XConsortium: Xfuncs.h,v 1.16 94/12/01 16:25:53 kaleb Exp $
* $XFree86: xc/include/Xfuncs.h,v 3.2 1995/01/28 15:42:03 dawes Exp $
*
*
Copyright (c) 1990 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
*
*/
#ifndef _XFUNCS_H_
#define _XFUNCS_H_
#include <X11/Xosdefs.h>
/* the old Xfuncs.h, for pre-R6 */
#ifdef X_USEBFUNCS
void bcopy();
void bzero();
int bcmp();
#else
#if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) && !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) || defined(_IBMR2) || defined(_SEQUENT_)
#include <string.h>
#define _XFUNCS_H_INCLUDED_STRING_H
#define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
#define bzero(b,len) memset(b, 0, (size_t)(len))
#define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
#else
#ifdef sgi
#include <bstring.h>
#else
#ifdef SYSV
#include <memory.h>
void bcopy();
#define bzero(b,len) memset(b, 0, len)
#define bcmp(b1,b2,len) memcmp(b1, b2, len)
#else
#ifdef __EMX__
#include <strings.h>
#define _XFUNCS_H_INCLUDED_STRING_H
/* bcopy, bcmp, bzero declared */
#else /* bsd */
void bcopy();
void bzero();
int bcmp();
#endif
#endif /* SYSV */
#endif /* sgi */
#endif /* __STDC__ and relatives */
#endif /* X_USEBFUNCS */
/* the new Xfuncs.h */
#if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
/* the ANSI C way */
#ifndef _XFUNCS_H_INCLUDED_STRING_H
#include <string.h>
#endif
#undef bzero
#define bzero(b,len) memset(b,0,len)
#else /* else X_NOT_STDC_ENV or SunOS 4 */
#if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
#include <memory.h>
#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
#if defined(SYSV) && defined(_XBCOPYFUNC)
#undef memmove
#define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))
#define _XNEEDBCOPYFUNC
#endif
#else /* else vanilla BSD */
#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
#define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
#define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))
#endif /* SYSV else */
#endif /* ! X_NOT_STDC_ENV else */
#endif /* _XFUNCS_H_ */

@ -0,0 +1,206 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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 XMD_H
#define XMD_H 1
/* $XConsortium: Xmd.h,v 1.49 95/06/08 23:20:39 gildea Exp $ */
/* $XFree86: xc/include/Xmd.h,v 3.4 1996/12/31 04:15:20 dawes Exp $ */
/*
* Xmd.h: MACHINE DEPENDENT DECLARATIONS.
*/
/*
* Special per-machine configuration flags.
*/
#ifdef CRAY
#define WORD64 /* 64-bit architecture */
#endif
#if defined(__alpha) || defined(__alpha__)
#define LONG64 /* 32/64-bit architecture */
#endif
#ifdef __sgi
#if (_MIPS_SZLONG == 64)
#define LONG64
#endif
#endif
/*
* Stuff to handle large architecture machines; the constants were generated
* on a 32-bit machine and must coorespond to the protocol.
*/
#ifdef WORD64
#define MUSTCOPY
#endif /* WORD64 */
/*
* Definition of macro used to set constants for size of network structures;
* machines with preprocessors that can't handle all of the sz_ symbols
* can define this macro to be sizeof(x) if and only if their compiler doesn't
* pad out structures (esp. the xTextElt structure which contains only two
* one-byte fields). Network structures should always define sz_symbols.
*
* The sz_ prefix is used instead of something more descriptive so that the
* symbols are no more than 32 characters long (which causes problems for some
* compilers and preprocessors).
*
* The extra indirection in the __STDC__ case is to get macro arguments to
* expand correctly before the concatenation, rather than afterward.
*/
#if ((defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)) && !defined(UNIXCPP)) || defined(ANSICPP)
#define _SIZEOF(x) sz_##x
#define SIZEOF(x) _SIZEOF(x)
#else
#define SIZEOF(x) sz_/**/x
#endif /* if ANSI C compiler else not */
/*
* Bitfield suffixes for the protocol structure elements, if you
* need them. Note that bitfields are not guarranteed to be signed
* (or even unsigned) according to ANSI C.
*/
#ifdef WORD64
typedef long INT64;
typedef unsigned long CARD64;
#define B32 :32
#define B16 :16
#ifdef UNSIGNEDBITFIELDS
typedef unsigned int INT32;
typedef unsigned int INT16;
#else
#ifdef __STDC__
typedef signed int INT32;
typedef signed int INT16;
#else
typedef int INT32;
typedef int INT16;
#endif
#endif
#else
#define B32
#define B16
#ifdef LONG64
typedef long INT64;
typedef int INT32;
#else
typedef long INT32;
#endif
typedef short INT16;
#endif
#if defined(__STDC__) || defined(sgi) || defined(AIXV3)
typedef signed char INT8;
#else
typedef char INT8;
#endif
#ifdef LONG64
typedef unsigned long CARD64;
typedef unsigned int CARD32;
#else
typedef unsigned long CARD32;
#endif
typedef unsigned short CARD16;
typedef unsigned char CARD8;
typedef CARD32 BITS32;
typedef CARD16 BITS16;
#ifndef __EMX__
typedef CARD8 BYTE;
typedef CARD8 BOOL;
#else
/*
* This is bad style, but the central include file <os2.h> declares them
* as well
*/
#define BYTE CARD8
#define BOOL CARD8
#endif
/*
* definitions for sign-extending bitfields on 64-bit architectures
*/
#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
#define cvtINT8toInt(val) (((val) & 0x00000080) ? ((val) | 0xffffffffffffff00) : (val))
#define cvtINT16toInt(val) (((val) & 0x00008000) ? ((val) | 0xffffffffffff0000) : (val))
#define cvtINT32toInt(val) (((val) & 0x80000000) ? ((val) | 0xffffffff00000000) : (val))
#define cvtINT8toShort(val) cvtINT8toInt(val)
#define cvtINT16toShort(val) cvtINT16toInt(val)
#define cvtINT32toShort(val) cvtINT32toInt(val)
#define cvtINT8toLong(val) cvtINT8toInt(val)
#define cvtINT16toLong(val) cvtINT16toInt(val)
#define cvtINT32toLong(val) cvtINT32toInt(val)
#else
#define cvtINT8toInt(val) (val)
#define cvtINT16toInt(val) (val)
#define cvtINT32toInt(val) (val)
#define cvtINT8toShort(val) (val)
#define cvtINT16toShort(val) (val)
#define cvtINT32toShort(val) (val)
#define cvtINT8toLong(val) (val)
#define cvtINT16toLong(val) (val)
#define cvtINT32toLong(val) (val)
#endif /* WORD64 and UNSIGNEDBITFIELDS */
#ifdef MUSTCOPY
/*
* This macro must not cast or else pointers will get aligned and be wrong
*/
#define NEXTPTR(p,t) (((char *) p) + SIZEOF(t))
#else /* else not MUSTCOPY, this is used for 32-bit machines */
/*
* this version should leave result of type (t *), but that should only be
* used when not in MUSTCOPY
*/
#define NEXTPTR(p,t) (((t *)(p)) + 1)
#endif /* MUSTCOPY - used machines whose C structs don't line up with proto */
#endif /* XMD_H */

@ -0,0 +1,317 @@
/*
* $XConsortium: Xos.h /main/70 1996/11/15 16:00:41 kaleb $
* $XFree86: xc/include/Xos.h,v 3.21.2.1 1998/01/23 12:35:11 dawes Exp $
*
*
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
*
* The X Window System is a Trademark of X Consortium.
*
*/
/* This is a collection of things to try and minimize system dependencies
* in a "signficant" number of source files.
*/
#ifndef _XOS_H_
#define _XOS_H_
#include <X11/Xosdefs.h>
/*
* Get major data types (esp. caddr_t)
*/
#ifdef USG
#ifndef __TYPES__
#ifdef CRAY
#define word word_t
#endif /* CRAY */
#include <sys/types.h> /* forgot to protect it... */
#define __TYPES__
#endif /* __TYPES__ */
#else /* USG */
#if defined(_POSIX_SOURCE) && (defined(MOTOROLA) || defined(AMOEBA))
#undef _POSIX_SOURCE
#include <sys/types.h>
#define _POSIX_SOURCE
#else
#include <sys/types.h>
#endif
#endif /* USG */
/*
* Just about everyone needs the strings routines. We provide both forms here,
* index/rindex and strchr/strrchr, so any systems that don't provide them all
* need to have #defines here.
*
* NOTE: The following ISN'T true for this XFree86 version of this file.
*
* These macros are defined this way, rather than, e.g.:
* #defined index(s,c) strchr(s,c)
* because someone might be using them as function pointers, and such
* a change would break compatibility for anyone who's relying on them
* being the way they currently are. So we're stuck with them this way,
* which can be really inconvenient. :-(
*/
#ifndef X_NOT_STDC_ENV
#include <string.h>
#ifdef __STDC__
#ifndef index
#define index(s,c) (strchr((s),(c)))
#endif
#ifndef rindex
#define rindex(s,c) (strrchr((s),(c)))
#endif
#else
#ifndef index
#define index strchr
#endif
#ifndef rindex
#define rindex strrchr
#endif
#endif
#else
#ifdef SYSV
#if defined(clipper) || defined(__clipper__)
#include <malloc.h>
#endif
#include <string.h>
#define index strchr
#define rindex strrchr
#else
#include <strings.h>
#define strchr index
#define strrchr rindex
#endif
#endif /* X_NOT_STDC_ENV */
/*
* strerror()
*/
#if (defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4)) || defined(macII)) && !defined(__GLIBC__)
#ifndef strerror
extern char *sys_errlist[];
extern int sys_nerr;
#define strerror(n) \
(((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error")
#endif
#endif
/*
* Get open(2) constants
*/
#ifdef X_NOT_POSIX
#include <fcntl.h>
#if defined(USL) || defined(CRAY) || defined(MOTOROLA) || (defined(i386) && (defined(SYSV) || defined(SVR4))) || defined(__sxg__)
#include <unistd.h>
#endif
#ifdef WIN32
#include <X11/Xw32defs.h>
#else
#include <sys/file.h>
#endif
#else /* X_NOT_POSIX */
#if !defined(_POSIX_SOURCE) && defined(macII)
#define _POSIX_SOURCE
#include <fcntl.h>
#include <unistd.h>
#undef _POSIX_SOURCE
#else
#include <fcntl.h>
#include <unistd.h>
#endif
#endif /* X_NOT_POSIX else */
#ifdef CSRG_BASED
#include <stdlib.h>
#include <unistd.h>
#endif /* CSRG_BASED */
/*
* Get struct timeval
*/
#ifdef SYSV
#ifndef USL
#include <sys/time.h>
#endif
#include <time.h>
#ifdef CRAY
#undef word
#endif /* CRAY */
#if defined(USG) && !defined(CRAY) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__) && !defined(clipper) && !defined(__clipper__)
struct timeval {
long tv_sec;
long tv_usec;
};
#ifndef USL_SHARELIB
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
#endif /* USL_SHARELIB */
#endif /* USG */
#ifdef _SEQUENT_
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
#endif /* _SEQUENT_ */
#else /* not SYSV */
#if defined(_ANSI_SOURCE) && defined(__bsdi__)
#undef _ANSI_SOURCE
#include <sys/time.h>
#define _ANSI_SOURCE
#endif
#if defined(_POSIX_SOURCE) && defined(SVR4)
/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
#undef _POSIX_SOURCE
#include <sys/time.h>
#define _POSIX_SOURCE
#else /* defined(_POSIX_SOURCE) && defined(SVR4) */
#ifdef WIN32
#include <time.h>
#if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_)
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
#endif
#include <sys/timeb.h>
#define gettimeofday(t) \
{ \
struct _timeb _gtodtmp; \
_ftime (&_gtodtmp); \
(t)->tv_sec = _gtodtmp.time; \
(t)->tv_usec = _gtodtmp.millitm * 1000; \
}
#else /* WIN32 */
#ifdef _SEQUENT_
#include <time.h>
#else /* _SEQUENT_ */
#ifdef AMOEBA
#include <time.h>
#include <sys/time.h>
#else /* AMOEBA */
#ifdef MINIX
#include <time.h>
#else /* !MINIX */
#ifndef Lynx
#include <sys/time.h>
#else
#include <time.h>
#endif /* Lynx */
#endif /* MINIX */
#endif /* AMOEBA */
#endif /* _SEQUENT_ */
#endif /* WIN32 else */
#endif /* defined(_POSIX_SOURCE) && defined(SVR4) */
#endif /* SYSV */
/* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
#if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */
#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
#else
#if defined(SVR4) || defined(VMS) || defined(WIN32)
#define X_GETTIMEOFDAY(t) gettimeofday(t)
#else
#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
#endif
#endif /* XPG4 else */
#ifdef MINIX
#include <errno.h>
#include <net/gen/in.h>
#include <net/gen/socket.h>
#include <net/gen/udp.h>
#include <net/gen/udp_hdr.h>
struct sockaddr
{
u16_t sa_family;
char sa_data[14];
};
struct sockaddr_in
{
u16_t sin_family;
u16_t sin_port;
struct
{
ipaddr_t s_addr;
} sin_addr;
char sin_zero[8];
};
struct in_addr
{
ipaddr_t s_addr;
};
typedef char *caddr_t;
typedef unsigned char u_char;
#endif /* MINIX */
#ifdef __EMX__
typedef unsigned long fd_mask;
#endif
/* use POSIX name for signal */
#if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD) && !defined(ISC)
#define SIGCHLD SIGCLD
#endif
#ifdef ISC
#include <sys/bsdtypes.h>
#include <sys/limits.h>
#define NGROUPS 16
#endif
#if defined(ISC) || defined(__EMX__)
/*
* Some OS's may not have this
*/
#define X_NO_SYS_UN 1
struct sockaddr_un {
short sun_family;
char sun_path[108];
};
#endif
#endif /* _XOS_H_ */

@ -0,0 +1,128 @@
/*
* O/S-dependent (mis)feature macro definitions
*
* $XConsortium: Xosdefs.h /main/16 1996/09/28 16:17:29 rws $
* $XFree86: xc/include/Xosdefs.h,v 3.11 1996/12/23 05:58:09 dawes Exp $
*
Copyright (c) 1991 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
#ifndef _XOSDEFS_H_
#define _XOSDEFS_H_
/*
* X_NOT_STDC_ENV means does not have ANSI C header files. Lack of this
* symbol does NOT mean that the system has stdarg.h.
*
* X_NOT_POSIX means does not have POSIX header files. Lack of this
* symbol does NOT mean that the POSIX environment is the default.
* You may still have to define _POSIX_SOURCE to get it.
*/
#ifdef NOSTDHDRS
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#ifdef sony
#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV)
#define X_NOT_POSIX
#endif
#endif
#ifdef UTEK
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#ifdef vax
#ifndef ultrix /* assume vanilla BSD */
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#endif
#ifdef luna
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#ifdef Mips
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#ifdef USL
#ifdef SYSV /* (release 3.2) */
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#endif
#ifdef i386
#ifdef SYSV
#if !(defined(ISC) && defined(_POSIX_SOURCE))
#ifndef SCO
#ifndef _SCO_DS /* SCO 5.0 has SVR4 header files */
#define X_NOT_POSIX
#endif
#define X_NOT_STDC_ENV
#endif
#endif /* !(defined(ISC) && defined(_POSIX_SOURCE)) */
#endif
#endif
#ifdef MOTOROLA
#ifdef SYSV
#define X_NOT_STDC_ENV
#endif
#endif
#ifdef sun
#ifdef SVR4
/* define this to whatever it needs to be */
#define X_POSIX_C_SOURCE 199300L
#endif
#endif
#ifdef WIN32
#ifndef _POSIX_
#define X_NOT_POSIX
#endif
#endif
#if defined(nec_ews_svr2) || defined(SX) || defined(PC_UX)
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#ifdef __EMX__
#define USGISH
/* EMX claims to be ANSI, so X_NOT_STDC_ENV does not hold */
/* could have been provided as std flags as well */
#define X_WCHAR
#define X_LOCALE
#endif
#endif /* _XOSDEFS_H_ */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,79 @@
/* $XConsortium: Xprotostr.h,v 1.5 94/04/17 20:10:53 rws Exp $ */
#ifndef XPROTOSTRUCTS_H
#define XPROTOSTRUCTS_H
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
******************************************************************/
#include <X11/Xmd.h>
/* Used by PolySegment */
typedef struct _xSegment {
INT16 x1 B16, y1 B16, x2 B16, y2 B16;
} xSegment;
/* POINT */
typedef struct _xPoint {
INT16 x B16, y B16;
} xPoint;
typedef struct _xRectangle {
INT16 x B16, y B16;
CARD16 width B16, height B16;
} xRectangle;
/* ARC */
typedef struct _xArc {
INT16 x B16, y B16;
CARD16 width B16, height B16;
INT16 angle1 B16, angle2 B16;
} xArc;
#endif /* XPROTOSTRUCTS_H */

@ -0,0 +1,60 @@
/* $XConsortium: keysym.h,v 1.15 94/04/17 20:10:55 rws Exp $ */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
******************************************************************/
/* default keysyms */
#define XK_MISCELLANY
#define XK_XKB_KEYS
#define XK_LATIN1
#define XK_LATIN2
#define XK_LATIN3
#define XK_LATIN4
#define XK_GREEK
#include <X11/keysymdef.h>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,239 @@
/*
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
*/
/* $XConsortium: colormap.h,v 1.28 94/04/17 20:25:32 dpw Exp $ */
/* $XFree86: xc/programs/Xserver/include/colormap.h,v 1.2 1997/01/14 22:22:38 dawes Exp $ */
#ifndef CMAP_H
#define CMAP_H 1
#include "X11/Xproto.h"
#include "screenint.h"
#include "window.h"
/* these follow X.h's AllocNone and AllocAll */
#define CM_PSCREEN 2
#define CM_PWIN 3
/* Passed internally in colormap.c */
#define REDMAP 0
#define GREENMAP 1
#define BLUEMAP 2
#define PSEUDOMAP 3
#define AllocPrivate (-1)
#define AllocTemporary (-2)
#define DynamicClass 1
/* Values for the flags field of a colormap. These should have 1 bit set
* and not overlap */
#define IsDefault 1
#define AllAllocated 2
#define BeingCreated 4
typedef CARD32 Pixel;
typedef struct _CMEntry *EntryPtr;
/* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */
typedef struct _colorResource *colorResourcePtr;
extern int CreateColormap(
#if NeedFunctionPrototypes
Colormap /*mid*/,
ScreenPtr /*pScreen*/,
VisualPtr /*pVisual*/,
ColormapPtr* /*ppcmap*/,
int /*alloc*/,
int /*client*/
#endif
);
extern int FreeColormap(
#if NeedFunctionPrototypes
pointer /*pmap*/,
XID /*mid*/
#endif
);
extern int TellLostMap(
#if NeedFunctionPrototypes
X11WindowPtr /*pwin*/,
pointer /* Colormap *pmid */
#endif
);
extern int TellGainedMap(
#if NeedFunctionPrototypes
X11WindowPtr /*pwin*/,
pointer /* Colormap *pmid */
#endif
);
extern int CopyColormapAndFree(
#if NeedFunctionPrototypes
Colormap /*mid*/,
ColormapPtr /*pSrc*/,
int /*client*/
#endif
);
extern int AllocColor(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
unsigned short* /*pred*/,
unsigned short* /*pgreen*/,
unsigned short* /*pblue*/,
Pixel* /*pPix*/,
int /*client*/
#endif
);
extern void FakeAllocColor(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
xColorItem * /*item*/
#endif
);
extern void FakeFreeColor(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
Pixel /*pixel*/
#endif
);
typedef int (*ColorCompareProcPtr)(
#if NeedNestedPrototypes
EntryPtr /*pent*/,
xrgb * /*prgb*/
#endif
);
extern int FindColor(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
EntryPtr /*pentFirst*/,
int /*size*/,
xrgb* /*prgb*/,
Pixel* /*pPixel*/,
int /*channel*/,
int /*client*/,
ColorCompareProcPtr /*comp*/
#endif
);
extern int QueryColors(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
int /*count*/,
Pixel* /*ppixIn*/,
xrgb* /*prgbList*/
#endif
);
extern int FreeClientPixels(
#if NeedFunctionPrototypes
pointer /*pcr*/,
XID /*fakeid*/
#endif
);
extern int AllocColorCells(
#if NeedFunctionPrototypes
int /*client*/,
ColormapPtr /*pmap*/,
int /*colors*/,
int /*planes*/,
Bool /*contig*/,
Pixel* /*ppix*/,
Pixel* /*masks*/
#endif
);
extern int AllocColorPlanes(
#if NeedFunctionPrototypes
int /*client*/,
ColormapPtr /*pmap*/,
int /*colors*/,
int /*r*/,
int /*g*/,
int /*b*/,
Bool /*contig*/,
Pixel* /*pixels*/,
Pixel* /*prmask*/,
Pixel* /*pgmask*/,
Pixel* /*pbmask*/
#endif
);
extern int FreeColors(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
int /*client*/,
int /*count*/,
Pixel* /*pixels*/,
Pixel /*mask*/
#endif
);
extern int StoreColors(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
int /*count*/,
xColorItem* /*defs*/
#endif
);
extern int IsMapInstalled(
#if NeedFunctionPrototypes
Colormap /*map*/,
X11WindowPtr /*pWin*/
#endif
);
#endif /* CMAP_H */

@ -0,0 +1,152 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
******************************************************************/
/* $XConsortium: cursor.h,v 1.22 94/04/17 20:25:34 dpw Exp $ */
#ifndef CURSOR_H
#define CURSOR_H
#include "misc.h"
#include "screenint.h"
#include "window.h"
#define NullCursor ((CursorPtr)NULL)
typedef struct _Cursor *CursorPtr;
typedef struct _CursorMetric *CursorMetricPtr;
extern CursorPtr rootCursor;
extern int FreeCursor(
#if NeedFunctionPrototypes
pointer /*pCurs*/,
XID /*cid*/
#endif
);
extern CursorPtr X11AllocCursor(
#if NeedFunctionPrototypes
unsigned char* /*psrcbits*/,
unsigned char* /*pmaskbits*/,
CursorMetricPtr /*cm*/,
unsigned /*foreRed*/,
unsigned /*foreGreen*/,
unsigned /*foreBlue*/,
unsigned /*backRed*/,
unsigned /*backGreen*/,
unsigned /*backBlue*/
#endif
);
extern int AllocGlyphCursor(
#if NeedFunctionPrototypes
Font /*source*/,
unsigned int /*sourceChar*/,
Font /*mask*/,
unsigned int /*maskChar*/,
unsigned /*foreRed*/,
unsigned /*foreGreen*/,
unsigned /*foreBlue*/,
unsigned /*backRed*/,
unsigned /*backGreen*/,
unsigned /*backBlue*/,
CursorPtr* /*ppCurs*/,
ClientPtr /*client*/
#endif
);
extern CursorPtr CreateRootCursor(
#if NeedFunctionPrototypes
char* /*pfilename*/,
unsigned int /*glyph*/
#endif
);
extern int ServerBitsFromGlyph(
#if NeedFunctionPrototypes
FontPtr /*pfont*/,
unsigned int /*ch*/,
register CursorMetricPtr /*cm*/,
unsigned char ** /*ppbits*/
#endif
);
extern Bool CursorMetricsFromGlyph(
#if NeedFunctionPrototypes
FontPtr /*pfont*/,
unsigned /*ch*/,
CursorMetricPtr /*cm*/
#endif
);
extern void CheckCursorConfinement(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
extern void NewCurrentScreen(
#if NeedFunctionPrototypes
ScreenPtr /*newScreen*/,
int /*x*/,
int /*y*/
#endif
);
extern Bool PointerConfinedToScreen(
#if NeedFunctionPrototypes
void
#endif
);
extern void GetSpritePosition(
#if NeedFunctionPrototypes
int * /*px*/,
int * /*py*/
#endif
);
#endif /* CURSOR_H */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,232 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
******************************************************************/
/* $XConsortium: gc.h /main/16 1996/08/01 19:18:17 dpw $ */
#ifndef GC_H
#define GC_H
#include "misc.h" /* for Bool */
#include "X11/X.h" /* for GContext, Mask */
#include "X11/Xproto.h"
#include "screenint.h" /* for ScreenPtr */
#include "pixmap.h" /* for DrawablePtr */
/* clientClipType field in GC */
#define CT_NONE 0
#define CT_PIXMAP 1
#define CT_REGION 2
#define CT_UNSORTED 6
#define CT_YSORTED 10
#define CT_YXSORTED 14
#define CT_YXBANDED 18
#define GCQREASON_VALIDATE 1
#define GCQREASON_CHANGE 2
#define GCQREASON_COPY_SRC 3
#define GCQREASON_COPY_DST 4
#define GCQREASON_DESTROY 5
#define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31)
#define GC_CALL_VALIDATE_BIT (1L<<30)
#define GCExtensionInterest (1L<<29)
#define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT))
#define MAX_SERIAL_NUM (1L<<28)
#define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \
(globalSerialNumber = 1): globalSerialNumber)
typedef struct _GCInterest *GCInterestPtr;
typedef struct _GC *GCPtr;
typedef struct _GCOps *GCOpsPtr;
extern void ValidateGC(
#if NeedFunctionPrototypes
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/
#endif
);
extern int ChangeGC(
#if NeedFunctionPrototypes
GCPtr/*pGC*/,
BITS32 /*mask*/,
XID* /*pval*/
#endif
);
extern int DoChangeGC(
#if NeedFunctionPrototypes
GCPtr/*pGC*/,
BITS32 /*mask*/,
XID* /*pval*/,
int /*fPointer*/
#endif
);
typedef union {
CARD32 val;
pointer ptr;
} ChangeGCVal, *ChangeGCValPtr;
extern int dixChangeGC(
#if NeedFunctionPrototypes
ClientPtr /*client*/,
GCPtr /*pGC*/,
BITS32 /*mask*/,
CARD32 * /*pval*/,
ChangeGCValPtr /*pCGCV*/
#endif
);
extern GCPtr CreateGC(
#if NeedFunctionPrototypes
DrawablePtr /*pDrawable*/,
BITS32 /*mask*/,
XID* /*pval*/,
int* /*pStatus*/
#endif
);
extern int CopyGC(
#if NeedFunctionPrototypes
GCPtr/*pgcSrc*/,
GCPtr/*pgcDst*/,
BITS32 /*mask*/
#endif
);
extern int FreeGC(
#if NeedFunctionPrototypes
pointer /*pGC*/,
XID /*gid*/
#endif
);
extern void SetGCMask(
#if NeedFunctionPrototypes
GCPtr /*pGC*/,
Mask /*selectMask*/,
Mask /*newDataMask*/
#endif
);
extern GCPtr CreateScratchGC(
#if NeedFunctionPrototypes
ScreenPtr /*pScreen*/,
unsigned /*depth*/
#endif
);
extern void FreeGCperDepth(
#if NeedFunctionPrototypes
int /*screenNum*/
#endif
);
extern Bool CreateGCperDepth(
#if NeedFunctionPrototypes
int /*screenNum*/
#endif
);
extern Bool CreateDefaultStipple(
#if NeedFunctionPrototypes
int /*screenNum*/
#endif
);
extern void FreeDefaultStipple(
#if NeedFunctionPrototypes
int /*screenNum*/
#endif
);
extern int SetDashes(
#if NeedFunctionPrototypes
GCPtr /*pGC*/,
unsigned /*offset*/,
unsigned /*ndash*/,
unsigned char* /*pdash*/
#endif
);
extern int VerifyRectOrder(
#if NeedFunctionPrototypes
int /*nrects*/,
xRectangle* /*prects*/,
int /*ordering*/
#endif
);
extern int SetClipRects(
#if NeedFunctionPrototypes
GCPtr /*pGC*/,
int /*xOrigin*/,
int /*yOrigin*/,
int /*nrects*/,
xRectangle* /*prects*/,
int /*ordering*/
#endif
);
extern GCPtr GetScratchGC(
#if NeedFunctionPrototypes
unsigned /*depth*/,
ScreenPtr /*pScreen*/
#endif
);
extern void FreeScratchGC(
#if NeedFunctionPrototypes
GCPtr /*pGC*/
#endif
);
#endif /* GC_H */

@ -0,0 +1,535 @@
/* $XConsortium: input.h /main/22 1996/09/25 00:50:39 dpw $ */
/* $XFree86: xc/programs/Xserver/include/input.h,v 3.4 1996/12/23 07:09:28 dawes Exp $ */
/************************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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 INPUT_H
#define INPUT_H
#include "misc.h"
#include "screenint.h"
#include "X11/Xmd.h"
#include "X11/Xproto.h"
#include "window.h" /* for WindowPtr */
#define DEVICE_INIT 0
#define DEVICE_ON 1
#define DEVICE_OFF 2
#define DEVICE_CLOSE 3
#define MAP_LENGTH 256
#define DOWN_LENGTH 32 /* 256/8 => number of bytes to hold 256 bits */
#define NullGrab ((GrabPtr)NULL)
#define PointerRootWin ((WindowPtr)PointerRoot)
#define NoneWin ((WindowPtr)None)
#define NullDevice ((DevicePtr)NULL)
#ifndef FollowKeyboard
#define FollowKeyboard 3
#endif
#ifndef FollowKeyboardWin
#define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
#endif
#ifndef RevertToFollowKeyboard
#define RevertToFollowKeyboard 3
#endif
typedef unsigned long Leds;
typedef struct _OtherClients *OtherClientsPtr;
typedef struct _InputClients *InputClientsPtr;
typedef struct _DeviceIntRec *DeviceIntPtr;
typedef int (*DeviceProc)(
#if NeedNestedPrototypes
DeviceIntPtr /*device*/,
int /*what*/
#endif
);
typedef void (*ProcessInputProc)(
#if NeedNestedPrototypes
xEventPtr /*events*/,
DeviceIntPtr /*device*/,
int /*count*/
#endif
);
typedef struct _DeviceRec {
pointer devicePrivate;
ProcessInputProc processInputProc; /* current */
ProcessInputProc realInputProc; /* deliver */
ProcessInputProc enqueueInputProc; /* enqueue */
Bool on; /* used by DDX to keep state */
} DeviceRec, *DevicePtr;
typedef struct {
int click, bell, bell_pitch, bell_duration;
Bool autoRepeat;
unsigned char autoRepeats[32];
Leds leds;
unsigned char id;
} KeybdCtrl;
typedef struct {
KeySym *map;
KeyCode minKeyCode,
maxKeyCode;
int mapWidth;
} KeySymsRec, *KeySymsPtr;
typedef struct {
int num, den, threshold;
unsigned char id;
} PtrCtrl;
typedef struct {
int resolution, min_value, max_value;
int integer_displayed;
unsigned char id;
} IntegerCtrl;
typedef struct {
int max_symbols, num_symbols_supported;
int num_symbols_displayed;
KeySym *symbols_supported;
KeySym *symbols_displayed;
unsigned char id;
} StringCtrl;
typedef struct {
int percent, pitch, duration;
unsigned char id;
} BellCtrl;
typedef struct {
Leds led_values;
Mask led_mask;
unsigned char id;
} LedCtrl;
extern KeybdCtrl defaultKeyboardControl;
extern PtrCtrl defaultPointerControl;
#undef AddInputDevice
extern DevicePtr AddInputDevice(
#if NeedFunctionPrototypes
DeviceProc /*deviceProc*/,
Bool /*autoStart*/
#endif
);
#define AddInputDevice(deviceProc, autoStart) \
_AddInputDevice(deviceProc, autoStart)
extern DeviceIntPtr _AddInputDevice(
#if NeedFunctionPrototypes
DeviceProc /*deviceProc*/,
Bool /*autoStart*/
#endif
);
extern Bool EnableDevice(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/
#endif
);
extern Bool DisableDevice(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/
#endif
);
extern int InitAndStartDevices(
#if NeedFunctionPrototypes
void
#endif
);
extern void CloseDownDevices(
#if NeedFunctionPrototypes
void
#endif
);
extern void RemoveDevice(
#if NeedFunctionPrototypes
DeviceIntPtr /*dev*/
#endif
);
extern int NumMotionEvents(
#if NeedFunctionPrototypes
void
#endif
);
#undef RegisterPointerDevice
extern void RegisterPointerDevice(
#if NeedFunctionPrototypes
DevicePtr /*device*/
#endif
);
#define RegisterPointerDevice(device) \
_RegisterPointerDevice(device)
extern void _RegisterPointerDevice(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/
#endif
);
#undef RegisterKeyboardDevice
extern void RegisterKeyboardDevice(
#if NeedFunctionPrototypes
DevicePtr /*device*/
#endif
);
#define RegisterKeyboardDevice(device) \
_RegisterKeyboardDevice(device)
extern void _RegisterKeyboardDevice(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/
#endif
);
extern DevicePtr LookupKeyboardDevice(
#if NeedFunctionPrototypes
void
#endif
);
extern DevicePtr LookupPointerDevice(
#if NeedFunctionPrototypes
void
#endif
);
extern DevicePtr LookupDevice(
#if NeedFunctionPrototypes
int /* id */
#endif
);
extern void QueryMinMaxKeyCodes(
#if NeedFunctionPrototypes
KeyCode* /*minCode*/,
KeyCode* /*maxCode*/
#endif
);
extern Bool SetKeySymsMap(
#if NeedFunctionPrototypes
KeySymsPtr /*dst*/,
KeySymsPtr /*src*/
#endif
);
extern Bool InitKeyClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
KeySymsPtr /*pKeySyms*/,
CARD8 /*pModifiers*/[]
#endif
);
extern Bool InitButtonClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
int /*numButtons*/,
CARD8* /*map*/
#endif
);
typedef int (*ValuatorMotionProcPtr)(
#if NeedNestedPrototypes
DeviceIntPtr /*pdevice*/,
xTimecoord * /*coords*/,
unsigned long /*start*/,
unsigned long /*stop*/,
ScreenPtr /*pScreen*/
#endif
);
extern Bool InitValuatorClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
int /*numAxes*/,
ValuatorMotionProcPtr /* motionProc */,
int /*numMotionEvents*/,
int /*mode*/
#endif
);
extern Bool InitFocusClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/
#endif
);
typedef void (*BellProcPtr)(
#if NeedNestedPrototypes
int /*percent*/,
DeviceIntPtr /*device*/,
pointer /*ctrl*/,
int
#endif
);
typedef void (*KbdCtrlProcPtr)(
#if NeedNestedPrototypes
DeviceIntPtr /*device*/,
KeybdCtrl * /*ctrl*/
#endif
);
extern Bool InitKbdFeedbackClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
BellProcPtr /*bellProc*/,
KbdCtrlProcPtr /*controlProc*/
#endif
);
typedef void (*PtrCtrlProcPtr)(
#if NeedNestedPrototypes
DeviceIntPtr /*device*/,
PtrCtrl * /*ctrl*/
#endif
);
extern Bool InitPtrFeedbackClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
PtrCtrlProcPtr /*controlProc*/
#endif
);
typedef void (*StringCtrlProcPtr)(
#if NeedNestedPrototypes
DeviceIntPtr /*device*/,
StringCtrl * /*ctrl*/
#endif
);
extern Bool InitStringFeedbackClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
StringCtrlProcPtr /*controlProc*/,
int /*max_symbols*/,
int /*num_symbols_supported*/,
KeySym* /*symbols*/
#endif
);
typedef void (*BellCtrlProcPtr)(
#if NeedNestedPrototypes
DeviceIntPtr /*device*/,
BellCtrl * /*ctrl*/
#endif
);
extern Bool InitBellFeedbackClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
BellProcPtr /*bellProc*/,
BellCtrlProcPtr /*controlProc*/
#endif
);
typedef void (*LedCtrlProcPtr)(
#if NeedNestedPrototypes
DeviceIntPtr /*device*/,
LedCtrl * /*ctrl*/
#endif
);
extern Bool InitLedFeedbackClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
LedCtrlProcPtr /*controlProc*/
#endif
);
typedef void (*IntegerCtrlProcPtr)(
#if NeedNestedPrototypes
DeviceIntPtr /*device*/,
IntegerCtrl * /*ctrl*/
#endif
);
extern Bool InitIntegerFeedbackClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
IntegerCtrlProcPtr /*controlProc*/
#endif
);
extern Bool InitPointerDeviceStruct(
#if NeedFunctionPrototypes
DevicePtr /*device*/,
CARD8* /*map*/,
int /*numButtons*/,
ValuatorMotionProcPtr /*motionProc*/,
PtrCtrlProcPtr /*controlProc*/,
int /*numMotionEvents*/
#endif
);
extern Bool InitKeyboardDeviceStruct(
#if NeedFunctionPrototypes
DevicePtr /*device*/,
KeySymsPtr /*pKeySyms*/,
CARD8 /*pModifiers*/[],
BellProcPtr /*bellProc*/,
KbdCtrlProcPtr /*controlProc*/
#endif
);
extern void SendMappingNotify(
#if NeedFunctionPrototypes
unsigned int /*request*/,
unsigned int /*firstKeyCode*/,
unsigned int /*count*/,
ClientPtr /* client */
#endif
);
extern Bool BadDeviceMap(
#if NeedFunctionPrototypes
BYTE* /*buff*/,
int /*length*/,
unsigned /*low*/,
unsigned /*high*/,
XID* /*errval*/
#endif
);
extern Bool AllModifierKeysAreUp(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
CARD8* /*map1*/,
int /*per1*/,
CARD8* /*map2*/,
int /*per2*/
#endif
);
extern void NoteLedState(
#if NeedFunctionPrototypes
DeviceIntPtr /*keybd*/,
int /*led*/,
Bool /*on*/
#endif
);
extern void MaybeStopHint(
#if NeedFunctionPrototypes
DeviceIntPtr /*device*/,
ClientPtr /*client*/
#endif
);
extern void ProcessPointerEvent(
#if NeedFunctionPrototypes
xEventPtr /*xE*/,
DeviceIntPtr /*mouse*/,
int /*count*/
#endif
);
extern void ProcessKeyboardEvent(
#if NeedFunctionPrototypes
xEventPtr /*xE*/,
DeviceIntPtr /*keybd*/,
int /*count*/
#endif
);
#ifdef XKB
extern void CoreProcessPointerEvent(
#if NeedFunctionPrototypes
xEventPtr /*xE*/,
DeviceIntPtr /*mouse*/,
int /*count*/
#endif
);
extern void CoreProcessKeyboardEvent(
#if NeedFunctionPrototypes
xEventPtr /*xE*/,
DeviceIntPtr /*keybd*/,
int /*count*/
#endif
);
#endif
extern Bool LegalModifier(
#if NeedFunctionPrototypes
unsigned int /*key*/,
DevicePtr /*pDev*/
#endif
);
extern void ProcessInputEvents(
#if NeedFunctionPrototypes
void
#endif
);
extern void InitInput(
#if NeedFunctionPrototypes
int /*argc*/,
char ** /*argv*/
#endif
);
#endif /* INPUT_H */

@ -0,0 +1,280 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
Copyright 1992, 1993 Data General Corporation;
Copyright 1992, 1993 OMRON Corporation
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
neither the name OMRON or DATA GENERAL be used in advertising or publicity
pertaining to distribution of the software without specific, written prior
permission of the party whose name is to be used. Neither OMRON or
DATA GENERAL make any representation about the suitability of this software
for any purpose. It is provided "as is" without express or implied warranty.
OMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
IN NO EVENT SHALL OMRON OR DATA GENERAL 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.
******************************************************************/
/* $XConsortium: misc.h /main/28 1996/12/02 10:22:01 lehors $ */
/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.5 1996/12/23 07:09:29 dawes Exp $ */
#ifndef MISC_H
#define MISC_H 1
/*
* X internal definitions
*
*/
extern unsigned long globalSerialNumber;
extern unsigned long serverGeneration;
#include <X11/Xosdefs.h>
#include <X11/Xfuncproto.h>
#include <X11/Xmd.h>
#include <X11/X.h>
#ifndef NULL
#ifndef X_NOT_STDC_ENV
#include <stddef.h>
#else
#define NULL 0
#endif
#endif
#ifndef MAXSCREENS
#define MAXSCREENS 3
#endif
#define MAXCLIENTS 128
#define MAXDITS 1
#define MAXEXTENSIONS 128
#define MAXFORMATS 8
#define MAXVISUALS_PER_SCREEN 50
#if NeedFunctionPrototypes
typedef void *pointer;
#else
typedef unsigned char *pointer;
#endif
typedef int Bool;
typedef unsigned long PIXEL;
typedef unsigned long ATOM;
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#ifndef _XTYPEDEF_FONTPTR
typedef struct _Font *FontPtr; /* also in fonts/include/font.h */
#define _XTYPEDEF_FONTPTR
#endif
#ifndef _XTYPEDEF_CLIENTPTR
typedef struct _Client *ClientPtr; /* also in dix.h */
#define _XTYPEDEF_CLIENTPTR
#endif
#ifndef _XTYPEDEF_CALLBACKLISTPTR
typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */
#define _XTYPEDEF_CALLBACKLISTPTR
#endif
typedef struct _xReq *xReqPtr;
#include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */
#include <X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */
#define NullBox ((BoxPtr)0)
#define MILLI_PER_MIN (1000 * 60)
#define MILLI_PER_SECOND (1000)
/* this next is used with None and ParentRelative to tell
PaintWin() what to use to paint the background. Also used
in the macro IS_VALID_PIXMAP */
#define USE_BACKGROUND_PIXEL 3
#define USE_BORDER_PIXEL 3
/* byte swap a 32-bit literal */
#define lswapl(x) ((((x) & 0xff) << 24) |\
(((x) & 0xff00) << 8) |\
(((x) & 0xff0000) >> 8) |\
(((x) >> 24) & 0xff))
/* byte swap a short literal */
#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))
#if !defined(AMOEBA) && !defined(__EMX__)
#ifndef abs
#define abs(a) ((a) > 0 ? (a) : -(a))
#endif
#else /* AMOEBA || __EMX__ */
/* abs() is a function, not a macro; include the file declaring
* it in case we haven't done that yet.
*/
#include <stdlib.h>
#endif /* AMOEBA */
#ifndef Fabs
#define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */
#endif
#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
/* this assumes b > 0 */
#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
/*
* return the least significant bit in x which is set
*
* This works on 1's complement and 2's complement machines.
* If you care about the extra instruction on 2's complement
* machines, change to ((x) & (-(x)))
*/
#define lowbit(x) ((x) & (~(x) + 1))
#ifndef MAXSHORT
#define MAXSHORT 32767
#endif
#ifndef MINSHORT
#define MINSHORT -MAXSHORT
#endif
/* some macros to help swap requests, replies, and events */
#define LengthRestB(stuff) \
((client->req_len << 2) - sizeof(*stuff))
#define LengthRestS(stuff) \
((client->req_len << 1) - (sizeof(*stuff) >> 1))
#define LengthRestL(stuff) \
(client->req_len - (sizeof(*stuff) >> 2))
#define SwapRestS(stuff) \
SwapShorts((short *)(stuff + 1), LengthRestS(stuff))
#define SwapRestL(stuff) \
SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
/* byte swap a 32-bit value */
#define swapl(x, n) { \
n = ((char *) (x))[0];\
((char *) (x))[0] = ((char *) (x))[3];\
((char *) (x))[3] = n;\
n = ((char *) (x))[1];\
((char *) (x))[1] = ((char *) (x))[2];\
((char *) (x))[2] = n; }
/* byte swap a short */
#define swaps(x, n) { \
n = ((char *) (x))[0];\
((char *) (x))[0] = ((char *) (x))[1];\
((char *) (x))[1] = n; }
/* copy 32-bit value from src to dst byteswapping on the way */
#define cpswapl(src, dst) { \
((char *)&(dst))[0] = ((char *) &(src))[3];\
((char *)&(dst))[1] = ((char *) &(src))[2];\
((char *)&(dst))[2] = ((char *) &(src))[1];\
((char *)&(dst))[3] = ((char *) &(src))[0]; }
/* copy short from src to dst byteswapping on the way */
#define cpswaps(src, dst) { \
((char *) &(dst))[0] = ((char *) &(src))[1];\
((char *) &(dst))[1] = ((char *) &(src))[0]; }
extern void SwapLongs(
#if NeedFunctionPrototypes
CARD32 *list,
unsigned long count
#endif
);
extern void SwapShorts(
#if NeedFunctionPrototypes
short *list,
unsigned long count
#endif
);
extern void MakePredeclaredAtoms(
#if NeedFunctionPrototypes
void
#endif
);
extern int Ones(
#if NeedFunctionPrototypes
unsigned long /*mask*/
#endif
);
typedef struct _xPoint *DDXPointPtr;
typedef struct _Box *BoxPtr;
typedef struct _xEvent *xEventPtr;
typedef struct _xRectangle *xRectanglePtr;
typedef struct _GrabRec *GrabPtr;
/* typedefs from other places - duplicated here to minimize the amount
* of unnecessary junk that one would normally have to include to get
* these symbols defined
*/
#ifndef _XTYPEDEF_CHARINFOPTR
typedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */
#define _XTYPEDEF_CHARINFOPTR
#endif
#endif /* MISC_H */

@ -0,0 +1,73 @@
/* $XConsortium: miscstruct.h,v 5.5 94/04/17 20:25:50 dpw Exp $ */
/* $XFree86: xc/programs/Xserver/include/miscstruct.h,v 3.0 1996/02/18 03:45:10 dawes Exp $ */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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 MISCSTRUCT_H
#define MISCSTRUCT_H 1
#include "misc.h"
#include "X11/Xprotostr.h"
typedef xPoint DDXPointRec;
typedef struct _Box {
short x1, y1, x2, y2;
} BoxRec;
typedef union _DevUnion {
pointer ptr;
long val;
unsigned long uval;
pointer (*fptr)(
#if NeedFunctionPrototypes
void
#endif
);
} DevUnion;
#endif /* MISCSTRUCT_H */

@ -0,0 +1,74 @@
/* $XConsortium: opaque.h,v 1.19 94/04/17 20:25:51 dpw Exp $ */
/*
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
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 X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
/* $XFree86: xc/programs/Xserver/include/opaque.h,v 1.2.2.1 1997/06/01 12:33:43 dawes Exp $ */
#ifndef OPAQUE_H
#define OPAQUE_H
#include <X11/Xmd.h>
extern char *defaultFontPath;
extern char *defaultTextFont;
extern char *defaultCursorFont;
extern char *rgbPath;
extern int MaxClients;
extern char isItTimeToYield;
extern char dispatchException;
/* bit values for dispatchException */
#define DE_RESET 1
#define DE_TERMINATE 2
#define DE_PRIORITYCHANGE 4 /* set when a client's priority changes */
extern CARD32 TimeOutValue;
extern CARD32 ScreenSaverTime;
extern CARD32 ScreenSaverInterval;
extern int ScreenSaverBlanking;
extern int ScreenSaverAllowExposures;
extern int argcGlobal;
extern char **argvGlobal;
#if DPMSExtension
extern CARD32 defaultDPMSStandbyTime;
extern CARD32 defaultDPMSSuspendTime;
extern CARD32 defaultDPMSOffTime;
extern CARD32 DPMSStandbyTime;
extern CARD32 DPMSSuspendTime;
extern CARD32 DPMSOffTime;
extern CARD16 DPMSPowerLevel;
extern Bool defaultDPMSEnabled;
extern Bool DPMSEnabled;
extern Bool DPMSEnabledSwitch;
extern Bool DPMSDisabledSwitch;
extern Bool DPMSCapableFlag;
#endif
#endif /* OPAQUE_H */

@ -0,0 +1,776 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
******************************************************************/
/* $XConsortium: os.h /main/60 1996/12/15 21:25:13 rws $ */
/* $XFree86: xc/programs/Xserver/include/os.h,v 3.16.2.1 1998/01/22 10:47:13 dawes Exp $ */
#ifndef OS_H
#define OS_H
#include "misc.h"
#define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size))
#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((pointer)(_ptr))
#include "Xalloca.h"
#define NullFID ((FID) 0)
#define SCREEN_SAVER_ON 0
#define SCREEN_SAVER_OFF 1
#define SCREEN_SAVER_FORCER 2
#define SCREEN_SAVER_CYCLE 3
#ifndef MAX_REQUEST_SIZE
#define MAX_REQUEST_SIZE 65535
#endif
#ifndef MAX_BIG_REQUEST_SIZE
#define MAX_BIG_REQUEST_SIZE 1048575
#endif
typedef pointer FID;
typedef struct _FontPathRec *FontPathPtr;
typedef struct _NewClientRec *NewClientPtr;
#define xnfalloc(size) XNFalloc((unsigned long)(size))
#define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size))
#define xalloc(size) Xalloc((unsigned long)(size))
#define xnfalloc(size) XNFalloc((unsigned long)(size))
#define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size))
#define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size))
#define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size))
#define xfree(ptr) Xfree((pointer)(ptr))
#ifdef SCO
#include <stdio.h>
#endif
#ifndef X_NOT_STDC_ENV
#include <string.h>
#else
#ifdef SYSV
#include <string.h>
#else
#include <strings.h>
#endif
#endif
/* have to put $(SIGNAL_DEFINES) in DEFINES in Imakefile to get this right */
#ifdef SIGNALRETURNSINT
#define SIGVAL int
#else
#define SIGVAL void
#endif
extern Bool OsDelayInitColors;
extern int WaitForSomething(
#if NeedFunctionPrototypes
int* /*pClientsReady*/
#endif
);
#ifdef LBX
#define ReadRequestFromClient(client) ((client)->readRequest(client))
extern int StandardReadRequestFromClient(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
#else
extern int ReadRequestFromClient(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
#endif /* LBX */
extern Bool InsertFakeRequest(
#if NeedFunctionPrototypes
ClientPtr /*client*/,
char* /*data*/,
int /*count*/
#endif
);
extern int ResetCurrentRequest(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
extern void FlushAllOutput(
#if NeedFunctionPrototypes
void
#endif
);
extern void FlushIfCriticalOutputPending(
#if NeedFunctionPrototypes
void
#endif
);
extern void SetCriticalOutputPending(
#if NeedFunctionPrototypes
void
#endif
);
extern int WriteToClient(
#if NeedFunctionPrototypes
ClientPtr /*who*/,
int /*count*/,
char* /*buf*/
#endif
);
extern void ResetOsBuffers(
#if NeedFunctionPrototypes
void
#endif
);
extern void CreateWellKnownSockets(
#if NeedFunctionPrototypes
void
#endif
);
extern void ResetWellKnownSockets(
#if NeedFunctionPrototypes
void
#endif
);
extern XID
AuthorizationIDOfClient(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
extern char *ClientAuthorized(
#if NeedFunctionPrototypes
ClientPtr /*client*/,
unsigned int /*proto_n*/,
char* /*auth_proto*/,
unsigned int /*string_n*/,
char* /*auth_string*/
#endif
);
extern Bool EstablishNewConnections(
#if NeedFunctionPrototypes
ClientPtr /*clientUnused*/,
pointer /*closure*/
#endif
);
extern void CheckConnections(
#if NeedFunctionPrototypes
void
#endif
);
extern void CloseDownConnection(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
extern int AddEnabledDevice(
#if NeedFunctionPrototypes
int /*fd*/
#endif
);
extern int RemoveEnabledDevice(
#if NeedFunctionPrototypes
int /*fd*/
#endif
);
extern int OnlyListenToOneClient(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
extern int ListenToAllClients(
#if NeedFunctionPrototypes
void
#endif
);
extern int IgnoreClient(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
extern int AttendClient(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
extern int MakeClientGrabImpervious(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
extern int MakeClientGrabPervious(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
extern void Error(
#if NeedFunctionPrototypes
char* /*str*/
#endif
);
extern CARD32 GetTimeInMillis(
#if NeedFunctionPrototypes
void
#endif
);
extern int AdjustWaitForDelay(
#if NeedFunctionPrototypes
pointer /*waitTime*/,
unsigned long /*newdelay*/
#endif
);
typedef struct _OsTimerRec *OsTimerPtr;
typedef CARD32 (*OsTimerCallback)(
#if NeedFunctionPrototypes
OsTimerPtr /* timer */,
CARD32 /* time */,
pointer /* arg */
#endif
);
extern void TimerInit(
#if NeedFunctionPrototypes
void
#endif
);
extern Bool TimerForce(
#if NeedFunctionPrototypes
OsTimerPtr /* timer */
#endif
);
#define TimerAbsolute (1<<0)
#define TimerForceOld (1<<1)
extern OsTimerPtr TimerSet(
#if NeedFunctionPrototypes
OsTimerPtr /* timer */,
int /* flags */,
CARD32 /* millis */,
OsTimerCallback /* func */,
pointer /* arg */
#endif
);
extern void TimerCheck(
#if NeedFunctionPrototypes
void
#endif
);
extern void TimerCancel(
#if NeedFunctionPrototypes
OsTimerPtr /* pTimer */
#endif
);
extern void TimerFree(
#if NeedFunctionPrototypes
OsTimerPtr /* pTimer */
#endif
);
extern SIGVAL AutoResetServer(
#if NeedFunctionPrototypes
int /*sig*/
#endif
);
extern SIGVAL GiveUp(
#if NeedFunctionPrototypes
int /*sig*/
#endif
);
extern void UseMsg(
#if NeedFunctionPrototypes
void
#endif
);
extern void ProcessCommandLine(
#if NeedFunctionPrototypes
int /*argc*/,
char* /*argv*/[]
#endif
);
extern unsigned long *Xalloc(
#if NeedFunctionPrototypes
unsigned long /*amount*/
#endif
);
extern unsigned long *XNFalloc(
#if NeedFunctionPrototypes
unsigned long /*amount*/
#endif
);
extern unsigned long *Xcalloc(
#if NeedFunctionPrototypes
unsigned long /*amount*/
#endif
);
extern unsigned long *Xrealloc(
#if NeedFunctionPrototypes
pointer /*ptr*/,
unsigned long /*amount*/
#endif
);
extern unsigned long *XNFrealloc(
#if NeedFunctionPrototypes
pointer /*ptr*/,
unsigned long /*amount*/
#endif
);
extern void Xfree(
#if NeedFunctionPrototypes
pointer /*ptr*/
#endif
);
extern void OsInitAllocator(
#if NeedFunctionPrototypes
void
#endif
);
typedef SIGVAL (*OsSigHandlerPtr)(
#if NeedFunctionPrototypes
int /* sig */
#endif
);
extern OsSigHandlerPtr OsSignal(
#if NeedFunctionPrototypes
int /* sig */,
OsSigHandlerPtr /* handler */
#endif
);
extern int auditTrailLevel;
extern void AuditF(
#if NeedVarargsPrototypes
char* /*f*/,
...
#endif
);
extern void FatalError(
#if NeedVarargsPrototypes
char* /*f*/,
...
#endif
)
#if __GNUC__ == 2 && __GNUC_MINOR__ > 4
__attribute((noreturn))
#endif
;
extern void ErrorF(
#if NeedVarargsPrototypes
char* /*f*/,
...
#endif
);
#ifdef SERVER_LOCK
extern void LockServer(
#if NeedFunctionPrototypes
void
#endif
);
extern void UnlockServer(
#if NeedFunctionPrototypes
void
#endif
);
#endif
extern int OsLookupColor(
#if NeedFunctionPrototypes
int /*screen*/,
char * /*name*/,
unsigned /*len*/,
unsigned short * /*pred*/,
unsigned short * /*pgreen*/,
unsigned short * /*pblue*/
#endif
);
extern void OsInit(
#if NeedFunctionPrototypes
void
#endif
);
extern void OsCleanup(
#if NeedFunctionPrototypes
void
#endif
);
extern void OsVendorFatalError(
#if NeedFunctionPrototypes
void
#endif
);
extern void OsVendorInit(
#if NeedFunctionPrototypes
void
#endif
);
extern int OsInitColors(
#if NeedFunctionPrototypes
void
#endif
);
#if !defined(WIN32) && !defined(__EMX__)
extern int System(
#if NeedFunctionPrototypes
char *
#endif
);
extern pointer Popen(
#if NeedFunctionPrototypes
char *,
char *
#endif
);
extern int Pclose(
#if NeedFunctionPrototypes
pointer
#endif
);
#else
#define System(a) system(a)
#define Popen(a,b) popen(a,b)
#define Pclose(a) pclose(a)
#endif
extern int AddHost(
#if NeedFunctionPrototypes
ClientPtr /*client*/,
int /*family*/,
unsigned /*length*/,
pointer /*pAddr*/
#endif
);
extern Bool ForEachHostInFamily (
#if NeedFunctionPrototypes
int /*family*/,
Bool (* /*func*/ )(
#if NeedNestedPrototypes
unsigned char * /* addr */,
short /* len */,
pointer /* closure */
#endif
),
pointer /*closure*/
#endif
);
extern int RemoveHost(
#if NeedFunctionPrototypes
ClientPtr /*client*/,
int /*family*/,
unsigned /*length*/,
pointer /*pAddr*/
#endif
);
extern int GetHosts(
#if NeedFunctionPrototypes
pointer * /*data*/,
int * /*pnHosts*/,
int * /*pLen*/,
BOOL * /*pEnabled*/
#endif
);
typedef struct sockaddr * sockaddrPtr;
extern int InvalidHost(
#if NeedFunctionPrototypes
sockaddrPtr /*saddr*/,
int /*len*/
#endif
);
extern int LocalClient(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
extern int ChangeAccessControl(
#if NeedFunctionPrototypes
ClientPtr /*client*/,
int /*fEnabled*/
#endif
);
extern int GetAccessControl(
#if NeedFunctionPrototypes
void
#endif
);
extern void AddLocalHosts(
#if NeedFunctionPrototypes
void
#endif
);
extern void ResetHosts(
#if NeedFunctionPrototypes
char *display
#endif
);
extern void EnableLocalHost(
#if NeedFunctionPrototypes
void
#endif
);
extern void DisableLocalHost(
#if NeedFunctionPrototypes
void
#endif
);
extern void AccessUsingXdmcp(
#if NeedFunctionPrototypes
void
#endif
);
extern void DefineSelf(
#if NeedFunctionPrototypes
int /*fd*/
#endif
);
extern void AugmentSelf(
#if NeedFunctionPrototypes
pointer /*from*/,
int /*len*/
#endif
);
extern void InitAuthorization(
#if NeedFunctionPrototypes
char * /*filename*/
#endif
);
extern int LoadAuthorization(
#if NeedFunctionPrototypes
void
#endif
);
extern void RegisterAuthorizations(
#if NeedFunctionPrototypes
void
#endif
);
extern XID CheckAuthorization(
#if NeedFunctionPrototypes
unsigned int /*namelength*/,
char * /*name*/,
unsigned int /*datalength*/,
char * /*data*/,
ClientPtr /*client*/,
char ** /*reason*/
#endif
);
extern void ResetAuthorization(
#if NeedFunctionPrototypes
void
#endif
);
extern int AddAuthorization(
#if NeedFunctionPrototypes
unsigned int /*name_length*/,
char * /*name*/,
unsigned int /*data_length*/,
char * /*data*/
#endif
);
extern XID GenerateAuthorization(
#if NeedFunctionPrototypes
unsigned int /* name_length */,
char * /* name */,
unsigned int /* data_length */,
char * /* data */,
unsigned int * /* data_length_return */,
char ** /* data_return */
#endif
);
extern void ExpandCommandLine(
#if NeedFunctionPrototypes
int * /*pargc*/,
char *** /*pargv*/
#endif
);
extern int ddxProcessArgument(
#if NeedFunctionPrototypes
int /*argc*/,
char * /*argv*/ [],
int /*i*/
#endif
);
/*
* idiom processing stuff
*/
xReqPtr PeekNextRequest(
#if NeedFunctionPrototypes
xReqPtr req, ClientPtr client, Bool readmore
#endif
);
void SkipRequests(
#if NeedFunctionPrototypes
xReqPtr req, ClientPtr client, int numskipped
#endif
);
/* int ReqLen(xReq *req, ClientPtr client)
* Given a pointer to a *complete* request, return its length in bytes.
* Note that if the request is a big request (as defined in the Big
* Requests extension), the macro lies by returning 4 less than the
* length that it actually occupies in the request buffer. This is so you
* can blindly compare the length with the various sz_<request> constants
* in Xproto.h without having to know/care about big requests.
*/
#define ReqLen(_pxReq, _client) \
((_pxReq->length ? \
(_client->swapped ? lswaps(_pxReq->length) : _pxReq->length) \
: ((_client->swapped ? \
lswapl(((CARD32*)_pxReq)[1]) : ((CARD32*)_pxReq)[1])-1) \
) << 2)
/* otherReqTypePtr CastxReq(xReq *req, otherReqTypePtr)
* Cast the given request to one of type otherReqTypePtr to access
* fields beyond the length field.
*/
#define CastxReq(_pxReq, otherReqTypePtr) \
(_pxReq->length ? (otherReqTypePtr)_pxReq \
: (otherReqTypePtr)(((CARD32*)_pxReq)+1))
/* stuff for SkippedRequestsCallback */
extern CallbackListPtr SkippedRequestsCallback;
typedef struct {
xReqPtr req;
ClientPtr client;
int numskipped;
} SkippedRequestInfoRec;
/* stuff for ReplyCallback */
extern CallbackListPtr ReplyCallback;
typedef struct {
ClientPtr client;
pointer replyData;
unsigned long dataLenBytes;
unsigned long bytesRemaining;
Bool startOfReply;
} ReplyInfoRec;
/* stuff for FlushCallback */
extern CallbackListPtr FlushCallback;
#endif /* OS_H */

@ -0,0 +1,124 @@
/* $XConsortium: pixmap.h,v 5.6 94/04/17 20:25:53 dpw Exp $ */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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 PIXMAP_H
#define PIXMAP_H
#include "misc.h"
#include "screenint.h"
/* types for Drawable */
#define DRAWABLE_WINDOW 0
#define DRAWABLE_PIXMAP 1
#define UNDRAWABLE_WINDOW 2
#define DRAWABLE_BUFFER 3
/* flags to PaintWindow() */
#define PW_BACKGROUND 0
#define PW_BORDER 1
#define NullPixmap ((PixmapPtr)0)
typedef struct _Drawable *DrawablePtr;
typedef struct _Pixmap *PixmapPtr;
typedef union _PixUnion {
PixmapPtr pixmap;
unsigned long pixel;
} PixUnion;
#define SamePixUnion(a,b,isPixel)\
((isPixel) ? (a).pixel == (b).pixel : (a).pixmap == (b).pixmap)
#define EqualPixUnion(as, a, bs, b) \
((as) == (bs) && (SamePixUnion (a, b, as)))
#define OnScreenDrawable(type) \
((type == DRAWABLE_WINDOW) || (type == DRAWABLE_BUFFER))
#define WindowDrawable(type) \
((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW))
extern PixmapPtr GetScratchPixmapHeader(
#if NeedFunctionPrototypes
ScreenPtr /*pScreen*/,
int /*width*/,
int /*height*/,
int /*depth*/,
int /*bitsPerPixel*/,
int /*devKind*/,
pointer /*pPixData*/
#endif
);
extern void FreeScratchPixmapHeader(
#if NeedFunctionPrototypes
PixmapPtr /*pPixmap*/
#endif
);
extern Bool CreateScratchPixmapsForScreen(
#if NeedFunctionPrototypes
int /*scrnum*/
#endif
);
extern void FreeScratchPixmapsForScreen(
#if NeedFunctionPrototypes
int /*scrnum*/
#endif
);
extern PixmapPtr AllocatePixmap(
#if NeedFunctionPrototypes
ScreenPtr /*pScreen*/,
int /*pixDataSize*/
#endif
);
#endif /* PIXMAP_H */

@ -0,0 +1,54 @@
/* $XConsortium: region.h,v 1.5 94/04/17 20:25:59 dpw Exp $ */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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 REGION_H
#define REGION_H
#include "regionstr.h"
#endif /* REGION_H */

@ -0,0 +1,409 @@
/* $XConsortium: regionstr.h,v 1.8 94/04/17 20:26:01 dpw Exp $ */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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 REGIONSTRUCT_H
#define REGIONSTRUCT_H
#include "miscstruct.h"
/* Return values from RectIn() */
#define rgnOUT 0
#define rgnIN 1
#define rgnPART 2
#define NullRegion ((RegionPtr)0)
/*
* clip region
*/
typedef struct _RegData {
long size;
long numRects;
/* BoxRec rects[size]; in memory but not explicitly declared */
} RegDataRec, *RegDataPtr;
typedef struct _Region {
BoxRec extents;
RegDataPtr data;
} RegionRec, *RegionPtr;
extern BoxRec miEmptyBox;
extern RegDataRec miEmptyData;
#define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)
#define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)
#define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
#define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \
: &(reg)->extents)
#define REGION_BOXPTR(reg) ((BoxPtr)((reg)->data + 1))
#define REGION_BOX(reg,i) (&REGION_BOXPTR(reg)[i])
#define REGION_TOP(reg) REGION_BOX(reg, (reg)->data->numRects)
#define REGION_END(reg) REGION_BOX(reg, (reg)->data->numRects - 1)
#define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)))
#ifdef NEED_SCREEN_REGIONS
#define REGION_CREATE(_pScreen, _rect, _size) \
(*(_pScreen)->RegionCreate)(_rect, _size)
#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
(*(_pScreen)->RegionInit)(_pReg, _rect, _size)
#define REGION_COPY(_pScreen, dst, src) \
(*(_pScreen)->RegionCopy)(dst, src)
#define REGION_DESTROY(_pScreen, _pReg) \
(*(_pScreen)->RegionDestroy)(_pReg)
#define REGION_UNINIT(_pScreen, _pReg) \
(*(_pScreen)->RegionUninit)(_pReg)
#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \
(*(_pScreen)->Intersect)(newReg, reg1, reg2)
#define REGION_UNION(_pScreen, newReg, reg1, reg2) \
(*(_pScreen)->Union)(newReg, reg1, reg2)
#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \
(*(_pScreen)->Subtract)(newReg, reg1, reg2)
#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \
(*(_pScreen)->Inverse)(newReg, reg1, invRect)
#define REGION_RESET(_pScreen, _pReg, _pBox) \
(*(_pScreen)->RegionReset)(_pReg, _pBox)
#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \
(*(_pScreen)->TranslateRegion)(_pReg, _x, _y)
#define RECT_IN_REGION(_pScreen, _pReg, prect) \
(*(_pScreen)->RectIn)(_pReg, prect)
#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \
(*(_pScreen)->PointInRegion)(_pReg, _x, _y, prect)
#define REGION_NOTEMPTY(_pScreen, _pReg) \
(*(_pScreen)->RegionNotEmpty)(_pReg)
#define REGION_EMPTY(_pScreen, _pReg) \
(*(_pScreen)->RegionEmpty)(_pReg)
#define REGION_EXTENTS(_pScreen, _pReg) \
(*(_pScreen)->RegionExtents)(_pReg)
#define REGION_APPEND(_pScreen, dstrgn, rgn) \
(*(_pScreen)->RegionAppend)(dstrgn, rgn)
#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \
(*(_pScreen)->RegionValidate)(badreg, pOverlap)
#define BITMAP_TO_REGION(_pScreen, pPix) \
(*(_pScreen)->BitmapToRegion)(pPix)
#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \
(*(_pScreen)->RectsToRegion)(nrects, prect, ctype)
#else /* !NEED_SCREEN_REGIONS */
#define REGION_CREATE(_pScreen, _rect, _size) \
miRegionCreate(_rect, _size)
#define REGION_COPY(_pScreen, dst, src) \
miRegionCopy(dst, src)
#define REGION_DESTROY(_pScreen, _pReg) \
miRegionDestroy(_pReg)
#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \
miIntersect(newReg, reg1, reg2)
#define REGION_UNION(_pScreen, newReg, reg1, reg2) \
miUnion(newReg, reg1, reg2)
#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \
miSubtract(newReg, reg1, reg2)
#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \
miInverse(newReg, reg1, invRect)
#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \
miTranslateRegion(_pReg, _x, _y)
#define RECT_IN_REGION(_pScreen, _pReg, prect) \
miRectIn(_pReg, prect)
#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \
miPointInRegion(_pReg, _x, _y, prect)
#define REGION_APPEND(_pScreen, dstrgn, rgn) \
miRegionAppend(dstrgn, rgn)
#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \
miRegionValidate(badreg, pOverlap)
#define BITMAP_TO_REGION(_pScreen, pPix) \
(*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */
#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \
miRectsToRegion(nrects, prect, ctype)
#ifdef DONT_INLINE_REGION_OPS
#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
miRegionInit(_pReg, _rect, _size)
#define REGION_UNINIT(_pScreen, _pReg) \
miRegionUninit(_pReg)
#define REGION_RESET(_pScreen, _pReg, _pBox) \
miRegionReset(_pReg, _pBox)
#define REGION_NOTEMPTY(_pScreen, _pReg) \
miRegionNotEmpty(_pReg)
#define REGION_EMPTY(_pScreen, _pReg) \
miRegionEmpty(_pReg)
#define REGION_EXTENTS(_pScreen, _pReg) \
miRegionExtents(_pReg)
#else /* inline certain simple region ops for performance */
#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
{ \
if (_rect) \
{ \
(_pReg)->extents = *(_rect); \
(_pReg)->data = (RegDataPtr)NULL; \
} \
else \
{ \
(_pReg)->extents = miEmptyBox; \
if (((_size) > 1) && ((_pReg)->data = \
(RegDataPtr)xalloc(REGION_SZOF(_size)))) \
{ \
(_pReg)->data->size = (_size); \
(_pReg)->data->numRects = 0; \
} \
else \
(_pReg)->data = &miEmptyData; \
} \
}
#define REGION_UNINIT(_pScreen, _pReg) \
{ \
if ((_pReg)->data && (_pReg)->data->size) xfree((_pReg)->data); \
}
#define REGION_RESET(_pScreen, _pReg, _pBox) \
{ \
(_pReg)->extents = *(_pBox); \
REGION_UNINIT(_pScreen, _pReg); \
(_pReg)->data = (RegDataPtr)NULL; \
}
#define REGION_NOTEMPTY(_pScreen, _pReg) \
!REGION_NIL(_pReg)
#define REGION_EMPTY(_pScreen, _pReg) \
{ \
REGION_UNINIT(_pScreen, _pReg); \
(_pReg)->extents.x2 = (_pReg)->extents.x1; \
(_pReg)->extents.y2 = (_pReg)->extents.y1; \
(_pReg)->data = &miEmptyData; \
}
#define REGION_EXTENTS(_pScreen, _pReg) \
&(_pReg)->extents
#endif /* DONT_INLINE_REGION_OPS */
#endif /* NEED_SCREEN_REGIONS */
/* moved from mi.h */
extern RegionPtr miRegionCreate(
#if NeedFunctionPrototypes
BoxPtr /*rect*/,
int /*size*/
#endif
);
extern void miRegionInit(
#if NeedFunctionPrototypes
RegionPtr /*pReg*/,
BoxPtr /*rect*/,
int /*size*/
#endif
);
extern void miRegionDestroy(
#if NeedFunctionPrototypes
RegionPtr /*pReg*/
#endif
);
extern void miRegionUninit(
#if NeedFunctionPrototypes
RegionPtr /*pReg*/
#endif
);
extern Bool miRegionCopy(
#if NeedFunctionPrototypes
RegionPtr /*dst*/,
RegionPtr /*src*/
#endif
);
extern Bool miIntersect(
#if NeedFunctionPrototypes
RegionPtr /*newReg*/,
RegionPtr /*reg1*/,
RegionPtr /*reg2*/
#endif
);
extern Bool miUnion(
#if NeedFunctionPrototypes
RegionPtr /*newReg*/,
RegionPtr /*reg1*/,
RegionPtr /*reg2*/
#endif
);
extern Bool miRegionAppend(
#if NeedFunctionPrototypes
RegionPtr /*dstrgn*/,
RegionPtr /*rgn*/
#endif
);
extern Bool miRegionValidate(
#if NeedFunctionPrototypes
RegionPtr /*badreg*/,
Bool * /*pOverlap*/
#endif
);
extern RegionPtr miRectsToRegion(
#if NeedFunctionPrototypes
int /*nrects*/,
xRectanglePtr /*prect*/,
int /*ctype*/
#endif
);
extern Bool miSubtract(
#if NeedFunctionPrototypes
RegionPtr /*regD*/,
RegionPtr /*regM*/,
RegionPtr /*regS*/
#endif
);
extern Bool miInverse(
#if NeedFunctionPrototypes
RegionPtr /*newReg*/,
RegionPtr /*reg1*/,
BoxPtr /*invRect*/
#endif
);
extern int miRectIn(
#if NeedFunctionPrototypes
RegionPtr /*region*/,
BoxPtr /*prect*/
#endif
);
extern void miTranslateRegion(
#if NeedFunctionPrototypes
RegionPtr /*pReg*/,
int /*x*/,
int /*y*/
#endif
);
extern void miRegionReset(
#if NeedFunctionPrototypes
RegionPtr /*pReg*/,
BoxPtr /*pBox*/
#endif
);
extern Bool miPointInRegion(
#if NeedFunctionPrototypes
RegionPtr /*pReg*/,
int /*x*/,
int /*y*/,
BoxPtr /*box*/
#endif
);
extern Bool miRegionNotEmpty(
#if NeedFunctionPrototypes
RegionPtr /*pReg*/
#endif
);
extern void miRegionEmpty(
#if NeedFunctionPrototypes
RegionPtr /*pReg*/
#endif
);
extern BoxPtr miRegionExtents(
#if NeedFunctionPrototypes
RegionPtr /*pReg*/
#endif
);
#endif /* REGIONSTRUCT_H */

@ -0,0 +1,171 @@
/* $XConsortium: screenint.h /main/6 1996/06/17 10:55:15 mor $ */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
******************************************************************/
/* $XFree86: xc/programs/Xserver/include/screenint.h,v 1.2 1997/01/14 22:22:40 dawes Exp $ */
#ifndef SCREENINT_H
#define SCREENINT_H
#include "misc.h"
typedef struct _PixmapFormat *PixmapFormatPtr;
typedef struct _Visual *VisualPtr;
typedef struct _Depth *DepthPtr;
typedef struct _Screen *ScreenPtr;
extern void ResetScreenPrivates(
#if NeedFunctionPrototypes
void
#endif
);
extern int AllocateScreenPrivateIndex(
#if NeedFunctionPrototypes
void
#endif
);
extern void ResetWindowPrivates(
#if NeedFunctionPrototypes
void
#endif
);
extern int AllocateWindowPrivateIndex(
#if NeedFunctionPrototypes
void
#endif
);
extern Bool AllocateWindowPrivate(
#if NeedFunctionPrototypes
ScreenPtr /* pScreen */,
int /* index */,
unsigned /* amount */
#endif
);
extern void ResetGCPrivates(
#if NeedFunctionPrototypes
void
#endif
);
extern int AllocateGCPrivateIndex(
#if NeedFunctionPrototypes
void
#endif
);
extern Bool AllocateGCPrivate(
#if NeedFunctionPrototypes
ScreenPtr /* pScreen */,
int /* index */,
unsigned /* amount */
#endif
);
extern int AddScreen(
#if NeedFunctionPrototypes
Bool (* /*pfnInit*/)(
#if NeedNestedPrototypes
int /*index*/,
ScreenPtr /*pScreen*/,
int /*argc*/,
char ** /*argv*/
#endif
),
int /*argc*/,
char** /*argv*/
#endif
);
#ifdef PIXPRIV
extern void ResetPixmapPrivates(
#if NeedFunctionPrototypes
void
#endif
);
extern int AllocatePixmapPrivateIndex(
#if NeedFunctionPrototypes
void
#endif
);
extern Bool AllocatePixmapPrivate(
#if NeedFunctionPrototypes
ScreenPtr /* pScreen */,
int /* index */,
unsigned /* amount */
#endif
);
#endif /* PIXPRIV */
extern void ResetColormapPrivates(
#if NeedFunctionPrototypes
void
#endif
);
typedef struct _ColormapRec *ColormapPtr;
typedef int (*InitCmapPrivFunc)(
#if NeedNestedPrototypes
ColormapPtr
#endif
);
extern int AllocateColormapPrivateIndex(
#if NeedFunctionPrototypes
InitCmapPrivFunc /* initPrivFunc */
#endif
);
#endif /* SCREENINT_H */

@ -0,0 +1,934 @@
/* $XConsortium: scrnintstr.h /main/32 1996/09/28 17:14:32 rws $ */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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 SCREENINTSTRUCT_H
#define SCREENINTSTRUCT_H
#include "screenint.h"
#include "miscstruct.h"
#include "region.h"
#include "pixmap.h"
#include "gc.h"
#include "colormap.h"
#include "cursor.h"
#include "validate.h"
#include "window.h"
#include "X11/Xproto.h"
#include "dix.h"
typedef struct _PixmapFormat {
unsigned char depth;
unsigned char bitsPerPixel;
unsigned char scanlinePad;
} PixmapFormatRec;
typedef struct _Visual {
VisualID vid;
short class;
short bitsPerRGBValue;
short ColormapEntries;
short nplanes;/* = log2 (ColormapEntries). This does not
* imply that the screen has this many planes.
* it may have more or fewer */
unsigned long redMask, greenMask, blueMask;
int offsetRed, offsetGreen, offsetBlue;
} VisualRec;
typedef struct _Depth {
unsigned char depth;
short numVids;
VisualID *vids; /* block of visual ids for this depth */
} DepthRec;
/*
* There is a typedef for each screen function pointer so that code that
* needs to declare a screen function pointer (e.g. in a screen private
* or as a local variable) can easily do so and retain full type checking.
*/
typedef Bool (* CloseScreenProcPtr)(
#if NeedNestedPrototypes
int /*index*/,
ScreenPtr /*pScreen*/
#endif
);
typedef void (* QueryBestSizeProcPtr)(
#if NeedNestedPrototypes
int /*class*/,
unsigned short * /*pwidth*/,
unsigned short * /*pheight*/,
ScreenPtr /*pScreen*/
#endif
);
typedef Bool (* SaveScreenProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
int /*on*/
#endif
);
typedef void (* GetImageProcPtr)(
#if NeedNestedPrototypes
DrawablePtr /*pDrawable*/,
int /*sx*/,
int /*sy*/,
int /*w*/,
int /*h*/,
unsigned int /*format*/,
unsigned long /*planeMask*/,
char * /*pdstLine*/
#endif
);
typedef void (* GetSpansProcPtr)(
#if NeedNestedPrototypes
DrawablePtr /*pDrawable*/,
int /*wMax*/,
DDXPointPtr /*ppt*/,
int* /*pwidth*/,
int /*nspans*/,
char * /*pdstStart*/
#endif
);
typedef void (* PointerNonInterestBoxProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
BoxPtr /*pBox*/
#endif
);
typedef void (* SourceValidateProcPtr)(
#if NeedNestedPrototypes
DrawablePtr /*pDrawable*/,
int /*x*/,
int /*y*/,
int /*width*/,
int /*height*/
#endif
);
typedef Bool (* CreateWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/
#endif
);
typedef Bool (* DestroyWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/
#endif
);
typedef Bool (* PositionWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
int /*x*/,
int /*y*/
#endif
);
typedef Bool (* ChangeWindowAttributesProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
unsigned long /*mask*/
#endif
);
typedef Bool (* RealizeWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/
#endif
);
typedef Bool (* UnrealizeWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/
#endif
);
typedef int (* ValidateTreeProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pParent*/,
X11WindowPtr /*pChild*/,
VTKind /*kind*/
#endif
);
typedef void (* PostValidateTreeProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pParent*/,
X11WindowPtr /*pChild*/,
VTKind /*kind*/
#endif
);
typedef void (* WindowExposuresProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
RegionPtr /*prgn*/,
RegionPtr /*other_exposed*/
#endif
);
typedef void (* PaintWindowBackgroundProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
RegionPtr /*pRegion*/,
int /*what*/
#endif
);
typedef void (* PaintWindowBorderProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
RegionPtr /*pRegion*/,
int /*what*/
#endif
);
typedef void (* CopyWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
DDXPointRec /*ptOldOrg*/,
RegionPtr /*prgnSrc*/
#endif
);
typedef void (* ClearToBackgroundProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
int /*x*/,
int /*y*/,
int /*w*/,
int /*h*/,
Bool /*generateExposures*/
#endif
);
typedef void (* ClipNotifyProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
int /*dx*/,
int /*dy*/
#endif
);
typedef PixmapPtr (* CreatePixmapProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
int /*width*/,
int /*height*/,
int /*depth*/
#endif
);
typedef Bool (* DestroyPixmapProcPtr)(
#if NeedNestedPrototypes
PixmapPtr /*pPixmap*/
#endif
);
typedef void (* SaveDoomedAreasProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
RegionPtr /*prgnSave*/,
int /*xorg*/,
int /*yorg*/
#endif
);
typedef RegionPtr (* RestoreAreasProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
RegionPtr /*prgnRestore*/
#endif
);
typedef void (* ExposeCopyProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pSrc*/,
DrawablePtr /*pDst*/,
GCPtr /*pGC*/,
RegionPtr /*prgnExposed*/,
int /*srcx*/,
int /*srcy*/,
int /*dstx*/,
int /*dsty*/,
unsigned long /*plane*/
#endif
);
typedef RegionPtr (* TranslateBackingStoreProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
int /*windx*/,
int /*windy*/,
RegionPtr /*oldClip*/,
int /*oldx*/,
int /*oldy*/
#endif
);
typedef RegionPtr (* ClearBackingStoreProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
int /*x*/,
int /*y*/,
int /*w*/,
int /*h*/,
Bool /*generateExposures*/
#endif
);
typedef void (* DrawGuaranteeProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWindow*/,
GCPtr /*pGC*/,
int /*guarantee*/
#endif
);
typedef Bool (* RealizeFontProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
FontPtr /*pFont*/
#endif
);
typedef Bool (* UnrealizeFontProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
FontPtr /*pFont*/
#endif
);
typedef void (* ConstrainCursorProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
BoxPtr /*pBox*/
#endif
);
typedef void (* CursorLimitsProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
CursorPtr /*pCursor*/,
BoxPtr /*pHotBox*/,
BoxPtr /*pTopLeftBox*/
#endif
);
typedef Bool (* DisplayCursorProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
CursorPtr /*pCursor*/
#endif
);
typedef Bool (* RealizeCursorProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
CursorPtr /*pCursor*/
#endif
);
typedef Bool (* UnrealizeCursorProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
CursorPtr /*pCursor*/
#endif
);
typedef void (* RecolorCursorProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
CursorPtr /*pCursor*/,
Bool /*displayed*/
#endif
);
typedef Bool (* SetCursorPositionProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
int /*x*/,
int /*y*/,
Bool /*generateEvent*/
#endif
);
typedef Bool (* CreateGCProcPtr)(
#if NeedNestedPrototypes
GCPtr /*pGC*/
#endif
);
typedef Bool (* CreateColormapProcPtr)(
#if NeedNestedPrototypes
ColormapPtr /*pColormap*/
#endif
);
typedef void (* DestroyColormapProcPtr)(
#if NeedNestedPrototypes
ColormapPtr /*pColormap*/
#endif
);
typedef void (* InstallColormapProcPtr)(
#if NeedNestedPrototypes
ColormapPtr /*pColormap*/
#endif
);
typedef void (* UninstallColormapProcPtr)(
#if NeedNestedPrototypes
ColormapPtr /*pColormap*/
#endif
);
typedef int (* ListInstalledColormapsProcPtr) (
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/,
XID* /*pmaps */
#endif
);
typedef void (* StoreColorsProcPtr)(
#if NeedNestedPrototypes
ColormapPtr /*pColormap*/,
int /*ndef*/,
xColorItem * /*pdef*/
#endif
);
typedef void (* ResolveColorProcPtr)(
#if NeedNestedPrototypes
unsigned short* /*pred*/,
unsigned short* /*pgreen*/,
unsigned short* /*pblue*/,
VisualPtr /*pVisual*/
#endif
);
typedef RegionPtr (* RegionCreateProcPtr)(
#if NeedNestedPrototypes
BoxPtr /*rect*/,
int /*size*/
#endif
);
typedef void (* RegionInitProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*pReg*/,
BoxPtr /*rect*/,
int /*size*/
#endif
);
typedef Bool (* RegionCopyProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*dst*/,
RegionPtr /*src*/
#endif
);
typedef void (* RegionDestroyProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*pReg*/
#endif
);
typedef void (* RegionUninitProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*pReg*/
#endif
);
typedef Bool (* IntersectProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*newReg*/,
RegionPtr /*reg1*/,
RegionPtr /*reg2*/
#endif
);
typedef Bool (* UnionProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*newReg*/,
RegionPtr /*reg1*/,
RegionPtr /*reg2*/
#endif
);
typedef Bool (* SubtractProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*regD*/,
RegionPtr /*regM*/,
RegionPtr /*regS*/
#endif
);
typedef Bool (* InverseProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*newReg*/,
RegionPtr /*reg1*/,
BoxPtr /*invRect*/
#endif
);
typedef void (* RegionResetProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*pReg*/,
BoxPtr /*pBox*/
#endif
);
typedef void (* TranslateRegionProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*pReg*/,
int /*x*/,
int /*y*/
#endif
);
typedef int (* RectInProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*region*/,
BoxPtr /*prect*/
#endif
);
typedef Bool (* PointInRegionProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*pReg*/,
int /*x*/,
int /*y*/,
BoxPtr /*box*/
#endif
);
typedef Bool (* RegionNotEmptyProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*pReg*/
#endif
);
typedef void (* RegionEmptyProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*pReg*/
#endif
);
typedef BoxPtr (* RegionExtentsProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*pReg*/
#endif
);
typedef Bool (* RegionAppendProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*dstrgn*/,
RegionPtr /*rgn*/
#endif
);
typedef Bool (* RegionValidateProcPtr)(
#if NeedNestedPrototypes
RegionPtr /*badreg*/,
Bool* /*pOverlap*/
#endif
);
typedef RegionPtr (* BitmapToRegionProcPtr)(
#if NeedNestedPrototypes
PixmapPtr /*pPix*/
#endif
);
typedef RegionPtr (* RectsToRegionProcPtr)(
#if NeedNestedPrototypes
int /*nrects*/,
xRectangle* /*prect*/,
int /*ctype*/
#endif
);
typedef void (* SendGraphicsExposeProcPtr)(
#if NeedNestedPrototypes
ClientPtr /*client*/,
RegionPtr /*pRgn*/,
XID /*drawable*/,
int /*major*/,
int /*minor*/
#endif
);
typedef void (* ScreenBlockHandlerProcPtr)(
#if NeedNestedPrototypes
int /*screenNum*/,
pointer /*blockData*/,
struct timeval ** /*pTimeout*/,
pointer /*pReadmask*/
#endif
);
typedef void (* ScreenWakeupHandlerProcPtr)(
#if NeedNestedPrototypes
int /*screenNum*/,
pointer /*wakeupData*/,
unsigned long /*result*/,
pointer /*pReadMask*/
#endif
);
typedef Bool (* CreateScreenResourcesProcPtr)(
#if NeedNestedPrototypes
ScreenPtr /*pScreen*/
#endif
);
typedef Bool (* ModifyPixmapHeaderProcPtr)(
#if NeedNestedPrototypes
PixmapPtr /*pPixmap*/,
int /*width*/,
int /*height*/,
int /*depth*/,
int /*bitsPerPixel*/,
int /*devKind*/,
pointer /*pPixData*/
#endif
);
typedef void (* MarkWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWin*/
#endif
);
typedef Bool (* MarkOverlappedWindowsProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*parent*/,
X11WindowPtr /*firstChild*/,
X11WindowPtr * /*pLayerWin*/
#endif
);
typedef Bool (* ChangeSaveUnderProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pLayerWin*/,
X11WindowPtr /*firstChild*/
#endif
);
typedef void (* PostChangeSaveUnderProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pLayerWin*/,
X11WindowPtr /*firstChild*/
#endif
);
typedef void (* MoveWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWin*/,
int /*x*/,
int /*y*/,
X11WindowPtr /*pSib*/,
VTKind /*kind*/
#endif
);
typedef void (* ResizeWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWin*/,
int /*x*/,
int /*y*/,
unsigned int /*w*/,
unsigned int /*h*/,
X11WindowPtr /*pSib*/
#endif
);
typedef X11WindowPtr (* GetLayerWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWin*/
#endif
);
typedef void (* HandleExposuresProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWin*/
#endif
);
typedef void (* ReparentWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWin*/,
X11WindowPtr /*pPriorParent*/
#endif
);
#ifdef SHAPE
typedef void (* SetShapeProcPtr)(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
#endif /* SHAPE */
typedef void (* ChangeBorderWidthProcPtr)(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
unsigned int /*width*/
#endif
);
typedef void (* MarkUnrealizedWindowProcPtr)(
#if NeedFunctionPrototypes
X11WindowPtr /*pChild*/,
X11WindowPtr /*pWin*/,
Bool /*fromConfigure*/
#endif
);
typedef struct _Screen {
int myNum; /* index of this instance in Screens[] */
ATOM id;
short width, height;
short mmWidth, mmHeight;
short numDepths;
unsigned char rootDepth;
DepthPtr allowedDepths;
unsigned long rootVisual;
unsigned long defColormap;
short minInstalledCmaps, maxInstalledCmaps;
char backingStoreSupport, saveUnderSupport;
unsigned long whitePixel, blackPixel;
unsigned long rgf; /* array of flags; she's -- HUNGARIAN */
GCPtr GCperDepth[MAXFORMATS+1];
/* next field is a stipple to use as default in
a GC. we don't build default tiles of all depths
because they are likely to be of a color
different from the default fg pixel, so
we don't win anything by building
a standard one.
*/
PixmapPtr PixmapPerDepth[1];
pointer devPrivate;
short numVisuals;
VisualPtr visuals;
int WindowPrivateLen;
unsigned *WindowPrivateSizes;
unsigned totalWindowSize;
int GCPrivateLen;
unsigned *GCPrivateSizes;
unsigned totalGCSize;
/* Random screen procedures */
CloseScreenProcPtr CloseScreen;
QueryBestSizeProcPtr QueryBestSize;
SaveScreenProcPtr SaveScreen;
GetImageProcPtr GetImage;
GetSpansProcPtr GetSpans;
PointerNonInterestBoxProcPtr PointerNonInterestBox;
SourceValidateProcPtr SourceValidate;
/* Window Procedures */
CreateWindowProcPtr CreateWindow;
DestroyWindowProcPtr DestroyWindow;
PositionWindowProcPtr PositionWindow;
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
RealizeWindowProcPtr RealizeWindow;
UnrealizeWindowProcPtr UnrealizeWindow;
ValidateTreeProcPtr ValidateTree;
PostValidateTreeProcPtr PostValidateTree;
WindowExposuresProcPtr WindowExposures;
PaintWindowBackgroundProcPtr PaintWindowBackground;
PaintWindowBorderProcPtr PaintWindowBorder;
CopyWindowProcPtr CopyWindow;
ClearToBackgroundProcPtr ClearToBackground;
ClipNotifyProcPtr ClipNotify;
/* Pixmap procedures */
CreatePixmapProcPtr CreatePixmap;
DestroyPixmapProcPtr DestroyPixmap;
/* Backing store procedures */
SaveDoomedAreasProcPtr SaveDoomedAreas;
RestoreAreasProcPtr RestoreAreas;
ExposeCopyProcPtr ExposeCopy;
TranslateBackingStoreProcPtr TranslateBackingStore;
ClearBackingStoreProcPtr ClearBackingStore;
DrawGuaranteeProcPtr DrawGuarantee;
/* Font procedures */
RealizeFontProcPtr RealizeFont;
UnrealizeFontProcPtr UnrealizeFont;
/* Cursor Procedures */
ConstrainCursorProcPtr ConstrainCursor;
CursorLimitsProcPtr CursorLimits;
DisplayCursorProcPtr DisplayCursor;
RealizeCursorProcPtr RealizeCursor;
UnrealizeCursorProcPtr UnrealizeCursor;
RecolorCursorProcPtr RecolorCursor;
SetCursorPositionProcPtr SetCursorPosition;
/* GC procedures */
CreateGCProcPtr CreateGC;
/* Colormap procedures */
CreateColormapProcPtr CreateColormap;
DestroyColormapProcPtr DestroyColormap;
InstallColormapProcPtr InstallColormap;
UninstallColormapProcPtr UninstallColormap;
ListInstalledColormapsProcPtr ListInstalledColormaps;
StoreColorsProcPtr StoreColors;
ResolveColorProcPtr ResolveColor;
/* Region procedures */
RegionCreateProcPtr RegionCreate;
RegionInitProcPtr RegionInit;
RegionCopyProcPtr RegionCopy;
RegionDestroyProcPtr RegionDestroy;
RegionUninitProcPtr RegionUninit;
IntersectProcPtr Intersect;
UnionProcPtr Union;
SubtractProcPtr Subtract;
InverseProcPtr Inverse;
RegionResetProcPtr RegionReset;
TranslateRegionProcPtr TranslateRegion;
RectInProcPtr RectIn;
PointInRegionProcPtr PointInRegion;
RegionNotEmptyProcPtr RegionNotEmpty;
RegionEmptyProcPtr RegionEmpty;
RegionExtentsProcPtr RegionExtents;
RegionAppendProcPtr RegionAppend;
RegionValidateProcPtr RegionValidate;
BitmapToRegionProcPtr BitmapToRegion;
RectsToRegionProcPtr RectsToRegion;
SendGraphicsExposeProcPtr SendGraphicsExpose;
/* os layer procedures */
ScreenBlockHandlerProcPtr BlockHandler;
ScreenWakeupHandlerProcPtr WakeupHandler;
pointer blockData;
pointer wakeupData;
/* anybody can get a piece of this array */
DevUnion *devPrivates;
CreateScreenResourcesProcPtr CreateScreenResources;
ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
#ifdef PIXPRIV
int PixmapPrivateLen;
unsigned *PixmapPrivateSizes;
unsigned totalPixmapSize;
#endif
MarkWindowProcPtr MarkWindow;
MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
ChangeSaveUnderProcPtr ChangeSaveUnder;
PostChangeSaveUnderProcPtr PostChangeSaveUnder;
MoveWindowProcPtr MoveWindow;
ResizeWindowProcPtr ResizeWindow;
GetLayerWindowProcPtr GetLayerWindow;
HandleExposuresProcPtr HandleExposures;
ReparentWindowProcPtr ReparentWindow;
#ifdef SHAPE
SetShapeProcPtr SetShape;
#endif /* SHAPE */
ChangeBorderWidthProcPtr ChangeBorderWidth;
MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
} ScreenRec;
typedef struct _ScreenInfo {
int imageByteOrder;
int bitmapScanlineUnit;
int bitmapScanlinePad;
int bitmapBitOrder;
int numPixmapFormats;
PixmapFormatRec
formats[MAXFORMATS];
int arraySize;
int numScreens;
ScreenPtr screens[MAXSCREENS];
int numVideoScreens;
} ScreenInfo;
extern ScreenInfo screenInfo;
extern void InitOutput(
#if NeedFunctionPrototypes
ScreenInfo * /*pScreenInfo*/,
int /*argc*/,
char ** /*argv*/
#endif
);
#endif /* SCREENINTSTRUCT_H */

@ -0,0 +1,42 @@
/* $XConsortium: validate.h,v 5.4 94/04/17 20:26:11 dpw Exp $ */
/*
Copyright (c) 1989 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
#ifndef VALIDATE_H
#define VALIDATE_H
#include "miscstruct.h"
#include "regionstr.h"
typedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap } VTKind;
/* union _Validate is now device dependent; see mivalidate.h for an example */
typedef union _Validate *ValidatePtr;
#define UnmapValData ((ValidatePtr)1)
#endif /* VALIDATE_H */

@ -0,0 +1,351 @@
/* $XConsortium: window.h /main/8 1996/03/21 13:35:33 mor $ */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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 WINDOW_H
#define WINDOW_H
#include "misc.h"
#include "region.h"
#include "screenint.h"
#include "X11/Xproto.h"
#define TOTALLY_OBSCURED 0
#define UNOBSCURED 1
#define OBSCURED 2
#define VisibilityNotViewable 3
/* return values for tree-walking callback procedures */
#define WT_STOPWALKING 0
#define WT_WALKCHILDREN 1
#define WT_DONTWALKCHILDREN 2
#define WT_NOMATCH 3
#define NullWindow ((X11WindowPtr) 0)
typedef struct _BackingStore *BackingStorePtr;
typedef struct _Window *X11WindowPtr; /* conflict with CoreGraphics */
typedef int (*VisitWindowProcPtr)(
#if NeedNestedPrototypes
X11WindowPtr /*pWin*/,
pointer /*data*/
#endif
);
extern int TraverseTree(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
VisitWindowProcPtr /*func*/,
pointer /*data*/
#endif
);
extern int WalkTree(
#if NeedFunctionPrototypes
ScreenPtr /*pScreen*/,
VisitWindowProcPtr /*func*/,
pointer /*data*/
#endif
);
extern X11WindowPtr AllocateWindow(
#if NeedFunctionPrototypes
ScreenPtr /*pScreen*/
#endif
);
extern Bool CreateRootWindow(
#if NeedFunctionPrototypes
ScreenPtr /*pScreen*/
#endif
);
extern void InitRootWindow(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
extern void ClippedRegionFromBox(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
RegionPtr /*Rgn*/,
int /*x*/,
int /*y*/,
int /*w*/,
int /*h*/
#endif
);
extern X11WindowPtr RealChildHead(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
extern X11WindowPtr CreateWindow(
#if NeedFunctionPrototypes
Window /*wid*/,
X11WindowPtr /*pParent*/,
int /*x*/,
int /*y*/,
unsigned int /*w*/,
unsigned int /*h*/,
unsigned int /*bw*/,
unsigned int /*class*/,
Mask /*vmask*/,
XID* /*vlist*/,
int /*depth*/,
ClientPtr /*client*/,
VisualID /*visual*/,
int* /*error*/
#endif
);
extern int DeleteWindow(
#if NeedFunctionPrototypes
pointer /*pWin*/,
XID /*wid*/
#endif
);
extern void DestroySubwindows(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
ClientPtr /*client*/
#endif
);
extern int X11ChangeWindowAttributes(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
Mask /*vmask*/,
XID* /*vlist*/,
ClientPtr /*client*/
#endif
);
extern void X11GetWindowAttributes(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
ClientPtr /*client*/,
xGetWindowAttributesReply* /* wa */
#endif
);
extern RegionPtr CreateUnclippedWinSize(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
extern void GravityTranslate(
#if NeedFunctionPrototypes
int /*x*/,
int /*y*/,
int /*oldx*/,
int /*oldy*/,
int /*dw*/,
int /*dh*/,
unsigned /*gravity*/,
int* /*destx*/,
int* /*desty*/
#endif
);
extern int ConfigureWindow(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
Mask /*mask*/,
XID* /*vlist*/,
ClientPtr /*client*/
#endif
);
extern int CirculateWindow(
#if NeedFunctionPrototypes
X11WindowPtr /*pParent*/,
int /*direction*/,
ClientPtr /*client*/
#endif
);
extern int ReparentWindow(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
X11WindowPtr /*pParent*/,
int /*x*/,
int /*y*/,
ClientPtr /*client*/
#endif
);
extern int MapWindow(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
ClientPtr /*client*/
#endif
);
extern void MapSubwindows(
#if NeedFunctionPrototypes
X11WindowPtr /*pParent*/,
ClientPtr /*client*/
#endif
);
extern int UnmapWindow(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
Bool /*fromConfigure*/
#endif
);
extern void UnmapSubwindows(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
extern void HandleSaveSet(
#if NeedFunctionPrototypes
ClientPtr /*client*/
#endif
);
extern Bool VisibleBoundingBoxFromPoint(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
int /*x*/,
int /*y*/,
BoxPtr /*box*/
#endif
);
extern Bool PointInWindowIsVisible(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
int /*x*/,
int /*y*/
#endif
);
extern RegionPtr NotClippedByChildren(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
extern void SendVisibilityNotify(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
extern void SaveScreens(
#if NeedFunctionPrototypes
int /*on*/,
int /*mode*/
#endif
);
extern X11WindowPtr FindWindowWithOptional(
#if NeedFunctionPrototypes
X11WindowPtr /*w*/
#endif
);
extern void CheckWindowOptionalNeed(
#if NeedFunctionPrototypes
X11WindowPtr /*w*/
#endif
);
extern Bool MakeWindowOptional(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
extern void DisposeWindowOptional(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
extern X11WindowPtr MoveWindowInStack(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
X11WindowPtr /*pNextSib*/
#endif
);
void SetWinSize(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
void SetBorderSize(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
void ResizeChildrenWinSize(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/,
int /*dx*/,
int /*dy*/,
int /*dw*/,
int /*dh*/
#endif
);
#endif /* WINDOW_H */

@ -0,0 +1,31 @@
/*
* kbdptr.c - deal with keyboard and pointer device over TCP & UDP.
*
*
*/
/*
* OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.
* Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.
* All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include <X11/keysym.h>
#include "rfb.h"

@ -0,0 +1,16 @@
#ifdef SunArchitecture
CC = gcc
CCOPTIONS =
CDEBUGFLAGS = -O2
#endif
SRCS = vncauth.c d3des.c
OBJS = vncauth.o d3des.o
INCLUDES = -I. -I../include
NormalLibraryTarget(vncauth,$(OBJS))
DependTarget()

@ -0,0 +1,9 @@
OBJS=vncauth.o d3des.o
CFLAGS=-I.
all: libvncauth.a
libvncauth.a: $(OBJS)
$(AR) clq $@ $(OBJS)

@ -0,0 +1,440 @@
/*
* This is D3DES (V5.09) by Richard Outerbridge with the double and
* triple-length support removed for use in VNC. Also the bytebit[] array
* has been reversed so that the most significant bit in each byte of the
* key is ignored, not the least significant.
*
* These changes are:
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/* D3DES (V5.09) -
*
* A portable, public domain, version of the Data Encryption Standard.
*
* Written with Symantec's THINK (Lightspeed) C by Richard Outerbridge.
* Thanks to: Dan Hoey for his excellent Initial and Inverse permutation
* code; Jim Gillogly & Phil Karn for the DES key schedule code; Dennis
* Ferguson, Eric Young and Dana How for comparing notes; and Ray Lau,
* for humouring me on.
*
* Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.
* (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.
*/
#include "d3des.h"
static void scrunch(unsigned char *, unsigned long *);
static void unscrun(unsigned long *, unsigned char *);
static void desfunc(unsigned long *, unsigned long *);
static void cookey(unsigned long *);