diff -c mit/server/Imakefile:1.1.1.2 mit/server/Imakefile:2.15
*** mit/server/Imakefile:1.1.1.2	Sat Mar 12 00:34:46 1994
--- mit/server/Imakefile	Sat Mar 12 00:34:46 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/server/Imakefile,v 2.15 1993/10/07 13:53:44 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.135 91/09/22 10:27:51 rws Exp $
  /*
   * Server Master Makefile
***************
*** 9,14 ****
--- 10,17 ----
  #define MFBSubdirs StdSubdirs ddx/mfb
  #define CFBSubdirs MFBSubdirs ddx/cfb
  #define StdLibs $(DIX) $(OS) $(MI) $(EXTENSIONS)
+ #define NoMFBLibs $(DIX) $(OS) $(FONT) $(MI) $(EXTENSIONS)
+ #define NoMFBBareLibs $(DIX) $(OS) $(FONT) $(MI)
  #define MFBBareLibs $(DIX) $(OS) $(FONT) $(MFB) $(MI)
  #define MFBLibs MFBBareLibs $(EXTENSIONS)
  #define CFBBareLibs $(DIX) $(OS) $(FONT) $(CFB) $(MFB) $(MI)
***************
*** 35,41 ****
--- 38,48 ----
       NONPEXEXTS = $(OTHEREXTS) $(EXTENSIONSRC)/server/libext.a
       EXTENSIONS = $(NONPEXEXTS) $(PEXLIBS)
           XAULIB = $(XAUTHSRC)/libXau.a
+ #if Amoeba || Minix
+        XDMCPLIB =
+ #else
         XDMCPLIB = $(XDMCPLIBSRC)/libXdmcp.a
+ #endif
               OS = os/libos.a $(XAULIB) $(XDMCPLIB)
          BSDEMUL = $(LIBSRC)/Berk/Berklib.o
              MFB = ddx/mfb/libmfb.a
***************
*** 42,53 ****
              CFB = ddx/cfb/libcfb.a
               MI = ddx/mi/libmi.a
              DIX = dix/libdix.a
!            FONT = $(FONTSRC)/lib/font/libfont.a
! #if SystemV4 && X386Server
!         SYSLIBS = -lm /usr/ucblib/libucb.a
  #else
!         SYSLIBS = -lm -ldbm
  #endif
             CBRT = ddx/mi/cbrt.o
  
  XCOMM
--- 49,76 ----
              CFB = ddx/cfb/libcfb.a
               MI = ddx/mi/libmi.a
              DIX = dix/libdix.a
!            FONT = $(FONTSRC)/lib/font/libfont.a $(RENDERERLIBS)
! #if i386Mach
! #ifdef i386Mach_BsdTree
!    EXTRASYSLIBS = /usr/lib/libmach.a
! #else
!    EXTRASYSLIBS = /usr/misc/.mach/lib/libmach.a
! #endif
! #endif
! #ifndef XFree86Version
! #if HasSdbm
!          DBMLIB = -lsdbm
! #else
! #if Amoeba || Minix
!          DBMLIB = ../lib/sdbm/libsdbm.a
  #else
! #if !i386Bsd
!          DBMLIB = -ldbm
  #endif
+ #endif
+ #endif
+ #endif
+         SYSLIBS = -lm $(DBMLIB) $(MALLOCLIBS) $(EXTRASYSLIBS)
             CBRT = ddx/mi/cbrt.o
  
  XCOMM
***************
*** 121,128 ****
  ALL1 = Xmips
  #endif
  
! #if X386Server
! ALL1 = X386
  #endif
  
  #if XnonServer
--- 144,151 ----
  ALL1 = Xmips
  #endif
  
! #ifdef XFree86Version
! ALL1 = xf86all
  #endif
  
  #if XnonServer
***************
*** 245,251 ****
--- 268,278 ----
  SUNMDIRS = $(SUBDIRS0) $(SUBDIRS2) $(DEPDIRS)
  SUNMOBJS = ddx/sun/sunInitMono.o ddx/sun/sunInitExtMono.o
  SUNMLIBS = ddx/sun/libsun.a MFBBareLibs $(NONPEXEXTS)
+ #if Amoeba
+ SUNSYSLIBS = $(CBRT) $(SYSLIBS)
+ #else
  SUNSYSLIBS = $(SYSLIBS) $(SUNWINDOWSLIBS)
+ #endif
  
  ServerTarget(XsunMono,$(SUNMDIRS),$(SUNMOBJS),$(SUNMLIBS),$(SUNSYSLIBS))
  #endif /* XsunMonoServer */
***************
*** 328,350 ****
  #endif /* XmipsServer */
  
  
! #if X386Server
  XCOMM
! XCOMM X386 server
  XCOMM
! SUBDIRS0 = MFBSubdirs ddx/x386
! X386DIRS = $(SUBDIRS0) $(DEPDIRS)
! X386OBJS = ddx/x386/x386Init.o
  #ifdef i386SVR3Architecture
! X386SYSLIBS = $(CBRT) $(BSDEMUL)
  #endif
- X386LIBS = ddx/x386/libx386.a ddx/x386/vga/libvga.a ddx/x386/drivers/libdrivers.a ddx/x386/cfb.banked/libcfb.a MFBLibs $(X386SYSLIBS)
  
  INSTPGMFLAGS = $(INSTUIDFLAGS)     /* server must be suid root  */
! ServerTarget(X386,$(X386DIRS),$(X386OBJS),$(X386LIBS),$(SYSLIBS))
! #endif /* X386Server */
  
  
  #if XnonServer
  XCOMM
  XCOMM non server, just compile sources for build test
--- 355,554 ----
  #endif /* XmipsServer */
  
  
! #ifdef XFree86Version
! XCOMM
! XCOMM XFree86
  XCOMM
! XCOMM This stuff is common to all XFree86 servers
  XCOMM
! 
! #include <xf86.rules>
! 
! #ifdef XFree86DefaultServer
! XF86DEFSERVER = XFree86DefaultServer
! #endif
! 
  #ifdef i386SVR3Architecture
! XF86SYSLIBS = $(CBRT) $(BSDEMUL)
! #endif
! #if defined(LinuxArchitecture) || defined(Amoeba) || defined(Minix)
! XF86SYSLIBS = $(CBRT)
! #endif
! 
! #if SpecialMalloc
! MALLOCLIBS = -ldbmalloc
  #endif
  
  INSTPGMFLAGS = $(INSTUIDFLAGS)     /* server must be suid root  */
! 
!      SUBDIRS0 = include StdSubdirs ddx/x386
! XF86COMMONLIB = ddx/x386/common/libx386.a
!     XF86OSLIB = ddx/x386/os-support/libxf86_os.a
!     XF86HWLIB = ddx/x386/common_hw/libxf86_hw.a
! XF86COMMONOBJ = $(RENDERERCONFOBJ) ddx/x386/common/xf86_Option.o
! 
! /* Common rules */
! 
! $(CONFIGSRC)/X386Conf.tmpl: $(ICONFIGFILES)
! 	@echo Checking in $(CONFIGSRC)...
! 	@cd $(CONFIGSRC); set -x; $(MAKE) $(MFLAGS) Makefiles
! 
! $(RENDERERCONFOBJ): $(ICONFIGFILES)
! 	@for i in $(RENDERERCONFSUBDIR); do \
! 	(echo Checking in $$i...; cd $$i; set -x; \
! 	$(MAKE) $(MFLAGS) Configure); done
! 
! #if ExtraRenderers
! $(RENDERERLIBS):: $(ICONFIGFILES)
! 	@echo Checking in $(RENDERERSRC)...; cd $(RENDERERSRC); set -x; \
! 	$(MAKE) $(MFLAGS) SUBDIRS="$(RENDERERSUBDIRS)" Makefiles; \
! 	$(MAKE) $(MFLAGS) SUBDIRS="$(RENDERERSUBDIRS)" Depend; \
! 	$(MAKE) $(MFLAGS) SUBDIRS="$(RENDERERSUBDIRS)" subdirs
! 	touch $(RENDERERLIBS)
! 	@for i in $(RENDERERLIBS); do (set -x; \
! 	RanLibrary($$i)); done
! #endif
! 
! /*
!  * Adding a new XFree86 server:
!  *
!  * In most cases just use one of the current servers as an example.
!  * If the server uses ddx/mfb, set SUBDIRS1 = ddx/mfb
!  * If the server uses ddx/cfb, set SUBDIRS2 = ddx/cfb 
!  * If the server has configurable drivers like XF86_SVGA and XF86_Mono,
!  *   use XFree86Server() to define the build rules.
!  * If the server doesn't have drivers (like XF86_S3), use XFree86ServerNoDrv()
!  *   to define the build rules.
!  * The usage of these macros is documented in config/xf86.rules.
!  *
!  */
! 
! #if XF86SVGAServer
! XCOMM
! XCOMM XFree86 SVGA server
! XCOMM
! 
! SVGASPECIALOBJS = ddx/x386/common/x386Init.o dix/dixfonts.o ddx/mi/mibitblt.o
!    XF86SVGALIBS = ddx/x386/vga256/libvga256.a MFBLibs
! 
!        SUBDIRS1 = ddx/mfb
! 
! XFree86Server(XF86_SVGA,ddx/mfb,$(XF86SVGALIBS),$(SVGASPECIALOBJS),$(VGAOBJS),$(VGADRIVERSRC),$(X386CONFOBJS),$(X386CONFSUBDIRS))
! 
! #endif /* XF86SVGAServer */
! 
! #if XF86VGA16Server
! XCOMM
! XCOMM XFree86 16 Colour (largely generic) VGA server
! XCOMM
! 
! VGA16SPECIALOBJS = ddx/x386/common/x386Init_m.o dix/dixfonts_m.o \
! 		 ddx/x386/vga16/mi/mipushpx16.o ddx/x386/vga16/mi/mibitblt16.o
!         VGA16LIB = ddx/x386/vga16/libvga16.a
!         VGA16SRC = $(VGA16DRIVERSRC)
! 
!    XF86VGA16LIBS = $(VGA16LIB) NoMFBBareLibs $(NONPEXEXTS)
!    XF86VGA16OBJS = $(VGA16OBJS)
! XF86VGA16DRIVSRC = $(VGA16SRC)
! 
! XFree86Server(XF86_VGA16,/**/,$(XF86VGA16LIBS),$(VGA16SPECIALOBJS),$(XF86VGA16OBJS),$(XF86VGA16DRIVSRC),$(VGA16CONFOBJS),$(VGA16CONFSUBDIRS))
! 
! #endif /* XF86VGA16Server */
! 
! #if XF86MonoServer
! XCOMM
! XCOMM XFree86 Mono server
! XCOMM
! 
! MONOSPECIALOBJS = ddx/x386/common/x386Init_m.o dix/dixfonts_m.o \
! 		  ddx/mi/mibitblt_m.o
! 
! #if BuildVga2
!         VGA2LIB = ddx/x386/vga2/libvga2.a
!         VGA2SRC = $(VGA2DRIVERSRC)
! #endif
! #if BuildHga2
!         HGA2LIB = ddx/x386/hga2/libhga2.a
!         HGA2SRC = $(HGA2DRIVERSRC)
! #endif
! #if BuildBdm2
!         BDM2LIB = ddx/x386/bdm2/libbdm2.a
!         BDM2SRC = $(BDM2DRIVERSRC)
! #endif
! 
!    XF86MONOLIBS = $(VGA2LIB) $(HGA2LIB) $(BDM2LIB) NoMFBBareLibs $(NONPEXEXTS)
!    XF86MONOOBJS = $(VGA2OBJS) $(HGA2OBJS) $(BDM2OBJS)
! XF86MONODRIVSRC = $(VGA2SRC) $(HGA2SRC)
!    
! XFree86Server(XF86_Mono,/**/,$(XF86MONOLIBS),$(MONOSPECIALOBJS),$(XF86MONOOBJS),$(XF86MONODRIVSRC),$(X386MCONFOBJS),$(X386MCONFSUBDIRS))
! 
! #endif /* XF86MonoServer */
! 
! #if XF86S3Server
! XCOMM
! XCOMM XFree86 S3 server
! XCOMM
! 
!   S3SPECIALOBJS = ddx/x386/common/x386Init.o dix/dixfonts.o ddx/mi/mibitblt.o
!      XF86S3LIBS = ddx/x386/accel/s3/s3mmio/libs3mmio.a \
! 		  ddx/x386/accel/s3/libs3.a CFBLibs
! 
!        SUBDIRS1 = ddx/mfb
!        SUBDIRS2 = ddx/cfb
! 
! XFree86Server(XF86_S3,ddx/mfb ddx/cfb,$(XF86S3LIBS),$(S3SPECIALOBJS),$(S3OBJS),$(S3DRIVERSRC),$(S3CONFOBJ),$(S3CONFSUBDIR))
! 
! #endif /* XF86S3Server */
! 
! #if XF86I8514Server
! XCOMM
! XCOMM XFree86 8514/A server
! XCOMM
! 
! X8514SPECIALOBJS = ddx/x386/common/x386Init.o dix/dixfonts.o ddx/mi/mibitblt.o
!    XF86I8514LIBS = ddx/x386/accel/ibm8514/lib8514.a CFBLibs
! 
!        SUBDIRS1 = ddx/mfb
!        SUBDIRS2 = ddx/cfb
! 
! XFree86ServerNoDrv(XF86_8514,ddx/mfb ddx/cfb,$(XF86I8514LIBS),$(X8514SPECIALOBJS))
! 
! #endif /* XF86I8514Server */
! 
! #if XF86Mach8Server
! XCOMM
! XCOMM XFree86 Mach8 server
! XCOMM
! 
! MACH8SPECIALOBJS = ddx/x386/common/x386Init.o dix/dixfonts.o ddx/mi/mibitblt.o
!    XF86MACH8LIBS = ddx/x386/accel/mach8/libmach8.a CFBLibs
  
+        SUBDIRS1 = ddx/mfb
+        SUBDIRS2 = ddx/cfb
  
+ XFree86ServerNoDrv(XF86_Mach8,ddx/mfb ddx/cfb,$(XF86MACH8LIBS),$(MACH8SPECIALOBJS))
+ 
+ #endif /* XF86Mach8Server */
+ 
+ #if XF86Mach32Server
+ XCOMM
+ XCOMM XFree86 Mach32 server
+ XCOMM
+ 
+ MACH32SPECIALOBJS = ddx/x386/common/x386Init.o dix/dixfonts.o ddx/mi/mibitblt.o
+    XF86MACH32LIBS = ddx/x386/accel/mach32/libmach32.a CFBLibs
+ 
+        SUBDIRS1 = ddx/mfb
+        SUBDIRS2 = ddx/cfb
+ 
+ XFree86ServerNoDrv(XF86_Mach32,ddx/mfb ddx/cfb,$(XF86MACH32LIBS),$(MACH32SPECIALOBJS))
+ 
+ #endif /* XF86Mach32Server */
+ 
+ #endif /* XFree86Version */
+ 
+ 
+ 
  #if XnonServer
  XCOMM
  XCOMM non server, just compile sources for build test
***************
*** 355,367 ****
  
  #endif /* XnonServer */
  
! 
! SUBDIRS = $(SUBDIRS0) $(SUBDIRS1) $(SUBDIRS2) $(SUBDIRS3)
! 
  InstallMultipleFlags($(ALL),$(BINDIR),$(INSTPGMFLAGS))
  
  install::
  	-(cd $(DESTDIR)$(BINDIR); $(RM) X; $(LN) $(ALL1) X)
  
  #define IHaveSubdirs
  
--- 559,581 ----
  
  #endif /* XnonServer */
  
! #ifdef XFree86Version
! #ifdef XFree86DefaultServer
! #if !Amoeba
! install::
! 	-(cd $(DESTDIR)$(BINDIR); $(RM) X; $(LN) $(XF86DEFSERVER) X)
! #endif
! #endif /* XFree86DefaultServer */
! #else
  InstallMultipleFlags($(ALL),$(BINDIR),$(INSTPGMFLAGS))
  
+ #if !Amoeba
  install::
  	-(cd $(DESTDIR)$(BINDIR); $(RM) X; $(LN) $(ALL1) X)
+ #endif
+ #endif /* XFree86Version */
+ 
+ SUBDIRS = $(SUBDIRS0) $(SUBDIRS1) $(SUBDIRS2) $(SUBDIRS3)
  
  #define IHaveSubdirs
  
***************
*** 371,377 ****
--- 585,593 ----
  
  ForceSubdirs($(DEPDIRS) $(SUBDIRS))
  
+ #ifndef XFree86Version
  clean::
  	$(RM) $(ALL)
+ #endif
  
  InstallManPage(Xserver,$(MANDIR))
diff -c mit/server/dix/Imakefile:1.1.1.1 mit/server/dix/Imakefile:2.2
*** mit/server/dix/Imakefile:1.1.1.1	Sat Mar 12 00:34:48 1994
--- mit/server/dix/Imakefile	Sat Mar 12 00:34:48 1994
***************
*** 1,14 ****
  XCOMM $XConsortium: Imakefile,v 1.37 91/07/16 22:54:10 gildea Exp $
  #include <Server.tmpl>
  
  SRCS = atom.c colormap.c cursor.c devices.c dispatch.c dixutils.c events.c \
  	extension.c gc.c globals.c glyphcurs.c grabs.c \
  	main.c property.c resource.c swaprep.c swapreq.c \
! 	tables.c window.c initatoms.c dixfonts.c
  OBJS = atom.o colormap.o cursor.o devices.o dispatch.o dixutils.o events.o \
  	extension.o gc.o globals.o glyphcurs.o grabs.o \
  	main.o property.o resource.o swaprep.o swapreq.o \
! 	tables.o window.o initatoms.o dixfonts.o
  
      INCLUDES = -I. -I../include -I$(INCLUDESRC) -I$(FONTSRC)/include
      LINTLIBS = ../os/llib-los.ln
--- 1,28 ----
+ XCOMM $XFree86: mit/server/dix/Imakefile,v 2.2 1993/08/28 07:57:08 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.37 91/07/16 22:54:10 gildea Exp $
  #include <Server.tmpl>
  
+ #ifdef XFree86Version
+ SRC2 = dixfonts_m.c
+ #endif
+ 
  SRCS = atom.c colormap.c cursor.c devices.c dispatch.c dixutils.c events.c \
  	extension.c gc.c globals.c glyphcurs.c grabs.c \
  	main.c property.c resource.c swaprep.c swapreq.c \
! 	tables.c window.c initatoms.c dixfonts.c $(SRC2)
! 
! 
! #ifndef XFree86Version
! OBJ2 = dixfonts.o
! #else
! OBJ3 = dixfonts.o
! OBJ4 = dixfonts_m.o
! #endif
! 
  OBJS = atom.o colormap.o cursor.o devices.o dispatch.o dixutils.o events.o \
  	extension.o gc.o globals.o glyphcurs.o grabs.o \
  	main.o property.o resource.o swaprep.o swapreq.o \
! 	tables.o window.o initatoms.o $(OBJ2)
  
      INCLUDES = -I. -I../include -I$(INCLUDESRC) -I$(FONTSRC)/include
      LINTLIBS = ../os/llib-los.ln
***************
*** 40,47 ****
--- 54,72 ----
     SITE_DISPLAY_CLASS = -DCOMPILEDDISPLAYCLASS=\"$(DEFAULTDISPLAYCLASS)\"
  #endif
  
+ #ifdef XVendorString
+ VENDORSTRING = XVendorString
+    VENDOR_STRING = -DVENDOR_STRING='$(VENDORSTRING)'
+ #endif
+ 
+ #ifdef XVendorRelease
+ VENDORRELEASE = XVendorRelease
+    VENDOR_RELEASE = -DVENDOR_RELEASE='$(VENDORRELEASE)'
+ #endif
+ 
  SITE_DEFINES = $(SITE_FONT_PATH) $(SITE_RGB_DB) $(SITE_DISPLAY_CLASS)
  
+ VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_RELEASE)
  
  NormalLibraryObjectRule()
  NormalLibraryTarget(dix,$(OBJS))
***************
*** 48,54 ****
  LintLibraryTarget(dix,$(SRCS))
  NormalLintTarget($(SRCS))
  
! SpecialObjectRule(globals.o, $(ICONFIGFILES), $(SITE_DEFINES))
  
  #if HasSaberC
  saber_src:
--- 73,91 ----
  LintLibraryTarget(dix,$(SRCS))
  NormalLintTarget($(SRCS))
  
! #ifdef XFree86Version
! all:: $(OBJ3) $(OBJ4)
! #endif
! 
! SpecialObjectRule(globals.o, globals.c $(ICONFIGFILES), $(SITE_DEFINES))
! SpecialObjectRule(main.o, main.c $(ICONFIGFILES), $(VENDOR_DEFINES))
! #ifdef XFree86Version
! ObjectFromSpecialSource(dixfonts_m,dixfonts,MonoDefines)
! #endif
! 
! InstallLinkKitLibrary(dix,$(LINKKITDIR)/lib)
! InstallLinkKitNonExecFile(dixfonts.o,$(LINKKITDIR)/lib)
! InstallLinkKitNonExecFile(dixfonts_m.o,$(LINKKITDIR)/lib)
  
  #if HasSaberC
  saber_src:
diff -c mit/server/dix/dispatch.c:1.1.1.2 mit/server/dix/dispatch.c:1.9
*** mit/server/dix/dispatch.c:1.1.1.2	Sat Mar 12 00:34:52 1994
--- mit/server/dix/dispatch.c	Sat Mar 12 00:34:53 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/server/dix/dispatch.c,v 1.9 1993/03/20 04:20:29 dawes Exp $ */
  /* $XConsortium: dispatch.c,v 5.36 91/10/30 14:51:40 rws Exp $ */
  /************************************************************
  Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts,
***************
*** 235,240 ****
--- 236,249 ----
  		    FlushIfCriticalOutputPending();
  		}
  	   
+ #ifdef _MINIX
+ 		if (client->osPrivate == NULL) {
+ 		    /* should not happen; bug in WaitForSomething? */
+ 		    ErrorF("Dispatch: client %d gone\n", clientReady[nready]);
+ 		    break;
+ 		}
+ #endif
+ 
  		/* now, finally, deal with client requests */
  
  	        result = ReadRequestFromClient(client);
diff -c mit/server/dix/dixfonts.c:1.1.1.1 mit/server/dix/dixfonts.c:1.5
*** mit/server/dix/dixfonts.c:1.1.1.1	Sat Mar 12 00:34:53 1994
--- mit/server/dix/dixfonts.c	Sat Mar 12 00:34:54 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/server/dix/dixfonts.c,v 1.5 1993/03/20 04:20:32 dawes Exp $ */
  /************************************************************************
  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
***************
*** 77,84 ****
  
      BitmapFormatScanlineUnit8;
  
- static int  FinishListFontsWithInfo();
- 
  extern pointer fosNaturalParams;
  extern FontPtr defaultFont;
  
--- 78,83 ----
***************
*** 1164,1169 ****
--- 1163,1200 ----
  {
      fpe->refcount--;
      if (force || fpe->refcount == 0) {
+         /*
+          * This is a hack to work around a problem that occurs when using
+          * the Type1 renderer.  The problem is that a free'd element of
+          * font_path_elements is getting referenced during server shutdown
+          * (and server reset?).  This occurs when there is a path containing
+          * Type 1 fonts in font_path_elements, and a path has been added
+          * using "xset +fp".  The real solution to the problem would be to
+          * find where refcount is getting out of sync.
+          *
+          * The real problem is that the resouce list of a client started
+          * before the "xset" somehow gets the new path -- so when the client
+          * is shutdown it free's the fontpath when it shouldn't.  I haven't
+          * been able to track down where this is happening -- and don't know
+          * for sure if it's connected to the Type 1 renderer.
+          * DHD Feb 1992
+          */
+ 
+         if (!force) {
+             int i;
+             for (i=0; i<num_fpes; i++) {
+                 /*
+                  * If fpe is part of the current font_path_elements only free it
+                  * at the end (when force is set).  This should prevent part of
+                  * of the current font_path_elements being prematurely free'd.
+                  */
+               if (fpe==font_path_elements[i]) {
+                     fpe->refcount++;
+                     return;
+                 }
+             }
+         }
+ 
  	(*fpe_functions[fpe->type].free_fpe) (fpe);
  	xfree(fpe->name);
  	xfree(fpe);
diff -c mit/server/dix/events.c:1.1.1.2 mit/server/dix/events.c:1.5
*** mit/server/dix/events.c:1.1.1.2	Sat Mar 12 00:34:55 1994
--- mit/server/dix/events.c	Sat Mar 12 00:34:56 1994
***************
*** 23,28 ****
--- 23,29 ----
  ********************************************************/
  
  
+ /* $XFree86: mit/server/dix/events.c,v 1.5 1993/03/20 04:20:34 dawes Exp $ */
  /* $XConsortium: events.c,v 5.54 92/03/19 11:30:46 rws Exp $ */
  
  #include "X.h"
***************
*** 1895,1901 ****
      }
      if (grab)
  	DeliverGrabbedEvent(xE, keybd, deactivateGrab, count);
!     else
  	DeliverFocusedEvent(keybd, xE, sprite.win, count);
      if (deactivateGrab)
          (*keybd->DeactivateGrab)(keybd);
--- 1896,1902 ----
      }
      if (grab)
  	DeliverGrabbedEvent(xE, keybd, deactivateGrab, count);
!     else if (sprite.win)
  	DeliverFocusedEvent(keybd, xE, sprite.win, count);
      if (deactivateGrab)
          (*keybd->DeactivateGrab)(keybd);
diff -c mit/server/dix/main.c:1.1.1.1 mit/server/dix/main.c:2.0
*** mit/server/dix/main.c:1.1.1.1	Sat Mar 12 00:35:00 1994
--- mit/server/dix/main.c	Sat Mar 12 00:35:00 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/dix/main.c,v 2.0 1993/09/22 15:49:13 dawes Exp $ */
  /* $XConsortium: main.c,v 5.17 91/07/24 12:33:14 rws Exp $ */
  
  #include "X.h"
***************
*** 41,46 ****
--- 42,64 ----
  #include "servermd.h"
  #include "site.h"
  
+ extern char *getenv();
+ 
+ #if !defined(PATH_MAX) && defined(_POSIX_SOURCE)
+ #include <limits.h>
+ #endif
+ 
+ #ifndef PATH_MAX
+ #include <sys/param.h>
+ #ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+ #define PATH_MAX MAXPATHLEN
+ #else
+ #define PATH_MAX 1024
+ #endif
+ #endif
+ #endif
+ 
  extern long defaultScreenSaverTime;
  extern long defaultScreenSaverInterval;
  extern int defaultScreenSaverBlanking;
***************
*** 139,144 ****
--- 157,164 ----
  {
      int		i, j, k;
      long	alwaysCheckForInput[2];
+     char	*xwinhome;
+     char	fontpath[PATH_MAX*4], rgbpath[PATH_MAX];
  
      /* Notice if we're restart.  Probably this is because we jumped through
       * uninitialized pointer */
***************
*** 152,157 ****
--- 172,189 ----
      argcGlobal = argc;
      argvGlobal = argv;
      display = "0";
+ 
+     if ((xwinhome = getenv("XWINHOME")) != NULL)
+     {
+ 	char fontdir[PATH_MAX];
+         sprintf(fontdir, "%s/lib/X11/fonts", xwinhome);
+ 	sprintf(fontpath, "%s/misc/,%s/Speedo/,%s/75dpi/,%s/100dpi/",
+ 		fontdir, fontdir, fontdir, fontdir);
+ 	defaultFontPath = fontpath;
+ 	sprintf(rgbpath, "%s/lib/X11/rgb", xwinhome);
+ 	rgbPath = rgbpath;
+     }
+ 	
      ProcessCommandLine(argc, argv);
  
      alwaysCheckForInput[0] = 0;
***************
*** 240,252 ****
  	    FatalError("failed to initialize core devices");
  
  	InitFonts ();
! 	if (SetDefaultFontPath(defaultFontPath, &i) != Success)
! 	    ErrorF("failed to set default font path '%s'", defaultFontPath);
  	if (!SetDefaultFont(defaultTextFont))
! 	    FatalError("could not open default font '%s'", defaultTextFont);
  	if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0)))
! 	    FatalError("could not open default cursor font '%s'",
! 		       defaultCursorFont);
  	for (i = 0; i < screenInfo.numScreens; i++)
  	    InitRootWindow(WindowTable[i]);
          DefineInitialRootWindow(WindowTable[0]);
--- 272,296 ----
  	    FatalError("failed to initialize core devices");
  
  	InitFonts ();
! 	if (j = (SetDefaultFontPath(defaultFontPath, &i) != Success))
! 	    ErrorF("\nfailed to set default font path '%s'\n", defaultFontPath);
  	if (!SetDefaultFont(defaultTextFont))
!         {
!             char *badpath = "FontPath is invalid";
!             char *badfont = "it is in none of the FontPath directories";
! 
!             if (!j)
!                 ErrorF("\nFontPath is set to '%s'", defaultFontPath);
! 	    FatalError("could not open default font '%s'\nbecause %s\n",
!                        defaultTextFont, j ? badpath : badfont);
!         }
  	if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0)))
!         {
!             ErrorF("\nFontPath is set to '%s'", defaultFontPath);
! 	    FatalError("could not open default cursor font '%s'\n%s\n",
! 		       defaultCursorFont,
!                        "because it is in none of the FontPath directories");
!         }
  	for (i = 0; i < screenInfo.numScreens; i++)
  	    InitRootWindow(WindowTable[i]);
          DefineInitialRootWindow(WindowTable[0]);
diff -c /dev/null mit/server/include/Imakefile:2.3
*** /dev/null	Sat Mar 12 00:35:09 1994
--- mit/server/include/Imakefile	Sat Mar 12 00:35:09 1994
***************
*** 0 ****
--- 1,28 ----
+ XCOMM $XFree86: mit/server/include/Imakefile,v 2.3 1994/02/28 14:12:41 dawes Exp $
+ 
+ all::
+ 
+ InstallLinkKitNonExecFile(colormap.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(cursor.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(dix.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(dixfont.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(dixfontstr.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(gc.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(gcstruct.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(input.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(misc.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(miscstruct.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(os.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(pixmap.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(pixmapstr.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(property.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(resource.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(region.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(regionstr.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(screenint.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(servermd.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(scrnintstr.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(window.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(windowstr.h,$(LINKKITDIR)/include)
+ 
+ depend::
diff -c mit/server/include/dix.h:1.1.1.2 mit/server/include/dix.h:2.0
*** mit/server/include/dix.h:1.1.1.2	Sat Mar 12 00:35:09 1994
--- mit/server/include/dix.h	Sat Mar 12 00:35:09 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/include/dix.h,v 2.0 1993/09/09 06:03:29 dawes Exp $ */
  /* $XConsortium: dix.h,v 1.60 91/10/30 14:49:57 rws Exp $ */
  
  #ifndef DIX_H
***************
*** 33,38 ****
--- 34,41 ----
  #define SAMETIME 0
  #define LATER 1
  
+ extern void (* miCacheFreeSlot)();
+ 
  #define NullClient ((ClientPtr) 0)
  #define REQUEST(type) \
  	register type *stuff = (type *)client->requestBuffer
***************
*** 101,106 ****
--- 104,110 ----
          pGC = client->lastGC;\
          pDraw = client->lastDrawable;\
      }\
+     (*miCacheFreeSlot)(pDraw);\
      if (pGC->serialNumber != pDraw->serialNumber)\
  	ValidateGC(pDraw, pGC);
  
diff -c mit/server/include/misc.h:1.1.1.1 mit/server/include/misc.h:2.0
*** mit/server/include/misc.h:1.1.1.1	Sat Mar 12 00:35:10 1994
--- mit/server/include/misc.h	Sat Mar 12 00:35:10 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/include/misc.h,v 2.0 1993/07/24 11:57:55 dawes Exp $ */
  /* $XConsortium: misc.h,v 1.58 91/04/10 08:53:39 rws Exp $ */
  #ifndef MISC_H
  #define MISC_H 1
***************
*** 102,107 ****
--- 103,114 ----
   */
  #define lowbit(x) ((x) & (~(x) + 1))
  
+ #ifdef MAXSHORT
+ #undef MAXSHORT
+ #endif
+ #ifdef MINSHORT
+ #undef MINSHORT
+ #endif
  #define MAXSHORT 32767
  #define MINSHORT -MAXSHORT 
  
diff -c mit/server/include/os.h:1.1.1.1 mit/server/include/os.h:2.1
*** mit/server/include/os.h:1.1.1.1	Sat Mar 12 00:35:10 1994
--- mit/server/include/os.h	Sat Mar 12 00:35:10 1994
***************
*** 22,27 ****
--- 22,28 ----
  
  ******************************************************************/
  
+ /* $XFree86: mit/server/include/os.h,v 2.1 1993/12/25 14:04:31 dawes Exp $ */
  /* $XConsortium: os.h,v 1.44 91/07/18 23:01:12 keith Exp $ */
  
  #ifndef OS_H
***************
*** 58,64 ****
  
  #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 */
--- 59,65 ----
  
  #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 */
***************
*** 86,97 ****
--- 87,112 ----
  #ifndef alloca
  char *alloca();
  #endif
+ #ifdef DEBUG_ALLOCA
+ extern char *debug_alloca();
+ extern void debug_dealloca();
+ #define ALLOCATE_LOCAL(size) debug_alloca(__FILE__,__LINE__,(int)(size))
+ #define DEALLOCATE_LOCAL(ptr)  debug_dealloca(__FILE__,__LINE__,(ptr))
+ #else
  #define ALLOCATE_LOCAL(size) alloca((int)(size))
  #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
+ #endif
  #endif /* who does alloca */
  
  #endif /* NO_ALLOCA */
  
+ #ifdef CAHILL_MALLOC
+ #define Xalloc(len)		debug_Xalloc(__FILE__,__LINE__,(len))
+ #define Xcalloc(len)		debug_Xcalloc(__FILE__,__LINE__,(len))
+ #define Xrealloc(ptr,len)	debug_Xrealloc(__FILE__,__LINE__,(ptr),(len))
+ #define Xfree(ptr)		debug_Xfree(__FILE__,__LINE__,(ptr))
+ #endif
+ 
  #ifndef ALLOCATE_LOCAL
  #define ALLOCATE_LOCAL(size) Xalloc((unsigned long)(size))
  #define DEALLOCATE_LOCAL(ptr) Xfree((pointer)(ptr))
***************
*** 98,106 ****
  #endif /* ALLOCATE_LOCAL */
  
  
! #define xalloc(size) Xalloc((unsigned long)(size))
! #define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size))
! #define xfree(ptr) Xfree((pointer)(ptr))
  
  #ifndef X_NOT_STDC_ENV
  #include <string.h>
--- 113,121 ----
  #endif /* ALLOCATE_LOCAL */
  
  
! #define xalloc(size) Xalloc(((unsigned long)(size)))
! #define xrealloc(ptr, size) Xrealloc(((pointer)(ptr)), ((unsigned long)(size)))
! #define xfree(ptr) Xfree(((pointer)(ptr)))
  
  #ifndef X_NOT_STDC_ENV
  #include <string.h>
***************
*** 124,134 ****
  void		Error();
  void		FatalError();
  void		ProcessCommandLine();
- void		Xfree();
  void		FlushAllOutput();
  void		FlushIfCriticalOutputPending();
  unsigned long	*Xalloc();
  unsigned long	*Xrealloc();
  long		GetTimeInMillis();
  
  #endif /* OS_H */
--- 139,157 ----
  void		Error();
  void		FatalError();
  void		ProcessCommandLine();
  void		FlushAllOutput();
  void		FlushIfCriticalOutputPending();
+ #ifndef CAHILL_MALLOC
+ void		Xfree();
  unsigned long	*Xalloc();
+ unsigned long	*Xcalloc();
  unsigned long	*Xrealloc();
+ #else
+ void		debug_Xfree();
+ unsigned long	*debug_Xalloc();
+ unsigned long	*debug_Xcalloc();
+ unsigned long	*debug_Xrealloc();
+ #endif
  long		GetTimeInMillis();
  
  #endif /* OS_H */
diff -c mit/server/include/pixmapstr.h:1.1.1.1 mit/server/include/pixmapstr.h:2.1
*** mit/server/include/pixmapstr.h:1.1.1.1	Sat Mar 12 00:35:10 1994
--- mit/server/include/pixmapstr.h	Sat Mar 12 00:35:10 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/server/include/pixmapstr.h,v 2.1 1993/11/09 10:31:11 dawes Exp $ */
  /* $XConsortium: pixmapstr.h,v 5.0 89/06/09 15:00:35 keith Exp $ */
  /***********************************************************
  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
***************
*** 52,57 ****
--- 53,60 ----
      int			refcnt;
      int			devKind;
      DevUnion		devPrivate;
+     int			slot;		/* Offscreen cache slot number */
+     int			cacheId;	/* Pixmap id number */
  } PixmapRec;
  
  #endif /* PIXMAPSTRUCT_H */
diff -c mit/server/include/servermd.h:1.1.1.1 mit/server/include/servermd.h:2.2
*** mit/server/include/servermd.h:1.1.1.1	Sat Mar 12 00:35:11 1994
--- mit/server/include/servermd.h	Sat Mar 12 00:35:11 1994
***************
*** 23,28 ****
--- 23,30 ----
  ******************************************************************/
  #ifndef SERVERMD_H
  #define SERVERMD_H 1
+ 
+ /* $XFree86: mit/server/include/servermd.h,v 2.2 1994/02/10 21:27:23 dawes Exp $ */
  /* $XConsortium: servermd.h,v 1.60 91/06/30 11:29:35 rws Exp $ */
  
  /*
***************
*** 97,102 ****
--- 99,108 ----
   *	Currently defined for SPARC.
   */
  
+ #if !defined(MACH) && !defined(MACH386) && !defined(__OSF__)
+ #include <sys/param.h>
+ #endif
+ 
  #ifdef vax
  
  #define IMAGE_BYTE_ORDER	LSBFirst        /* Values for the VAX only */
***************
*** 107,113 ****
  
  #endif /* vax */
  
! #ifdef sun
  
  #if defined(sun386) || defined(sun5)
  # define IMAGE_BYTE_ORDER	LSBFirst        /* Values for the SUN only */
--- 113,119 ----
  
  #endif /* vax */
  
! #if defined(sun) && !defined (SOLX86)
  
  #if defined(sun386) || defined(sun5)
  # define IMAGE_BYTE_ORDER	LSBFirst        /* Values for the SUN only */
***************
*** 131,137 ****
  #define	GLYPHPADBYTES		4
  #define GETLEFTBITS_ALIGNMENT	1
  
! #endif /* sun */
  
  #ifdef apollo
  
--- 137,143 ----
  #define	GLYPHPADBYTES		4
  #define GETLEFTBITS_ALIGNMENT	1
  
! #endif /* sun && !SOLX86 */
  
  #ifdef apollo
  
***************
*** 251,265 ****
  
  #endif /* luna */
  
! #ifdef SYSV386
  
  #define IMAGE_BYTE_ORDER	LSBFirst
! #define BITMAP_BIT_ORDER	LSBFirst
  #define GLYPHPADBYTES		4
  #define GETLEFTBITS_ALIGNMENT	1
  #define AVOID_MEMORY_READ
  
! #endif /* SYSV386 */
  
  /* size of buffer to use with GetImage, measured in bytes. There's obviously
   * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives
--- 257,289 ----
  
  #endif /* luna */
  
! #if defined(SYSV386) || defined(SOLX86) || (defined(BSD) && defined(__i386__)) || defined(MACH386) || defined(linux) || (defined(AMOEBA) && defined(i80386)) || defined(_MINIX) || defined(__OSF__)
  
+ #ifndef IMAGE_BYTE_ORDER
  #define IMAGE_BYTE_ORDER	LSBFirst
! #endif
! 
! #ifndef BITMAP_BIT_ORDER
! # if defined(X386MONOVGA) || defined(XF86VGA16)
! #  define BITMAP_BIT_ORDER	MSBFirst
! # else
! #  define BITMAP_BIT_ORDER	LSBFirst
! # endif
! #endif
! 
! #ifndef BITMAP_SCANLINE_UNIT
! # if defined(X386MONOVGA) || defined(XF86VGA16)
! #  define BITMAP_SCANLINE_UNIT	8
! # endif
! #endif
! 
! #ifndef GLYPHPADBYTES
  #define GLYPHPADBYTES		4
+ #endif
  #define GETLEFTBITS_ALIGNMENT	1
  #define AVOID_MEMORY_READ
  
! #endif /* SYSV386 || SOLX86 || (BSD && __i386__) || MACH386 || linux || (AMOEBA && i80386) || _MINIX */
  
  /* size of buffer to use with GetImage, measured in bytes. There's obviously
   * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives
diff -c mit/server/os/Imakefile:1.1.1.1 mit/server/os/Imakefile:2.2
*** mit/server/os/Imakefile:1.1.1.1	Sat Mar 12 00:35:14 1994
--- mit/server/os/Imakefile	Sat Mar 12 00:35:14 1994
***************
*** 1,7 ****
  XCOMM $XConsortium: Imakefile,v 1.49 91/08/22 14:23:54 rws Exp $
  #include <Server.tmpl>
  
! #if (SystemV || SystemV4) && !HasSockets
  #undef ConnectionFlags
  #define ConnectionFlags -DTCPCONN -DUNIXCONN
  #endif
--- 1,8 ----
+ XCOMM $XFree86: mit/server/os/Imakefile,v 2.2 1993/12/23 13:26:25 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.49 91/08/22 14:23:54 rws Exp $
  #include <Server.tmpl>
  
! #if (SystemV || SystemV4) && !HasSockets && !defined(XFree86Version)
  #undef ConnectionFlags
  #define ConnectionFlags -DTCPCONN -DUNIXCONN
  #endif
***************
*** 10,15 ****
--- 11,21 ----
   * If you have any extra files to be put into the library, define them here.
   */
  
+ #ifdef Amoeba
+ #define OtherSources iopreader.c
+ #define OtherObjects iopreader.o
+ #endif
+ 
  #ifdef HPArchitecture
  #define OtherSources hpsocket.c 
  #define OtherObjects hpsocket.o dbm.o 
***************
*** 16,23 ****
  #endif
  
  #ifdef R4FontStructtures
! FONTSRCS = osfonts.c fonttype.c
! FONTOBJS = osfonts.o fonttype.o
  FONT_DEFINES = FontDefines FontFilters
  #endif
  
--- 22,29 ----
  #endif
  
  #ifdef R4FontStructtures
! FONTSRCS = osfonts.c fonttype.c decompress.c
! FONTOBJS = osfonts.o fonttype.o decompress.o
  FONT_DEFINES = FontDefines FontFilters
  #endif
  
***************
*** 53,73 ****
  RPCSRCS =
  #endif
  
  BOOTSTRAPCFLAGS = 
             SRCS = WaitFor.c access.c connection.c io.c oscolor.c \
                    osinit.c utils.c auth.c mitauth.c $(FONTSRCS) $(XDMAUTHSRCS) \
!  		  $(RPCSRCS) xdmcp.c decompress.c OtherSources
             OBJS = WaitFor.o access.o connection.o io.o oscolor.o \
                    osinit.o utils.o auth.o mitauth.o $(FONTOBJS) $(XDMAUTHOBJS) \
!  		  $(RPCOBJS) xdmcp.o decompress.o OtherObjects
  #if SpecialMalloc
!      OS_DEFINES = -DSPECIAL_MALLOC
! #else
!      OS_DEFINES =
  #endif /* SpecialMalloc */
      DBM_DEFINES = NdbmDefines
      ADM_DEFINES = -DADMPATH=\"$(ADMDIR)/X\%smsgs\"
!         DEFINES = ConnectionFlags $(OS_DEFINES) $(XDMAUTHDEFS) $(RPCDEFS) $(SIGNAL_DEFINES)
         INCLUDES = -I.  -I../include -I$(INCLUDESRC) -I$(TOP)/lib/Xau
      EXT_DEFINES = ExtensionDefines
         LINTLIBS = ../dix/llib-ldix.ln
--- 59,90 ----
  RPCSRCS =
  #endif
  
+ #if PartialNetDefault
+ PART_NET = -DPART_NET
+ #else
+ PART_NET = 
+ #endif
+ 
  BOOTSTRAPCFLAGS = 
             SRCS = WaitFor.c access.c connection.c io.c oscolor.c \
                    osinit.c utils.c auth.c mitauth.c $(FONTSRCS) $(XDMAUTHSRCS) \
!  		  $(RPCSRCS) xdmcp.c OtherSources
             OBJS = WaitFor.o access.o connection.o io.o oscolor.o \
                    osinit.o utils.o auth.o mitauth.o $(FONTOBJS) $(XDMAUTHOBJS) \
!  		  $(RPCOBJS) xdmcp.o OtherObjects
  #if SpecialMalloc
!  MALLOC_DEFINES = -DSPECIAL_MALLOC
  #endif /* SpecialMalloc */
+ #ifdef XFree86Version
+      OS_DEFINES = -DXFREE86
+     RGB_DEFINES = -DUSE_RGB_TXT
+ #endif
+ #if WantServerLocks
+    LOCK_DEFINES = -DSERVER_LOCK
+ #endif /* WantServerLocks */
      DBM_DEFINES = NdbmDefines
      ADM_DEFINES = -DADMPATH=\"$(ADMDIR)/X\%smsgs\"
!         DEFINES = ConnectionFlags $(OS_DEFINES) $(XDMAUTHDEFS) $(RPCDEFS) $(SIGNAL_DEFINES) $(LOCK_DEFINES) $(PART_NET) $(MALLOC_DEFINES) $(RGB_DEFINES)
         INCLUDES = -I.  -I../include -I$(INCLUDESRC) -I$(TOP)/lib/Xau
      EXT_DEFINES = ExtensionDefines
         LINTLIBS = ../dix/llib-ldix.ln
***************
*** 86,91 ****
--- 103,110 ----
  LintLibraryTarget(os,$(SRCS))
  NormalLintTarget($(SRCS))
  
+ InstallLinkKitLibrary(os,$(LINKKITDIR)/lib)
+ 
  XCOMM these depend on ConnectionFlags
  access.o: $(ICONFIGFILES)
  connection.o: $(ICONFIGFILES)
***************
*** 129,143 ****
  	ar x $(PWLIB) alloca.o
  #endif /* NEED_ALLOCA_FROM_LIBPW */
  
! SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
! SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
! SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
  #if defined(SparcArchitecture) && HasGcc
  oscolor.o: $(ICONFIGFILES)
  	$(RM) $@
  	cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
  #else
! SpecialObjectRule(oscolor.o,$(ICONFIGFILES),$(DBM_DEFINES))
  #endif
  
  #if HasSaberC
--- 148,164 ----
  	ar x $(PWLIB) alloca.o
  #endif /* NEED_ALLOCA_FROM_LIBPW */
  
! SpecialObjectRule(osinit.o,osinit.c $(ICONFIGFILES),$(ADM_DEFINES))
! SpecialObjectRule(WaitFor.o,WaitFor.c $(ICONFIGFILES),$(EXT_DEFINES))
! SpecialObjectRule(fonttype.o,fonttype.c $(ICONFIGFILES),$(FONT_DEFINES))
  #if defined(SparcArchitecture) && HasGcc
  oscolor.o: $(ICONFIGFILES)
  	$(RM) $@
  	cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
  #else
! # if !defined(XFree86Version)
! SpecialObjectRule(oscolor.o,oscolor.c $(ICONFIGFILES),$(DBM_DEFINES))
! # endif
  #endif
  
  #if HasSaberC
diff -c mit/server/os/WaitFor.c:1.1.1.2 mit/server/os/WaitFor.c:2.0
*** mit/server/os/WaitFor.c:1.1.1.2	Sat Mar 12 00:35:14 1994
--- mit/server/os/WaitFor.c	Sat Mar 12 00:35:15 1994
***************
*** 22,27 ****
--- 22,28 ----
  
  ******************************************************************/
  
+ /* $XFree86: mit/server/os/WaitFor.c,v 2.0 1993/09/22 15:49:40 dawes Exp $ */
  /* $XConsortium: WaitFor.c,v 1.57 92/03/13 15:47:39 rws Exp $ */
  
  /*****************************************************************
***************
*** 38,49 ****
--- 39,58 ----
  #include "X.h"
  #include "misc.h"
  
+ #ifndef _MINIX
  #include <sys/param.h>
+ #endif /* !_MINIX */
  #include <signal.h>
+ 
+ #ifdef _MINIX
+ #include <assert.h>
+ #endif
+ 
  #include "osdep.h"
  #include "dixstruct.h"
  #include "opaque.h"
  
+ #ifndef _MINIX
  extern long AllSockets[];
  extern long AllClients[];
  extern long LastSelectMask[];
***************
*** 55,64 ****
--- 64,89 ----
  
  extern long ScreenSaverTime;               /* milliseconds */
  extern long ScreenSaverInterval;               /* milliseconds */
+ #else /* _MINIX */
+ extern asio_fd_set_t InprogressFdSet;
+ extern asio_fd_set_t ListenFdSet;
+ extern asio_fd_set_t ClientFdSet;
+ extern asio_fd_set_t CompletedFdSet;
+ extern asio_fd_set_t IgnoreFdSet;
+ extern asio_fd_set_t GrabFdSet;
+ 
+ extern Bool AnyClientsWithInput;
+ extern int GrabInProgress;
+ 
+ void EnqueueNewConnection();
+ void UpdateClientIOStatus();
+ #endif /* _MINIX */
  extern int ConnectionTranslation[];
  
  extern Bool NewOutputPending;
+ #ifndef _MINIX
  extern Bool AnyClientsWriteBlocked;
+ #endif
  
  extern WorkQueuePtr workQueue;
  
***************
*** 104,109 ****
--- 129,135 ----
  
  static long timeTilFrob = 0;		/* while screen saving */
  
+ #if !defined(AMOEBA) && !defined(_MINIX)
  int
  WaitForSomething(pClientsReady)
      int *pClientsReady;
***************
*** 167,181 ****
  		waittime.tv_sec = timeout / MILLI_PER_SECOND;
  		waittime.tv_usec = (timeout % MILLI_PER_SECOND) *
  					(1000000 / MILLI_PER_SECOND);
! 		wt = &waittime;
  	    }
  	    else
  	    {
! 		wt = NULL;
  	    }
  	}
  	else
! 	    wt = NULL;
  	COPYBITS(AllSockets, LastSelectMask);
  #ifdef apollo
          COPYBITS(apInputMask, LastWriteMask);
--- 193,209 ----
  		waittime.tv_sec = timeout / MILLI_PER_SECOND;
  		waittime.tv_usec = (timeout % MILLI_PER_SECOND) *
  					(1000000 / MILLI_PER_SECOND);
! 		    wt = &waittime;
  	    }
  	    else
  	    {
! 		    wt = NULL;
  	    }
  	}
  	else
! 	{
! 	        wt = NULL;
! 	}
  	COPYBITS(AllSockets, LastSelectMask);
  #ifdef apollo
          COPYBITS(apInputMask, LastWriteMask);
***************
*** 196,203 ****
  	else if (AnyClientsWriteBlocked)
  	{
  	    COPYBITS(ClientsWriteBlocked, clientsWritable);
! 	    i = select (MAXSOCKS, (int *)LastSelectMask,
! 			(int *)clientsWritable, (int *) NULL, wt);
  	}
  	else
  #ifdef apollo
--- 224,231 ----
  	else if (AnyClientsWriteBlocked)
  	{
  	    COPYBITS(ClientsWriteBlocked, clientsWritable);
! 	    i = select (MAXSOCKS, (fd_set *)LastSelectMask,
! 			(fd_set *)clientsWritable, (fd_set *) NULL, wt);
  	}
  	else
  #ifdef apollo
***************
*** 204,211 ****
  	    i = select (MAXSOCKS, (int *)LastSelectMask,
  			(int *)LastWriteMask, (int *) NULL, wt);
  #else
! 	    i = select (MAXSOCKS, (int *)LastSelectMask,
! 			(int *) NULL, (int *) NULL, wt);
  #endif
  	selecterr = errno;
  	WakeupHandler((unsigned long)i, (pointer)LastSelectMask);
--- 232,239 ----
  	    i = select (MAXSOCKS, (int *)LastSelectMask,
  			(int *)LastWriteMask, (int *) NULL, wt);
  #else
! 	    i = select (MAXSOCKS, (fd_set *)LastSelectMask,
! 			(fd_set *) NULL, (fd_set *) NULL, wt);
  #endif
  	selecterr = errno;
  	WakeupHandler((unsigned long)i, (pointer)LastSelectMask);
***************
*** 291,293 ****
--- 319,784 ----
      return (FALSE);
  }
  #endif
+ 
+ #else /* AMOEBA || _MINIX */
+ #ifdef AMOEBA
+ int init_waiters = 0;
+ semaphore init_sema;
+ 
+ /*
+  * Force caller thread to wait until main has
+  * finished the initialization
+  */
+ void
+ WaitForInitialization()
+ {
+     init_waiters++;
+ #ifdef XDEBUG
+     if (amDebug) ErrorF("Waiting for initialization (%d)\n", init_waiters);
+ #endif
+     sema_down(&init_sema);
+ }
+ 
+ static semaphore main_sema;
+ 
+ /*
+  * The X-server consists of one main thread, running the non re-entrant
+  * X code, and a number of auxilary threads that take care of reading
+  * the input streams, and input devices. The following set of routines
+  * wake up the main thread when it has something to do.
+  */
+ void
+ InitMainThread()
+ {
+     sema_init(&main_sema, 0);
+ }
+ 
+ void
+ WakeUpMainThread()
+ {
+     sema_up(&main_sema);
+ }
+ 
+ static int
+ SleepMainThread(timo)
+     interval timo;
+ {
+ 
+ #ifdef XDEBUG
+     if (amDebug) ErrorF("Sleeping main thread timeout %d\n", timo);
+ #endif /* XDEBUG */
+     return (sema_trydown(&main_sema, timo) == 0) ? 0 : -1;
+ }
+ 
+ int
+ WaitForSomething(pClientsReady)
+     int		*pClientsReady;
+ {
+     register int	i, wt, nt;
+     struct timeval	*wtp;
+     long        	alwaysCheckForInput[2];
+     int 		nready;
+ 
+     /*
+      * First, wakeup threads in initial sleep
+      */
+     if (init_waiters > 0) {
+ #ifdef XDEBUG
+ 	if (amDebug)
+ 	    ErrorF("%d waiters wait for something to happen ...\n",
+ 		init_waiters);
+ #endif
+ 	while (init_waiters-- > 0)
+ 	    sema_up(&init_sema);
+     }
+ 
+     /*
+      * Be sure to check for input on every sweep in the dispatcher.
+      * This routine should be in InitInput, but since this is more
+      * or less a device dependent routine, and the semantics of it
+      * are device independent I decided to put it here.
+      */
+     alwaysCheckForInput[0] = 0;
+     alwaysCheckForInput[1] = 1;
+     SetInputCheck(&alwaysCheckForInput[0], &alwaysCheckForInput[1]);
+ 
+     while (TRUE) {
+ 	/*
+ 	 * Deal with any blocked jobs
+ 	 */
+ 	if (workQueue) ProcessWorkQueue();
+ 
+ 	/*
+ 	 * Screen saver actions
+ 	 */
+ 	if (ScreenSaverTime) {
+ 	    int timeout = ScreenSaverTime - TimeSinceLastInputEvent();
+ 	    if (timeout <= 0) { /* may be forced by AutoResetServer() */
+ 		long timeSinceSave;
+ 
+ 		timeSinceSave = -timeout;
+ 		if ((timeSinceSave >= timeTilFrob) && (timeTilFrob >= 0)) {
+ 		    SaveScreens(SCREEN_SAVER_ON, ScreenSaverActive);
+ 		    if (ScreenSaverInterval)
+ 			/* round up to the next ScreenSaverInterval */
+ 			timeTilFrob = ScreenSaverInterval *
+ 				((timeSinceSave + ScreenSaverInterval) /
+ 					ScreenSaverInterval);
+ 		    else
+ 			timeTilFrob = -1;
+ 		}
+ 		timeout = timeTilFrob - timeSinceSave;
+ 	    } else {
+ 		if (timeout > ScreenSaverTime)
+ 		    timeout = ScreenSaverTime;
+ 		timeTilFrob = 0;
+ 	    }
+ 	    wt = timeTilFrob >= 0 ? timeout : -1;
+ 	} else
+ 	    wt = -1;
+ 
+ 	/*
+ 	 * Check for new clients. We do this here and not in the
+ 	 * listener() threads because we cannot be sure that dix
+ 	 * is re-entrant, and we need to call some dix routines
+ 	 * during startup.
+ 	 */
+ 	if (nNewConns) EstablishNewConnections();
+ 
+ 	/*
+ 	 * Every device driver can install handlers which are called after
+ 	 * a certain amount of time. These handlers implement, for example,
+ 	 * key repeat on a Sun. The following construction will determine
+ 	 * the correct time-out value, given the available handlers. For
+ 	 * compatibility the timeout is a timeval structure.
+ 	 */
+ 	wtp = (struct timeval *) NULL;
+ 	BlockHandler((pointer)&wtp, (pointer)NULL);
+ 	if (wtp) wt = (wtp->tv_sec * 1000) + (wtp->tv_usec / 1000);
+ 
+ 	/*
+ 	 * Check for clients needing attention. They might want to
+ 	 * die or they might have input. In the second case, only
+ 	 * accept from the grabClient (if there is one).
+ 	 */
+ 	for (i = 0, nready = 0; i < maxClient; i++) {
+ 	    if (Clients[i] && Clients[i]->osPrivate) {
+ 		register OsCommPtr oc = (OsCommPtr)Clients[i]->osPrivate;
+ 		register int n;
+ 
+ 		if (oc->status & CONN_KILLED) {
+ 		    CloseDownClient(Clients[i]);
+ 		    if (maxClient == i) maxClient--;
+ 		    continue;
+ 		}
+ 		if ((n = am_avail(oc, VC_IN)) < 0) {
+ 		    CloseDownClient(Clients[i]);
+ 		    if (maxClient == i) maxClient--;
+ 		    continue;
+ 		}
+ 		if (n > 0 || oc->status & REQ_PUSHBACK) {
+ 		    if (grabClient == NULL || grabClient == Clients[i]) {
+ 			*pClientsReady++ = Clients[i]->index;
+ 			nready++;
+ 		    }
+ 		}
+ 	    }
+ 	}
+ 
+ 	/*
+ 	 * Well, if we found some work, or the hardware has
+ 	 * events available, we return.
+ 	 */
+ 	if (nready || AmoebaEventsAvailable()) break;
+ 
+ 	/*
+ 	 * Nothing interesting is available. Go to sleep with a
+ 	 * timeout and the other threads will wake us when needed.
+ 	 */
+ 	if (dispatchException) return 0;
+ 	i = SleepMainThread(wt);
+ 
+ 	/*
+ 	 * Wake up any of the sleeping handlers
+ 	 */
+ 	WakeupHandler((unsigned long)0, (pointer)NULL);
+ 	if (dispatchException) return 0;
+ 
+ 	/*
+ 	 * An error or timeout occurred
+ 	 */
+ 	if (i == -1) return 0;
+     }
+     return nready;
+ }
+ #endif /* AMOEBA */
+ 
+ #ifdef _MINIX
+ static int timed_fwait();
+ 
+ int
+ WaitForSomething(pClientsReady)
+     int *pClientsReady;
+ {
+     long timeout;
+     struct timeval waittime[2];
+     int nready;
+     struct fwait fw;
+     asio_fd_set_t wait_fd_set;
+     int i, r;
+     int fw_fd, fw_operation, fw_result, fw_errno;
+ 
+     /* We need a while loop here to handle 
+        crashed connections and the screen saver timeout */
+     nready= 0;
+     while (1)
+     {
+ 	/* deal with any blocked jobs */
+ 	if (workQueue)
+ 	    ProcessWorkQueue();
+ 
+ 	sysutime(UTIME_TIMEOFDAY, &waittime[1]);
+ 	waittime[0].tv_sec= 0;
+ 	if (ScreenSaverTime)
+ 	{
+ 	    timeout = (ScreenSaverTime -
+ 		       (GetTimeInMillis() - lastDeviceEventTime.milliseconds));
+ 	    if (timeout <= 0) /* may be forced by AutoResetServer() */
+ 	    {
+ 		long timeSinceSave;
+ 
+ 		timeSinceSave = -timeout;
+ 		if ((timeSinceSave >= timeTilFrob) && (timeTilFrob >= 0))
+ 		{
+ 		    ResetOsBuffers(); /* not ideal, but better than nothing */
+ 		    SaveScreens(SCREEN_SAVER_ON, ScreenSaverActive);
+ 		    if (ScreenSaverInterval)
+ 			/* round up to the next ScreenSaverInterval */
+ 			timeTilFrob = ScreenSaverInterval *
+ 				((timeSinceSave + ScreenSaverInterval) /
+ 					ScreenSaverInterval);
+ 		    else
+ 			timeTilFrob = -1;
+ 		}
+ 		timeout = timeTilFrob - timeSinceSave;
+ 	    }
+ 	    else
+ 	    {
+ 		if (timeout > ScreenSaverTime)
+ 		    timeout = ScreenSaverTime;
+ 		timeTilFrob = 0;
+ 	    }
+ 	    if (timeTilFrob >= 0)
+ 	    {
+ 	    	waittime[0]= waittime[1];
+ 		waittime[0].tv_sec += timeout / MILLI_PER_SECOND;
+ 		waittime[0].tv_usec += (timeout % MILLI_PER_SECOND) *
+ 					(1000000 / MILLI_PER_SECOND);
+ 		if (waittime[0].tv_usec >= 1000000)
+ 		{
+ 			waittime[0].tv_usec -= 1000000;
+ 			waittime[0].tv_sec += 1;
+ 		}
+ 	    }
+ 	}
+ 
+ 	wait_fd_set= InprogressFdSet;
+ 
+ 	/* Let's fill in the fwait structure */
+ 	fw.fw_flags= FWF_MORE;	/* Ignored by the kernel, but makes loop 
+ 				 * termination easier
+ 				 */
+ 
+ 	fw.fw_bits= wait_fd_set.afds_bits;
+ 	fw.fw_maxfd= ASIO_FD_SETSIZE;
+ 
+ 	if (AnyClientsWithInput)
+ 		fw.fw_flags |= FWF_NONBLOCK;
+ 
+ 	BlockHandler((pointer)waittime, (pointer)&wait_fd_set);
+ 	if (NewOutputPending)
+ 	    FlushAllOutput();
+ #ifdef XTESTEXT1
+ 	/* XXX how does this interact with new write block handling? */
+ 	if (playback_on) {
+ 	    XTestComputeWaitTime (waittime);
+ 	}
+ #endif /* XTESTEXT1 */
+ 	for(;fw.fw_flags & FWF_MORE; fw.fw_flags |= FWF_NONBLOCK)
+ 	{
+ 	    /* keep this check close to select() call to minimize race */
+ 	    if (dispatchException)
+ 	    {
+ 		r = -1;
+ 		errno= EAGAIN;
+ 	    }
+ 	    else if (waittime[0].tv_sec != 0)
+ 	    {
+ 	    	assert(waittime[0].tv_sec >= waittime[1].tv_sec);
+ 		r= timed_fwait(&fw, &waittime[0]);
+ 	    }
+ 	    else
+ 		r= fwait(&fw);
+ 	    if (r == -1)
+ 	    	break;
+ 	    fw_fd= fw.fw_fd;
+ 	    fw_operation= fw.fw_operation;
+ 	    fw_result= fw.fw_result;
+ 	    fw_errno= fw.fw_errno;
+ 	    if (ASIO_FD_ISSET(fw_fd, fw_operation, &ListenFdSet))
+ 	    {
+ 	    	/* Got a new connection */
+ 	    	EnqueueNewConnection(fw_fd, fw_operation, fw_result, fw_errno);
+ 		fw.fw_fd= -1;
+ 	    	continue;
+ 	    }
+ 	    if (ASIO_FD_ISSET(fw_fd, fw_operation, &ClientFdSet))
+ 	    {
+ 	    	/* The read or write of a client is done */
+ 	    	UpdateClientIOStatus(fw_fd, fw_operation, fw_result, fw_errno);
+ 		fw.fw_fd= -1;
+ 
+ 		/* Store the client in the ready set if the operation was a
+ 		 * read
+ 		 */
+ 		if (fw_operation == ASIO_READ)
+ 		{
+ 		    pClientsReady[nready++] = ConnectionTranslation[fw_fd];
+ 		}
+ 		continue;
+ 	    }
+ 
+ 	    /* Only thing left is a device, let's break out of this loop */
+ 	    break;
+ 	}
+ 	if (r == -1)
+ 	{
+ 	    if (errno != EINTR && errno != EAGAIN)
+ 		    FatalError("WaitForSomething(): fwait error: %s\n",
+ 			strerror(errno));
+ 	    WakeupHandler(0, NULL);	/* Nothing happend to a device */
+ 	}
+ 	else
+ 	{
+ 	    WakeupHandler(0, (pointer)&fw);
+ 	    if (fw.fw_fd != -1)
+ 	    	FatalError("Unable to locate module for completed I/O\n");
+ 	}
+ #ifdef XTESTEXT1
+ 	if (playback_on) {
+ 	    i = XTestProcessInputAction (i, &waittime);
+ 	}
+ #endif /* XTESTEXT1 */
+ 	if (r < 0) /* An error or timeout occurred */
+ 	{
+ 
+ 	    if (dispatchException)
+ 		return 0;
+ 	    if (*checkForInput[0] != *checkForInput[1])
+ 		return 0;
+ 	}
+ 
+ 	break;
+     }
+ 
+     if (AnyClientsWithInput)
+     {
+     	/* These were left over from the previous round */
+     	AnyClientsWithInput= FALSE;
+     	for (i= 0; i<ASIO_FD_SETSIZE; i++)
+     	{
+     		if (ASIO_FD_ISSET(i, ASIO_READ, &CompletedFdSet))
+     		{
+ 		    if (GrabInProgress && !ASIO_FD_ISSET(i, ASIO_READ,
+ 								&GrabFdSet))
+ 		    {
+ 		    	continue;
+ 		    }
+ 		    if (ASIO_FD_ISSET(i, ASIO_READ, &IgnoreFdSet))
+ 		    	continue;
+ 		    pClientsReady[nready++] = ConnectionTranslation[i];
+ 		}
+ 	}
+     }
+     return nready;
+ }
+ 
+ static int timer_running= FALSE;
+ static struct timeval timer_value;
+ static int tf_critical= FALSE;
+ static int tf_expired= FALSE;
+ 
+ void tf_handler(sig)
+ int sig;
+ {
+ 	struct timeval tv;
+ 
+ 	tf_expired= TRUE;
+ 	if (!tf_critical)
+ 	{
+ 		timer_running= FALSE;
+ 		return;
+ 	}
+ 	signal(SIGALRM, tf_handler);
+ 	sysutime(UTIME_TIMEOFDAY, &tv);
+ 	tv.tv_sec++;
+ 	/* Fake a high value to force to timer to be reloaded */
+ 	timer_value.tv_sec= tv.tv_sec + 1000000;
+ 	sysutime(UTIME_SETALARM, &tv);
+ }
+ 
+ static int
+ timed_fwait(fwp, tvp)
+ struct fwait *fwp;
+ struct timeval *tvp;
+ {
+ 	struct timeval tv;
+ 	int r;
+ 
+ #if DEBUG & 256
+  { sysutime(UTIME_TIMEOFDAY, &tv); tv.tv_sec= tvp->tv_sec - tv.tv_sec;
+  	tv.tv_usec= tvp->tv_usec - tv.tv_usec; if (tv.tv_usec < 0)
+  	{ tv.tv_usec += 1000000; tv.tv_sec--; }
+  	ErrorF("timed_fwait: timeout at now+%d.%06d\n", tv.tv_sec, 
+  	tv.tv_usec); }
+ #endif
+ 
+ 	/* Assume that only timed_fwait is allowed to let the timer running
+ 	 * between calls.
+ 	 */
+ 	tv= *tvp;
+ 	if (!timer_running)
+ 	{
+ 		signal(SIGALRM, tf_handler);
+ 		sysutime(UTIME_SETALARM, &tv);
+ 		assert(tv.tv_sec == 0);
+ 		timer_value= *tvp;
+ 		timer_running= TRUE;
+ 	}
+ 	else if (tv.tv_sec < timer_value.tv_sec || 
+ 		(tv.tv_sec == timer_value.tv_sec && 
+ 		tv.tv_usec < timer_value.tv_usec))
+ 	{
+ 		/* If the previous timer expires just before we set the 
+ 		 * new timer, the handler is lost unless tf_critical is set,
+ 		 * then the handler will set a new new timer 1 second later.
+ 		 */
+ 		tf_critical= TRUE;
+ 		sysutime(UTIME_SETALARM, &tv);
+ 		timer_value= *tvp;
+ 		tf_critical= FALSE;
+ 	}
+ 	tf_critical= TRUE;
+ 	if (tf_expired)
+ 	{
+ 		tf_critical= FALSE;
+ 		tf_expired= FALSE;
+ 		errno= EINTR;
+ 		return -1;
+ 	}
+ 	r= fwait(fwp);
+ 	tf_critical= FALSE;
+ 	return r;
+ }
+ #endif /* _MINIX */
+ #endif /* AMOEBA || _MINIX */
diff -c mit/server/os/access.c:1.1.1.2 mit/server/os/access.c:2.6
*** mit/server/os/access.c:1.1.1.2	Sat Mar 12 00:35:15 1994
--- mit/server/os/access.c	Sat Mar 12 00:35:16 1994
***************
*** 22,27 ****
--- 22,28 ----
  
  ******************************************************************/
  
+ /* $XFree86: mit/server/os/access.c,v 2.6 1993/09/22 15:49:42 dawes Exp $ */
  /* $XConsortium: access.c,v 1.54 92/05/19 17:23:02 keith Exp $ */
  
  #include "Xos.h"
***************
*** 30,47 ****
  #include "misc.h"
  #include "site.h"
  #include <errno.h>
  #include <sys/socket.h>
  #include <sys/ioctl.h>
  #include <X11/Xauth.h>
  
! #ifdef TCPCONN
  #include <netinet/in.h>
! #endif /* TCPCONN */
  #ifdef DNETCONN
  #include <netdnet/dn.h>
  #include <netdnet/dnetdb.h>
  #endif
  
  #ifdef hpux
  # include <sys/utsname.h>
  # ifdef HAS_IFREQ
--- 31,82 ----
  #include "misc.h"
  #include "site.h"
  #include <errno.h>
+ #ifndef AMOEBA
+ #ifndef _MINIX
+ #ifdef ESIX
+ #include <lan/socket.h>
+ #else
  #include <sys/socket.h>
+ #endif
  #include <sys/ioctl.h>
+ #endif
+ #else /* AMOEBA */
+ #include <amoeba.h>
+ #include <cmdreg.h>
+ #include <stdcom.h>
+ #include <stderr.h>
+ #include <ampolicy.h>
+ #include <server/ip/hton.h>
+ #include <server/ip/types.h>
+ #include <server/ip/tcpip.h>
+ #include <server/ip/tcp_io.h>
+ #include <server/ip/gen/in.h>
+ #include <server/ip/gen/tcp.h>
+ #include <server/ip/gen/tcp_io.h>
+ #include <server/ip/gen/socket.h>
+ #endif /* AMOEBA */
  #include <X11/Xauth.h>
  
! #if defined(TCPCONN) || defined(ISC)
! #ifndef _MINIX
  #include <netinet/in.h>
! #else
! #include <sys/ioctl.h>
! #include <net/gen/in.h>
! #include <net/gen/netdb.h>
! #include <net/gen/tcp.h>
! #include <net/gen/tcp_io.h>
! #endif /* _MINIX */
! #endif /* TCPCONN || ISC */
  #ifdef DNETCONN
  #include <netdnet/dn.h>
  #include <netdnet/dnetdb.h>
  #endif
  
+ #if defined(SVR4) || defined(ISC) || defined(linux)
+ #define USE_FALLBACK_DEFINESELF
+ #endif
+ 
  #ifdef hpux
  # include <sys/utsname.h>
  # ifdef HAS_IFREQ
***************
*** 48,63 ****
  #  include <net/if.h>
  # endif
  #else
! #if defined(SVR4) || defined(SYSV386)
  # include <sys/utsname.h>
  #endif
  #if defined(SYSV) && defined(SYSV386)
  # include <sys/stream.h>
  #endif
  # include <net/if.h>
  #endif /* hpux */
  
  #include <netdb.h>
  #undef NULL
  #include <stdio.h>
  #include "dixstruct.h"
--- 83,123 ----
  #  include <net/if.h>
  # endif
  #else
! #if defined(SYSV386) || defined(USE_FALLBACK_DEFINESELF)
  # include <sys/utsname.h>
  #endif
  #if defined(SYSV) && defined(SYSV386)
  # include <sys/stream.h>
+ # ifdef ISC
+ #  include <sys/stropts.h>
+ #  include <sys/sioctl.h>
+ # endif /* ISC */
  #endif
+ #ifdef ESIX
+ # include <lan/if.h>
+ #else
+ #if !defined(AMOEBA) && !defined(_MINIX)
  # include <net/if.h>
+ #endif
+ #endif
  #endif /* hpux */
  
+ #ifdef SVR4
+ #include <sys/sockio.h>
+ #include <stropts.h>
+ #endif
+ 
+ #ifdef ESIX
+ #include <lan/netdb.h>
+ #else
+ #ifdef AMOEBA
+ #include <server/ip/gen/netdb.h>
+ #else
+ #ifndef _MINIX
  #include <netdb.h>
+ #endif
+ #endif /* AMOEBA */
+ #endif /* ESIX */
  #undef NULL
  #include <stdio.h>
  #include "dixstruct.h"
***************
*** 75,80 ****
--- 135,197 ----
  #ifdef hpux
  #define getpeername(fd, from, fromlen)	hpux_getpeername(fd, from, fromlen)
  #endif
+ #if defined(SYSV386) && defined(SYSV)
+ #define getpeername(fd, from, fromlen)	sysv386_getpeername(fd, from, fromlen)
+ #endif
+ 
+ #if defined(SVR4) || defined(ISC)
+ /* ifioctl() for SVR4 from Ian Donaldson <iand@labtam.labtam.oz.au> */
+ static int
+ ifioctl (fd, cmd, arg)
+     int fd;
+     int cmd;
+     char *arg;
+ {
+     struct strioctl ioc;
+     int ret;
+ 
+     bzero((char *) &ioc, sizeof(ioc));
+     ioc.ic_cmd = cmd;
+     ioc.ic_timout = 0;
+     if (cmd == SIOCGIFCONF)
+     {
+ 	ioc.ic_len = ((struct ifconf *) arg)->ifc_len;
+ 	ioc.ic_dp = ((struct ifconf *) arg)->ifc_buf;
+ #ifdef ISC
+ 	/* SIOCGIFCONF is somewhat brain damaged on ISC. The argument
+ 	 * buffer must contain the ifconf structure as header. Ifc_req
+ 	 * is also not a pointer but a one element array of ifreq
+ 	 * structures. On return this array is extended by enough
+ 	 * ifreq fields to hold all interfaces. The return buffer length
+ 	 * is placed in the buffer header.
+ 	 */
+         ((struct ifconf *) ioc.ic_dp)->ifc_len =
+                                          ioc.ic_len - sizeof(struct ifconf);
+ #endif
+     }
+     else
+     {
+ 	ioc.ic_len = sizeof(struct ifreq);
+ 	ioc.ic_dp = arg;
+     }
+     ret = ioctl(fd, I_STR, (char *) &ioc);
+     if (ret >= 0 && cmd == SIOCGIFCONF)
+ #ifdef SVR4
+ 	((struct ifconf *) arg)->ifc_len = ioc.ic_len;
+ #endif
+ #ifdef ISC
+     {
+ 	((struct ifconf *) arg)->ifc_len =
+ 				 ((struct ifconf *)ioc.ic_dp)->ifc_len;
+ 	((struct ifconf *) arg)->ifc_buf = 
+ 			(caddr_t)((struct ifconf *)ioc.ic_dp)->ifc_req;
+     }
+ #endif
+     return(ret);
+ }
+ #else /* SVR4 || ISC */
+ #define ifioctl ioctl
+ #endif /* SVR4 || ISC */
  
  static int ConvertAddr(), CheckAddr();
  static Bool NewHost();
***************
*** 120,133 ****
      LocalHostEnabled = FALSE;
  }
  
! #if defined(SVR4) || defined (SYSV386) || (defined (hpux) && ! defined (HAS_IFREQ))
  /* Define this host for access control.  Find all the hosts the OS knows about 
   * for this fd and add them to the selfhosts list.
!  * hpux, SVR4, and SYSV386 do not have SIOCGIFCONF ioctl;
   */
  DefineSelf (fd)
      int fd;
  {
      register int n;
      int	len;
      caddr_t	addr;
--- 237,264 ----
      LocalHostEnabled = FALSE;
  }
  
! /*
!  * Amoeba doesn't need DefineSelf, since all TCP/IP connections made to
!  * the server always originate from remote clients.
!  */
! #ifndef AMOEBA
! #if defined (SYSV386) || defined (linux) || (defined (hpux) && ! defined (HAS_IFREQ))
  /* Define this host for access control.  Find all the hosts the OS knows about 
   * for this fd and add them to the selfhosts list.
!  * hpux, and some SYSV386 do not have SIOCGIFCONF ioctl;
   */
+ /* SVR4, ISC, linux use this if SIOCGIFCONF fails */
+ #ifdef USE_FALLBACK_DEFINESELF
+ static
+ FallbackDefineSelf(fd)
+ #else
  DefineSelf (fd)
+ #endif
      int fd;
  {
+ #if !defined(TCPCONN) && !defined(UNIXCONN)
+     return -1;
+ #else
      register int n;
      int	len;
      caddr_t	addr;
***************
*** 176,186 ****
--- 307,350 ----
  		    selfhosts = host;
  		}
  	    }
+ #ifdef XDMCP
+ 	    /*
+ 	     * If this isn't an Internet Address, don't register it.
+ 	     */
+ 	    if (family == FamilyInternet)
+ 	    {
+ 	      /*
+  	       * ignore 'localhost' entries as they're not useful
+ 	       * on the other end of the wire
+ 	       */
+ 	      if (len != 4 ||
+ 		  addr[0] != 127 || addr[1] != 0 ||
+ 		  addr[2] != 0 || addr[3] != 1)
+ 	      {
+ 		    struct sockaddr_in broad_addr;
+ 
+ 		    XdmcpRegisterConnection (family, (char *)addr, len);
+ 		    broad_addr = *inetaddr; /* is this our main addr? */
+ 		    broad_addr.sin_addr.s_addr = htonl (INADDR_BROADCAST);
+ 		    XdmcpRegisterBroadcastAddress (&broad_addr);
+ 	      }
+ 	    }
+ #endif
  	}
      }
+ #endif /* !TCPCONN && !UNIXCONN */
  }
  
+ #endif
+ #if (!defined(SYSV386) && !(defined (hpux) && ! defined (HAS_IFREQ))) || defined(USE_FALLBACK_DEFINESELF)
+ #ifndef _MINIX
+ 
+ #ifdef AF_LINK
+ #define ifr_size(p) ((p).sa_len > sizeof(p) ? (p).sa_len : sizeof(p))
  #else
+ #define ifr_size(p) (sizeof(p))
+ #endif
+ 
  /* Define this host for access control.  Find all the hosts the OS knows about 
   * for this fd and add them to the selfhosts list.
   */
***************
*** 187,193 ****
  DefineSelf (fd)
      int fd;
  {
!     char		buf[2048];
      struct ifconf	ifc;
      register int	n;
      int 		len;
--- 351,357 ----
  DefineSelf (fd)
      int fd;
  {
!     char		buf[2048], *cp, *cplim;
      struct ifconf	ifc;
      register int	n;
      int 		len;
***************
*** 227,238 ****
  #endif
      ifc.ifc_len = sizeof (buf);
      ifc.ifc_buf = buf;
!     if (ioctl (fd, (int) SIOCGIFCONF, (pointer) &ifc) < 0)
          Error ("Getting interface configuration");
!     for (ifr = ifc.ifc_req, n = ifc.ifc_len / sizeof (struct ifreq); --n >= 0;
!      ifr++)
      {
! 	len = sizeof(ifr->ifr_addr);
  #ifdef DNETCONN
  	/*
  	 * DECnet was handled up above.
--- 391,413 ----
  #endif
      ifc.ifc_len = sizeof (buf);
      ifc.ifc_buf = buf;
!     if (ifioctl (fd, (int) SIOCGIFCONF, (pointer) &ifc) < 0)
! #ifdef USE_FALLBACK_DEFINESELF
! 	return FallbackDefineSelf();
! #else
          Error ("Getting interface configuration");
! #endif
! #ifndef ISC
! #define IFC_IFC_REQ ifc.ifc_req
! #else
! #define IFC_IFC_REQ (struct ifreq *)ifc.ifc_buf
! #endif
!     cplim = (char *)IFC_IFC_REQ + ifc.ifc_len;
!     for (cp = (char *)IFC_IFC_REQ; cp < cplim;
! 	 cp += sizeof (ifr->ifr_name) + ifr_size(ifr->ifr_addr))
      {
! 	ifr = (struct ifreq*)cp;
! 	len = ifr_size(ifr->ifr_addr);
  #ifdef DNETCONN
  	/*
  	 * DECnet was handled up above.
***************
*** 286,298 ****
  	    	struct ifreq    broad_req;
      
  	    	broad_req = *ifr;
! 		if (ioctl (fd, SIOCGIFFLAGS, (char *) &broad_req) != -1 &&
  		    (broad_req.ifr_flags & IFF_BROADCAST) &&
  		    (broad_req.ifr_flags & IFF_UP)
  		    )
  		{
  		    broad_req = *ifr;
! 		    if (ioctl (fd, SIOCGIFBRDADDR, &broad_req) != -1)
  			broad_addr = broad_req.ifr_addr;
  		    else
  			continue;
--- 461,473 ----
  	    	struct ifreq    broad_req;
      
  	    	broad_req = *ifr;
! 		if (ifioctl (fd, SIOCGIFFLAGS, (char *) &broad_req) != -1 &&
  		    (broad_req.ifr_flags & IFF_BROADCAST) &&
  		    (broad_req.ifr_flags & IFF_UP)
  		    )
  		{
  		    broad_req = *ifr;
! 		    if (ifioctl (fd, SIOCGIFBRDADDR, &broad_req) != -1)
  			broad_addr = broad_req.ifr_addr;
  		    else
  			continue;
***************
*** 306,312 ****
--- 481,536 ----
  #endif
      }
  }
+ #else  /* _MINIX */
+ /* Define this host for access control.
+  */
+ DefineSelf (fd)
+     int fd;
+ {
+     int 		len;
+     int 		r;
+     pointer 		addr;
+     nwio_tcpconf_t	tcpconf;
+     HOST		*host;
+ 
+     /* Assume we only have tcp connections. */
+     r= ioctl(fd, NWIOGTCPCONF, &tcpconf);
+     if (r == -1)
+     {
+ 	Error("Unable to get local address from tcp fd");
+ 	return;
+     }
+     addr= (pointer)&tcpconf.nwtc_locaddr;
+     len= sizeof(tcpconf.nwtc_locaddr);
+     for (host = selfhosts; host && !addrEqual (0, addr, len, host);
+ 							    host = host->next)
+     {
+ 	/* Do nothing */ ;
+     }
+     if (host)
+ 	    return;
+     MakeHost(host,len)
+     if (host)
+     {
+ 	host->family = 0;
+ 	host->len = len;
+ 	acopy(addr, host->addr, len);
+ 	host->next = selfhosts;
+ 	selfhosts = host;
+     }
+ #ifdef XDMCP
+     {
+ 	ipaddr_t broad_addr;
+ 
+ 	XdmcpRegisterConnection (FamilyInternet, (char *)addr, len);
+ 	broad_addr= htonl(0xffffffff);
+ 	MNX_XdmcpRegisterBroadcastAddress (broad_addr);
+     }
+ #endif
+ }
+ #endif /* _MINIX */
  #endif /* hpux && !HAS_IFREQ */
+ #endif /* AMOEBA */
  
  #ifdef XDMCP
  void
***************
*** 354,364 ****
      char		fname[32];
      FILE		*fd;
      char		*ptr;
      union {
          struct sockaddr	sa;
! #ifdef TCPCONN
          struct sockaddr_in in;
! #endif /* TCPCONN */
  #ifdef DNETCONN
          struct sockaddr_dn dn;
  #endif
--- 578,589 ----
      char		fname[32];
      FILE		*fd;
      char		*ptr;
+ #ifndef AMOEBA
      union {
          struct sockaddr	sa;
! #if defined(TCPCONN) && !defined(_MINIX)
          struct sockaddr_in in;
! #endif /* TCPCONN && !_MINIX */
  #ifdef DNETCONN
          struct sockaddr_dn dn;
  #endif
***************
*** 367,372 ****
--- 592,598 ----
      struct nodeent 	*np;
      struct dn_naddr 	dnaddr, *dnaddrp, *dnet_addr();
  #endif
+ #endif /* AMOEBA */
      int			family;
      int			len;
      pointer		addr;
***************
*** 421,434 ****
  	}
  	else
  #endif /* SECURE_RPC */
! #ifdef TCPCONN
  	{
      	    /* host name */
      	    if (hp = gethostbyname (hostname))
  	    {
      		saddr.sa.sa_family = hp->h_addrtype;
  		len = sizeof(saddr.sa);
      		if ((family = ConvertAddr (&saddr.sa, &len, &addr)) != -1)
  		{
  #ifdef h_addr				/* new 4.3bsd version of gethostent */
  		    char **list;
--- 647,669 ----
  	}
  	else
  #endif /* SECURE_RPC */
! #if defined(TCPCONN) || defined(AMTCPCONN)
  	{
      	    /* host name */
      	    if (hp = gethostbyname (hostname))
  	    {
+ #ifndef AMOEBA
+ #ifndef _MINIX
      		saddr.sa.sa_family = hp->h_addrtype;
+ #else /* _MINIX */
+     		saddr.sa.sa_u.sa_family = hp->h_addrtype;
+ #endif /* !_MINIX */
  		len = sizeof(saddr.sa);
      		if ((family = ConvertAddr (&saddr.sa, &len, &addr)) != -1)
+ #else
+ 		len = sizeof(ipaddr_t);
+ 		if (hp->h_addrtype == AF_INET)
+ #endif
  		{
  #ifdef h_addr				/* new 4.3bsd version of gethostent */
  		    char **list;
***************
*** 442,448 ****
  		}
      	    }
      	}	
! #endif /* TCPCONN */
          }
          fclose (fd);
      }
--- 677,683 ----
  		}
      	    }
      	}	
! #endif /* TCPCONN || AMTCPCONN */
          }
          fclose (fd);
      }
***************
*** 453,467 ****
--- 688,733 ----
      ClientPtr client;
  {
      int    		alen, family;
+ #ifndef AMOEBA
      struct sockaddr	from;
+ #else
+     ipaddr_t          from;
+ #endif
+ #if defined(_MINIX) || defined(AMOEBA)
+     nwio_tcpconf_t    tcpconf;
+ #endif
      pointer		addr;
      register HOST	*host;
  
      if (!client || defeatAccessControl)
  	return TRUE;
+ #ifndef AMOEBA
+ #ifndef _MINIX
      alen = sizeof (from);
      if (!getpeername (((OsCommPtr)client->osPrivate)->fd, &from, &alen))
      {
+ #else /* _MINIX */
+     if (ioctl(((OsCommPtr)client->osPrivate)->fd, NWIOGTCPCONF,
+     							&tcpconf) != -1)
+     {
+     	from.sa_u.sa_in.sin_family= AF_INET;
+     	from.sa_u.sa_in.sin_addr= tcpconf.nwtc_remaddr;
+     	from.sa_u.sa_in.sin_port= tcpconf.nwtc_remport;
+     	alen= sizeof(from);
+ #endif /* !_MINIX */
+ #else /* AMOEBA */
+     /*
+      * Amoeba clients are always authorized.
+      * We might deal with access rights though (XXX)
+      */
+     if (((OsCommPtr)client->osPrivate)->family == FamilyAmoeba)
+       return TRUE;
+     if (((OsCommPtr)client->osPrivate)->family == FamilyInternet &&
+       tcp_ioc_getconf(&((OsCommPtr)client->osPrivate)->conn.tcp.cap, &tcpconf) == STD_OK)
+     {
+       alen = sizeof (ipaddr_t);
+       from = tcpconf.nwtc_remaddr;
+ #endif /* AMOEBA */
  	family = ConvertAddr (&from, &alen, &addr);
  	if (family == -1)
  	    return FALSE;
***************
*** 674,687 ****
--- 940,968 ----
  
      switch (family)
      {
+ #ifndef AMOEBA
  #ifdef TCPCONN
        case FamilyInternet:
+ #ifndef _MINIX
  	if (length == sizeof (struct in_addr))
+ #else
+ 	if (length == sizeof (ipaddr_t))
+ #endif
  	    len = length;
  	else
  	    len = -1;
          break;
  #endif 
+ #else /* AMOEBA */
+ #ifdef AMTCPCONN
+       case FamilyInternet:
+       if (length == sizeof (ipaddr_t))
+           len = length;
+       else
+           len = -1;
+         break;
+ #endif /* AMTCPCONN */
+ #endif /* AMOEBA */
  #ifdef DNETCONN
        case FamilyDECnet:
          {
***************
*** 707,713 ****
--- 988,998 ----
   * Returns 1 if host is invalid, 0 if we've found it. */
  
  InvalidHost (saddr, len)
+ #ifdef AMOEBA
+     register ipaddr_t         *saddr;
+ #else
      register struct sockaddr	*saddr;
+ #endif
      int				len;
  {
      int 			family;
***************
*** 750,762 ****
--- 1035,1056 ----
  
  static int
  ConvertAddr (saddr, len, addr)
+ #ifdef AMOEBA
+     register ipaddr_t         *saddr;
+ #else
      register struct sockaddr	*saddr;
+ #endif
      int				*len;
      pointer			*addr;
  {
+ #ifndef AMOEBA
      if (*len == 0)
          return (FamilyLocal);
+ #ifndef _MINIX
      switch (saddr->sa_family)
+ #else /* _MINIX */
+     switch (saddr->sa_u.sa_family)
+ #endif /* !_MINIX */
      {
      case AF_UNSPEC:
  #ifdef UNIXCONN
***************
*** 765,772 ****
--- 1059,1071 ----
          return FamilyLocal;
  #ifdef TCPCONN
      case AF_INET:
+ #ifndef _MINIX
          *len = sizeof (struct in_addr);
          *addr = (pointer) &(((struct sockaddr_in *) saddr)->sin_addr);
+ #else /* _MINIX */
+         *len = sizeof (ipaddr_t);
+         *addr = (pointer) &(saddr->sa_u.sa_in.sin_addr);
+ #endif /* !_MINIX */
          return FamilyInternet;
  #endif
  #ifdef DNETCONN
***************
*** 788,793 ****
--- 1087,1098 ----
      default:
          return -1;
      }
+ #else /* AMOEBA */
+     if (*len == 0) return -1;
+     *len = sizeof (ipaddr_t);
+     *addr = (pointer) saddr;
+     return FamilyInternet;
+ #endif /* AMOEBA */
  }
  
  int
diff -c mit/server/os/connection.c:1.1.1.3 mit/server/os/connection.c:2.2
*** mit/server/os/connection.c:1.1.1.3	Sat Mar 12 00:35:17 1994
--- mit/server/os/connection.c	Sat Mar 12 00:35:17 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/os/connection.c,v 2.2 1993/09/22 15:49:44 dawes Exp $ */
  /* $XConsortium: connection.c,v 1.146 92/06/11 10:38:45 rws Exp $ */
  /*****************************************************************
   *  Stuff to create connections --- OS dependent
***************
*** 41,50 ****
--- 42,59 ----
  
  #include "X.h"
  #include "Xproto.h"
+ #ifndef _MINIX
  #include <sys/param.h>
+ #endif
  #include <errno.h>
  #include "Xos.h"			/* for strings, file, time */
+ #if !defined(AMOEBA) && !defined(_MINIX)
+ #ifdef ESIX
+ #include <lan/socket.h>
+ #else
  #include <sys/socket.h>
+ #endif
+ #endif
  
  #include <signal.h>
  #include <setjmp.h>
***************
*** 54,64 ****
--- 63,78 ----
  #include <sys/ioctl.h>
  #endif
  
+ #ifdef SVR4
+ #include <sys/resource.h>
+ #endif
+ 
  #ifdef AIXV3
  #include <sys/ioctl.h>
  #endif
  
  #ifdef TCPCONN
+ #ifndef _MINIX
  # include <netinet/in.h>
  # ifndef hpux
  #  ifdef apollo
***************
*** 69,74 ****
--- 83,96 ----
  #   include <netinet/tcp.h>
  #  endif
  # endif
+ #else  /* _MINIX */
+ #include <sys/ioctl.h>
+ #include <stdlib.h>
+ #include <net/netlib.h>
+ #include <net/gen/in.h>
+ #include <net/gen/tcp.h>
+ #include <net/gen/tcp_io.h>
+ #endif /* _MINIX */
  #endif
  
  #ifdef UNIXCONN
***************
*** 81,87 ****
--- 103,111 ----
  #endif
  
  #include <stdio.h>
+ #if !defined(AMOEBA) && !defined(_MINIX)
  #include <sys/uio.h>
+ #endif
  #include "osstruct.h"
  #include "osdep.h"
  #include "opaque.h"
***************
*** 91,96 ****
--- 115,124 ----
  #include <netdnet/dn.h>
  #endif /* DNETCONN */
  
+ #ifndef SCO
+ #define	_OSWriteV	writev
+ #endif /* SCO */
+ 
  #ifdef SIGNALRETURNSINT
  #define SIGVAL int
  #else
***************
*** 110,118 ****
--- 138,180 ----
  #endif
  #endif
  
+ #ifdef SERVER_LOCALCONN
+ #include <sys/stream.h>
+ #include <sys/stropts.h>
+ #include <sys/utsname.h>
+ #ifndef UNIXCONN
+ #include <sys/stat.h>
+ #endif
+ #ifdef SVR4
+ static int NstrFd = -1;
+ #endif
+ static int ptsFd = -1;
+ static int spxFd = -1;
+ static int xsFd = -1;
+ static long AllStreams[mskcnt]; /* keep up, whos on a STREAMS pipe */
+ /*
+  * Why not use the same path as for UNIXCONN ?? 
+  * Diskless workstations may have a common /tmp directory. This may cause much
+  * trouble. Since every workstation MUST have it's own /dev, so lets use this
+  * directory.
+  */
+ #define X_STREAMS_DIR "/dev/X"
+ #define X_STREAMS_PATH "/dev/X/server."
+ #ifdef SVR4
+ # define X_NSTREAMS_PATH "/dev/X/Nserver."
+ #endif
+ #define X_XSIGHT_PATH "/dev/X"
+ #if defined(SVR4_ACP) && defined(UNIXCONN)
+ # define X_ISC_DIR "/tmp/.ISC-unix"
+ # define X_ISC_PATH "/tmp/.ISC-unix/X"
+ #endif
+ #endif /* SERVER_LOCALCONN */
+ 
  extern char *display;		/* The display number */
+ #ifndef AMOEBA
  int lastfdesc;			/* maximum file descriptor */
  
+ #ifndef _MINIX
  long WellKnownConnections;	/* Listener mask */
  long EnabledDevices[mskcnt];	/* mask for input devices that are on */
  long AllSockets[mskcnt];	/* select on this */
***************
*** 121,128 ****
  long ClientsWithInput[mskcnt];	/* clients with FULL requests in buffer */
  long ClientsWriteBlocked[mskcnt];/* clients who cannot receive output */
  long OutputPending[mskcnt];	/* clients with reply/event data ready to go */
- long MaxClients = MAXSOCKS ;
  long NConnBitArrays = mskcnt;
  Bool NewOutputPending;		/* not yet attempted to write some new output */
  Bool AnyClientsWriteBlocked;	/* true if some client blocked on write */
  
--- 183,191 ----
  long ClientsWithInput[mskcnt];	/* clients with FULL requests in buffer */
  long ClientsWriteBlocked[mskcnt];/* clients who cannot receive output */
  long OutputPending[mskcnt];	/* clients with reply/event data ready to go */
  long NConnBitArrays = mskcnt;
+ #endif
+ long MaxClients = MAXSOCKS ;
  Bool NewOutputPending;		/* not yet attempted to write some new output */
  Bool AnyClientsWriteBlocked;	/* true if some client blocked on write */
  
***************
*** 132,149 ****
--- 195,240 ----
  
  static Bool debug_conns = FALSE;
  
+ #ifndef _MINIX
  static int SavedAllClients[mskcnt];
  static int SavedAllSockets[mskcnt];
  static int SavedClientsWithInput[mskcnt];
+ #endif /* _MINIX */
  int GrabInProgress = 0;
  
  int ConnectionTranslation[MAXSOCKS];
+ #endif /* !AMOEBA */
+ 
+ #ifdef _MINIX
+ asio_fd_set_t InprogressFdSet;	/* fds that have an operation in progress */
+ asio_fd_set_t ListenFdSet;	/* fds that accept new connections */
+ asio_fd_set_t CompletedFdSet;	/* fds that completed some I/O but have not
+ 				 * been able to process this information
+ 				 * synchronously (or completely) */
+ asio_fd_set_t ClientFdSet;	/* fds that belong to clients */
+ asio_fd_set_t IgnoreFdSet;	/* Ignore these clients if they have completed
+ 				 * I/O */
+ asio_fd_set_t GrabFdSet;	/* This is the client who has the grab, 
+ 				 * if any */
+ 
+ static int TcpListenFd= -1;	/* initialy there is no tcp fd. */
+ Bool AnyClientsWithInput= FALSE;
+ 
+ struct NewConnection
+ {
+ 	int nc_result;		/* What was the result */
+ 	int nc_errno;		/* and the error */
+ } NewTcpConnection;
+ #endif
+ 
  extern ClientPtr NextAvailableClient();
  
  extern SIGVAL AutoResetServer();
  extern SIGVAL GiveUp();
  extern XID CheckAuthorization();
+ #ifndef AMOEBA
  static void CloseDownFileDescriptor(), ErrorConnMax();
+ #endif
  extern void FreeOsBuffers(), ResetOsBuffers();
  
  #ifdef XDMCP
***************
*** 151,156 ****
--- 242,248 ----
  #endif
  
  #ifdef TCPCONN
+ #ifndef _MINIX
  static int
  open_tcp_socket ()
  {
***************
*** 157,162 ****
--- 249,257 ----
      struct sockaddr_in insock;
      int request;
      int retry;
+ #ifdef SVR4
+ #undef SO_DONTLINGER
+ #endif
  #ifndef SO_DONTLINGER
  #ifdef SO_LINGER
      static int linger[2] = { 0, 0 };
***************
*** 225,230 ****
--- 320,435 ----
      }
      return request;
  }
+ #else  /* _MINIX */
+ 
+ Bool EstablishNewConnections();
+ 
+ static int
+ MNX_open_tcp_socket (extra_fd)
+ int *extra_fd;
+ {
+ 	int fd, r, flags, retry;
+ 	char *tcp_dev, *check;
+ 	int display_no;
+ 	nwio_tcpconf_t tcpconf;
+ 	nwio_tcpcl_t tcpcl;
+ 
+ 	/* Allow the X server to run on a different IP device with the 
+ 	 * TCP_DEVICE environment variable, otherwise we take the default.
+ 	 */
+ 	tcp_dev= getenv("TCP_DEVICE");
+ 	if (tcp_dev == NULL)
+ 		tcp_dev= TCP_DEVICE;
+ 
+ 	fd= open(tcp_dev, O_RDWR);
+ 	if (fd == -1)
+ 	{
+ 		Error ("Creating TCP socket");
+ 		return -1;
+ 	} 
+ 	if (extra_fd)
+ 	{
+ 		*extra_fd= fd;
+ 
+ 		fd= open(tcp_dev, O_RDWR);
+ 		if (fd == -1)
+ 		{
+ 			Error ("Creating TCP socket");
+ 			close(*extra_fd);
+ 			return -1;
+ 		} 
+ 	}
+ 
+ 	/* Bind the socket */
+ 	display_no= strtol(display, &check, 0);
+ 	if (check[0] != '\0')
+ 	{
+ 		Error("Unable to parse display number");
+ 		return -1;
+ 	}
+ 	tcpconf.nwtc_flags= NWTC_SHARED | NWTC_LP_SET | NWTC_UNSET_RA |
+ 		NWTC_UNSET_RP;
+ 	tcpconf.nwtc_locport= htons(X_TCP_PORT + display_no);
+ 	r= ioctl(fd, NWIOSTCPCONF, &tcpconf);
+ 	if (r == -1)
+ 	{
+ 		Error ("Binding TCP socket");
+ 		close (fd);
+ 		return -1;
+ 	}
+ 
+ 	/* Mark the filedescriptor as asynchronous */
+ 	flags= fcntl(fd, F_GETFL);
+ 	if (flags == -1)
+ 	{
+ 		Error("Unable to get the flags of a tcp fd");
+ 		close(fd);
+ 		return -1;
+ 	}
+ 	r= fcntl(fd, F_SETFD, flags | FD_ASYNCHIO);
+ 	if (r == -1)
+ 	{
+ 		Error("Unable to enable asynchronous I/O on a tcp fd");
+ 		close(fd);
+ 		return -1;
+ 	}
+ 
+ 	/* Now try to listen, possible return values are:
+ 	 * EINPROGRESS:	the default, we can return the fd
+ 	 * EAGAIN:	all entry in the connection table are inuse, 
+ 	 *		we wait a few seconds.
+ 	 * 0:		some client arrived, we enqueue
+ 	 *		EstablishNewConnections
+ 	 */		
+ 	for (retry= 0; retry<10; retry++)
+ 	{
+ 		tcpcl.nwtcl_flags= 0;
+ 		r= ioctl(fd, NWIOTCPLISTEN, &tcpcl);
+ 		if (r == -1 && errno == EINPROGRESS)
+ 			return fd;	/* Normal case */
+ 		else if (r == -1 && errno == EAGAIN)
+ 		{
+ 			sleep(1);
+ 			continue;
+ 		}
+ 		else
+ 		{
+ 			NewTcpConnection.nc_result= r;
+ 			NewTcpConnection.nc_errno= errno;
+ 
+ 			/* Let EstablishNewConnections deal with this
+ 			 * situation
+ 			 */
+ 			QueueWorkProc(EstablishNewConnections, NULL, 
+ 				(pointer)&NewTcpConnection);
+ 			return fd;
+ 		}
+ 	}
+ 	Error ("Binding TCP socket");
+ 	close (fd);
+ 	return -1;
+ }
+ #endif /* _MINIX */
  #endif /* TCPCONN */
  
  #ifdef UNIXCONN
***************
*** 290,295 ****
--- 495,875 ----
  }
  #endif /*UNIXCONN */
  
+ #ifdef SERVER_LOCALCONN
+ 
+ #if !defined(SVR4) || defined(SVR4_ACP)
+ static int
+ connect_spipe(fd1, fd2)
+      int fd1, fd2;
+ {
+   long temp;
+   struct strfdinsert sbuf;
+ 
+   sbuf.databuf.maxlen = -1;
+   sbuf.databuf.len = -1;
+   sbuf.databuf.buf = NULL;
+   sbuf.ctlbuf.maxlen = sizeof(long);
+   sbuf.ctlbuf.len = sizeof(long);
+   sbuf.ctlbuf.buf = (caddr_t)&temp;
+   sbuf.offset = 0;
+   sbuf.fildes = fd2;
+   sbuf.flags = 0;
+   if (ioctl(fd1, I_FDINSERT, &sbuf) == -1) return (-1);
+   
+   return (0);
+ }
+ 
+ static int
+ named_spipe(fd, path)
+      int fd;
+      char *path;
+ {
+   int oldUmask, ret;
+   struct stat sbuf;
+ 
+   oldUmask = umask(0);
+ 
+   (void) fstat(fd, &sbuf);
+   ret = mknod(path, 0020666, sbuf.st_rdev);
+ 
+   umask(oldUmask);
+ 
+   return (ret < 0 ? -1 : fd);
+ }
+ 
+ static int
+ open_isc_local ()
+ {
+   int fd = -1,fds = -1;
+   long temp;
+   struct strfdinsert buf;
+   char path[64];
+ 
+ #if defined(SVR4_ACP) && defined(UNIXCONN)
+   /*
+    * ISC local connections go the same place as Unix-domain sockets (brain
+    * death of the highest magnitude.  To allow this to function, we put
+    * the ISC streams pipe elsewhere.  This will require that a binary edit
+    * be done on ISC binaries under SVR4, but life is tough some times.
+    */
+   mkdir (X_ISC_DIR, 0777);
+   chmod (X_ISC_DIR, 0777);
+ 
+   strcpy (path, X_ISC_PATH);
+ #else /* SVR4_ACP && UNIXCONN */
+   mkdir (X_UNIX_DIR, 0777);
+   chmod (X_UNIX_DIR, 0777);
+ 
+   strcpy (path, X_UNIX_PATH);
+ #endif /* SVR4_ACP && UNIXCONN */
+ 
+   strcat (path, display);
+   
+   if(unlink(path) < 0 && errno != ENOENT) {
+     ErrorF ("XFree86: ISC listener pipe  in use (%s)\n", path);
+     return(-1);
+   }
+ 
+   if ((fds = open("/dev/spx", O_RDWR)) >= 0 &&
+       (fd  = open("/dev/spx", O_RDWR)) >= 0 )
+ 
+     if (connect_spipe(fds, fd) != -1 &&
+ 	named_spipe(fds, path) != -1)
+ 
+       return(fd);
+     else
+       Error("XFree86: Can't set up ISC listener pipes");
+ 
+ #ifndef SVR4
+   /*
+    * At this point, most SVR4 versions will fail on this, so leave out the
+    * warning
+    */
+   else
+     Error("XFree86: Cannot open \"/dev/spx\" for ISC listener");
+ #endif
+ 
+   (void) close(fds);
+   (void) close(fd);
+   return(-1);
+ }
+ 
+ 
+ static int
+ accept_isc_local()
+ {
+   struct strrecvfd buf;
+ 
+   while (ioctl(spxFd, I_RECVFD, &buf) < 0)
+     if (errno != EAGAIN) {
+       Error("XFree86: Can't read fildes from ISC client");
+       return(-1);
+     }
+ 
+   BITSET(AllStreams, buf.fd);
+   return(buf.fd);
+ }
+ 
+ static int
+ open_xsight_local()
+ {
+   int fds = -1,fdr = -1;
+   char pathS[64], pathR[64];
+ 
+   sprintf(pathS, "%s%sS",X_XSIGHT_PATH, display);
+   sprintf(pathR, "%s%sR",X_XSIGHT_PATH, display);
+   
+   if((unlink(pathS) < 0 && errno != ENOENT) ||
+      (unlink(pathR) < 0 && errno != ENOENT))
+     {
+       ErrorF ("XFree86: SCO listener pipe in use (%s)\n",pathR);
+       return(-1);
+     }
+   
+   if ((fds = open("/dev/spx", O_RDWR)) >= 0 &&
+       (fdr = open("/dev/spx", O_RDWR)) >= 0 )
+ 
+     if (connect_spipe(fds, fdr) != -1 &&
+ 	named_spipe(fds, pathS) != -1 &&
+ 	named_spipe(fdr, pathR) != -1)
+       
+       return(fds);
+     else
+       Error("XFree86: Can't set up SCO listener pipes");
+   
+ #ifndef SVR4
+   /*
+    * At this point, most SVR4 versions will fail on this, so leave out the
+    * warning
+    */
+   else
+     Error("XFree86: Cannot open \"/dev/spx\" for SCO listener");
+ #endif
+ 
+   (void) close(fds);
+   (void) close(fdr);
+   return(-1);
+ }
+ 
+ 
+ static int
+ accept_xsight_local()
+ {
+   char c;
+   int fd;
+   long temp;
+   struct strfdinsert buf;
+ 
+   if (read(xsFd, &c, 1) < 0) {
+     Error("XFree86: Can't read from SCO client");
+     return(-1);
+   }
+ 
+   if ((fd = open("/dev/spx", O_RDWR)) < 0) {
+     Error("XFree86: Can't open \"/dev/spx\" for SCO client connection");
+     return(-1);
+   }
+ 
+   if (connect_spipe(xsFd, fd) < 0) {
+     Error("XFree86: Can't connect pipes for SCO client connection");
+     (void) close(fd);
+     return(-1);
+   }
+ 
+   BITSET(AllStreams, fd);
+   return(fd);
+ }
+ #endif /* SVR4 */
+ 
+ static int
+ open_att_local ()
+ {
+   char *slave;
+   int fd;
+   char path[64];
+ 
+   mkdir (X_STREAMS_DIR, 0777);
+   chmod (X_STREAMS_DIR, 0777);
+   
+   strcpy (path, X_STREAMS_PATH);
+   strcat (path, display);
+   
+   if((unlink(path) < 0 && errno != ENOENT)) {
+     ErrorF ("XFree86: USL listener pipe in use (%s)\n", path);
+     return(-1);
+   }
+   
+   if( (fd = open("/dev/ptmx", O_RDWR)) < 0 ) {
+     Error ("XFree86: Cannot open \"/dev/ptmx\" for USL listener");
+     return(-1);
+   }
+   
+   grantpt(fd);
+   unlockpt(fd);
+   slave = (char *) ptsname(fd);
+   if (link(slave, path) < 0 || chmod(path, 0666) < 0) {
+     Error("XFree86: Can't set up local USL listener");
+     return(-1);
+   }
+ 
+   if (open(path, O_RDWR) < 0) {
+     ErrorF("XFree86: Can't open %s for USL listener\n", path);
+     close(fd);
+     return(-1);
+   }
+ 
+   return(fd);
+ }
+ 
+ #ifdef SVR4
+ static int
+ open_att_svr4_local ()
+ {
+   int fd[2], tfd;
+   char path[64];
+ 
+   mkdir (X_STREAMS_DIR, 0777);
+   chmod (X_STREAMS_DIR, 0777);
+   
+   strcpy (path, X_NSTREAMS_PATH);
+   strcat (path, display);
+   
+   if ((unlink(path) < 0 && errno != ENOENT)) {
+     ErrorF ("XFree86: SVR4 named listener pipe in use (%s)\n", path);
+     return(-1);
+   }
+ 
+   if ((tfd = creat(path, (mode_t)0666)) < 0) {
+     ErrorF("XFree86: Can't create named-streams path (%s)\n", path);
+     return(-1);
+   }
+   close(tfd);
+   if (chmod(path, (mode_t)0666) < 0) {
+     ErrorF("XFree86: Can't change mode on %s\n", path);
+     return(-1);
+   }
+ 
+   if (pipe(fd) != 0) {
+     Error("XFree86: SVR4 named listener pipe creation failed\n");
+     return(-1);
+   }
+ 
+   if (ioctl(fd[0], I_PUSH, "connld") != 0) {
+     Error("XFree86: ioctl(I_PUSH) failed for SVR4 named listener pipe\n");
+     return(-1);
+   }
+ 
+   if (fattach(fd[0], path) != 0) {
+     ErrorF("SVR4: fattach on %s failed for SVR4 named listener pipe\n", path);
+     return(-1);
+   }
+ 
+   return(fd[1]);
+ }
+ #endif /* SVR4 */
+ 
+ static int
+ accept_att_local()
+ {
+   int newconn;
+   int read_in;
+   char length;
+   char path[64];
+ 
+   /*
+    * first get device-name
+    */
+   if( (read_in = read(ptsFd, &length, 1)) <= 0 ) {
+     Error("XFree86: Can't read slave name length from USL client connection");
+     return(-1);
+   }
+ 
+   if( (read_in = read(ptsFd, path, length)) <= 0 ) {
+     Error("XFree86: Can't read slave name from USL client connection");
+     return(-1);
+   }
+ 
+   path[ length ] = '\0';
+       
+   if( (newconn = open(path,O_RDWR)) < 0 ) {
+     Error("XFree86: Can't open slave for USL client connection");
+     return(-1);
+   }
+ 
+   (void) write(newconn, "1", 1); /* send an acknowledge to the client */
+ 
+   BITSET(AllStreams, newconn);
+   return(newconn);
+ }
+ 
+ #ifdef SVR4
+ static int
+ accept_att_svr4_local()
+ {
+   struct strrecvfd str;
+ 
+   if (ioctl(NstrFd, I_RECVFD, &str) < 0) {
+     ErrorF("XFree86: I_RECVFD failed on SVR4 named client connection\n");
+     return(-1);
+   }
+   BITSET(AllStreams, str.fd);
+   return(str.fd);
+ }
+ #endif /* SVR4 */
+ #endif /* SERVER_LOCALCONN */
+ 
+ #ifdef SYSV386
+ int
+ sysv386_getpeername(fd, from, fromlen)
+      int fd;
+      struct sockaddr *from;
+      int *fromlen;
+ {
+ #ifdef SERVER_LOCALCONN
+   /*
+    * check up whether our fd is really a streams pipe ( /dev/pts??? )
+    */
+   if (GETBIT(AllStreams, fd))
+     {
+       from->sa_family = AF_UNSPEC;
+       *fromlen = 0;
+       return 0;
+     }
+ #endif /* SERVER_LOCALCONN */
+ #if defined(TCPCONN) || defined(DNETCONN) || defined(UNIXCONN)
+   return getpeername(fd, from, fromlen);
+ #endif
+ }
+ 
+ int
+ sysv386_accept (fd, from, fromlen)
+ int fd;
+ struct sockaddr *from;
+ int *fromlen;
+ {
+ #ifdef SERVER_LOCALCONN
+   if (fd == ptsFd) return accept_att_local();
+ #ifdef SVR4
+   if (fd == NstrFd) return accept_att_svr4_local();
+ #endif /* SVR4 */
+ #if !defined(SVR4) || defined(SVR4_ACP)
+   if (fd == spxFd) return accept_isc_local();
+   if (fd == xsFd)  return accept_xsight_local(); 
+ #endif /* !SVR4 || SVR4_ACP) */
+ #endif /* SERVER_LOCALCONN */
+ /*
+  * else we are handling the normal accept case
+  */
+ #if defined(TCPCONN) || defined(DNETCONN) || defined(UNIXCONN)
+   return accept (fd, from, fromlen);
+ #endif
+ }
+ 
+ #define	getpeername	sysv386_getpeername
+ #define	accept		sysv386_accept
+ 
+ #endif /* SYSV386 */
+ 
  #ifdef hpux
  /*
   * hpux returns EOPNOTSUPP when using getpeername on a unix-domain
***************
*** 353,358 ****
--- 933,942 ----
  }
  #endif /* DNETCONN */
  
+ #define NOROOM "Maximum number of clients reached"
+ 
+ #ifndef AMOEBA
+ 
  /*****************
   * CreateWellKnownSockets
   *    At initialization, create the sockets to listen on for new clients.
***************
*** 362,368 ****
--- 946,963 ----
  CreateWellKnownSockets()
  {
      int		request, i;
+ #ifdef SVR4
+     struct rlimit Rlimit;
+ #endif
+ #if _MINIX
+     int		extra_fd;
+ #endif
  
+ #if defined(SERVER_LOCK)
+     Lock_Server();
+ #endif /* SERVER_LOCK */
+ 
+ #ifndef _MINIX
      CLEARBITS(AllSockets);
      CLEARBITS(AllClients);
      CLEARBITS(LastSelectMask);
***************
*** 370,379 ****
  
      for (i=0; i<MAXSOCKS; i++) ConnectionTranslation[i] = 0;
      
! #if defined(hpux) || defined(SVR4)
  	lastfdesc = _NFILE - 1;
! #else
! 	lastfdesc = getdtablesize() - 1;
  #endif	/* hpux */
  
      if (lastfdesc > MAXSOCKS)
--- 965,992 ----
  
      for (i=0; i<MAXSOCKS; i++) ConnectionTranslation[i] = 0;
      
! #if defined(hpux)
!     lastfdesc = _NFILE - 1;
! #else   /* hpux */
! #ifdef SVR4
!     if (getrlimit(RLIMIT_NOFILE, &Rlimit) != 0)
!     {
  	lastfdesc = _NFILE - 1;
!     }
!     else
!     {
! 	/*
! 	 * If the limit is at infinity, the server could be QUITE busy,
! 	 * so set a reasonable limit.
! 	 */
! 	if (Rlimit.rlim_cur == RLIM_INFINITY)
! 	    lastfdesc = 1024;
! 	else
! 	    lastfdesc = Rlimit.rlim_cur;
!     }
! #else   /* SVR4 */
!     lastfdesc = getdtablesize() - 1;
! #endif  /* SVR4 */
  #endif	/* hpux */
  
      if (lastfdesc > MAXSOCKS)
***************
*** 384,389 ****
--- 997,1021 ----
      }
  
      WellKnownConnections = 0;
+ #ifdef SERVER_LOCALCONN
+     CLEARBITS(AllStreams);
+     if ((ptsFd = open_att_local ()) != -1) {
+ 	WellKnownConnections |= (1L << ptsFd);
+     }
+ #ifdef SVR4
+     if ((NstrFd = open_att_svr4_local ()) != -1) {
+ 	WellKnownConnections |= (1L << NstrFd);
+     }
+ #endif /* SVR4 */
+ #if !defined(SVR4) || defined(SVR4_ACP)
+     if ((spxFd = open_isc_local ()) != -1) {
+ 	WellKnownConnections |= (1L << spxFd);
+     }
+     if ((xsFd = open_xsight_local ()) != -1) {
+ 	WellKnownConnections |= (1L << xsFd);
+     } 
+ #endif /* !SVR4 || SVR4_ACP */
+ #endif /* SERVER_LOCALCONN */
  #ifdef TCPCONN
      if ((request = open_tcp_socket ()) != -1) {
  	WellKnownConnections |= (1L << request);
***************
*** 393,398 ****
--- 1025,1034 ----
      {
  	FatalError ("Cannot establish tcp listening socket");
      }
+     else
+     {
+ 	ErrorF ("Cannot establish tcp listening socket");
+     }
  #endif /* TCPCONN */
  #ifdef DNETCONN
      if ((request = open_dnet_socket ()) != -1) {
***************
*** 403,408 ****
--- 1039,1048 ----
      {
  	FatalError ("Cannot establish dnet listening socket");
      }
+     else 
+     {
+ 	ErrorF ("Cannot establish dnet listening socket");
+     }
  #endif /* DNETCONN */
  #ifdef UNIXCONN
      if ((request = open_unix_socket ()) != -1) {
***************
*** 413,426 ****
--- 1053,1115 ----
      {
  	FatalError ("Cannot establish unix listening socket");
      }
+     else 
+     {
+ 	ErrorF ("Cannot establish unix listening socket");
+     }
  #endif /* UNIXCONN */
      if (WellKnownConnections == 0)
          FatalError ("Cannot establish any listening sockets");
+ #else  /* _MINIX */
+     {
+ 	int no_listeners= 0;
+ 
+ 	for (i=0; i<MAXSOCKS; i++) 
+ 		ConnectionTranslation[i] = 0;
+     
+ 	lastfdesc = ASIO_FD_SETSIZE-1;	/* Can only fwait on these. */ 
+ 
+ 	if (lastfdesc > MAXSOCKS)
+ 	{
+ 		lastfdesc = MAXSOCKS;
+ 		if (debug_conns)
+ 			ErrorF( "GOT TO END OF SOCKETS %d\n", MAXSOCKS);
+ 	}
+ 
+ 	ASIO_FD_ZERO(&ListenFdSet);
+ 	ASIO_FD_ZERO(&InprogressFdSet);
+ 	ASIO_FD_ZERO(&CompletedFdSet);
+ 	ASIO_FD_ZERO(&ClientFdSet);
+ 	ASIO_FD_ZERO(&IgnoreFdSet);
+ 	ASIO_FD_ZERO(&GrabFdSet);
+ #ifdef TCPCONN
+ 	TcpListenFd = MNX_open_tcp_socket (&extra_fd);
+ 	if (TcpListenFd != -1)
+ 	{
+ 		if (TcpListenFd < 0 || TcpListenFd > lastfdesc)
+ 			FatalError("invaling tcp fd: %d\n", TcpListenFd);
+ 		ASIO_FD_SET(TcpListenFd, ASIO_IOCTL, &ListenFdSet);
+ 		ASIO_FD_SET(TcpListenFd, ASIO_IOCTL, &InprogressFdSet);
+ 		DefineSelf (extra_fd);
+ 		close(extra_fd);
+ 		no_listeners++;
+ 	}
+ 	else if (!PartialNetwork) 
+ 	{
+ 		FatalError ("Cannot establish tcp listening socket");
+ 	}
+ #endif /* TCPCONN */
+ 	if (no_listeners == 0)
+ 		FatalError ("Cannot establish any listening sockets");
+     }
+ #endif /* _MINIX */
      signal (SIGPIPE, SIG_IGN);
      signal (SIGHUP, AutoResetServer);
      signal (SIGINT, GiveUp);
      signal (SIGTERM, GiveUp);
+ #ifndef _MINIX
      AllSockets[0] = WellKnownConnections;
+ #endif
      ResetHosts(display);
      /*
       * Magic:  If SIGUSR1 was set to SIG_IGN when
***************
*** 476,481 ****
--- 1165,1173 ----
  	}
      }
  #endif /* UNIXCONN */
+ #ifdef SERVER_LOCALCONN
+     CLEARBITS(AllStreams);
+ #endif /* SERVER_LOCALCONN */
      ResetAuthorization ();
      ResetHosts(display);
      /*
***************
*** 513,518 ****
--- 1205,1211 ----
   *
   *****************************************************************/
  
+ #ifndef _MINIX
  char * 
  ClientAuthorized(client, proto_n, auth_proto, string_n, auth_string)
      ClientPtr client;
***************
*** 638,644 ****
  	}
  #endif /* TCP_NODELAY */
      /* ultrix reads hang on Unix sockets, hpux reads fail, AIX fails too */
! #if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(AIXV3))
  	(void) fcntl (newconn, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
--- 1331,1337 ----
  	}
  #endif /* TCP_NODELAY */
      /* ultrix reads hang on Unix sockets, hpux reads fail, AIX fails too */
! #if defined(O_NONBLOCK) && (!defined(SCO) && !defined(ultrix) && !defined(hpux) && !defined(AIXV3))
  	(void) fcntl (newconn, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
***************
*** 693,700 ****
      }
      return TRUE;
  }
! 
! #define NOROOM "Maximum number of clients reached"
  
  /************
   *   ErrorConnMax
--- 1386,1392 ----
      }
      return TRUE;
  }
! #endif /* _MINIX */
  
  /************
   *   ErrorConnMax
***************
*** 711,718 ****
--- 1403,1413 ----
      char byteOrder = 0;
      int whichbyte = 1;
      struct timeval waittime;
+ #ifndef _MINIX
      long mask[mskcnt];
+ #endif /* !_MINIX */
  
+ #ifndef _MINIX
      /* if these seems like a lot of trouble to go to, it probably is */
      waittime.tv_sec = BOTIMEOUT / MILLI_PER_SECOND;
      waittime.tv_usec = (BOTIMEOUT % MILLI_PER_SECOND) *
***************
*** 719,727 ****
  		       (1000000 / MILLI_PER_SECOND);
      CLEARBITS(mask);
      BITSET(mask, fd);
!     (void)select(fd + 1, (int *) mask, (int *) NULL, (int *) NULL, &waittime);
      /* try to read the byte-order of the connection */
      (void)read(fd, &byteOrder, 1);
      if ((byteOrder == 'l') || (byteOrder == 'B'))
      {
  	csp.success = xFalse;
--- 1414,1434 ----
  		       (1000000 / MILLI_PER_SECOND);
      CLEARBITS(mask);
      BITSET(mask, fd);
!     (void)select(fd + 1, (fd_set *) mask, (fd_set *) NULL, (fd_set *) NULL,
! 		 &waittime);
      /* try to read the byte-order of the connection */
      (void)read(fd, &byteOrder, 1);
+ #else
+     /* Try to read the byte-order of the connection.
+      * We sleep to avoid a call fwait.
+      */
+     sleep(1);
+     if (read(fd, &byteOrder, 1) == -1)
+     {
+ 	/* Out of luck */
+ 	return;
+     }
+ #endif
      if ((byteOrder == 'l') || (byteOrder == 'B'))
      {
  	csp.success = xFalse;
***************
*** 736,741 ****
--- 1443,1449 ----
  	    swaps(&csp.minorVersion, whichbyte);
  	    swaps(&csp.length, whichbyte);
  	}
+ #ifndef _MINIX
  	iov[0].iov_len = sz_xConnSetupPrefix;
  	iov[0].iov_base = (char *) &csp;
  	iov[1].iov_len = csp.lengthReason;
***************
*** 742,748 ****
  	iov[1].iov_base = NOROOM;
  	iov[2].iov_len = (4 - (csp.lengthReason & 3)) & 3;
  	iov[2].iov_base = pad;
! 	(void)writev(fd, iov, 3);
      }
  }
  
--- 1450,1462 ----
  	iov[1].iov_base = NOROOM;
  	iov[2].iov_len = (4 - (csp.lengthReason & 3)) & 3;
  	iov[2].iov_base = pad;
! 	(void)_OSWriteV(fd, iov, 3);
! #else
! 	/* Assume that the underlying devices buffer a bit */
!         write(fd, (char *)&csp, sz_xConnSetupPrefix);
!         write(fd, NOROOM, csp.lengthReason);
!         write(fd, pad, (4 - (csp.lengthReason & 3)) & 3);
! #endif
      }
  }
  
***************
*** 751,756 ****
--- 1465,1472 ----
   *     Remove this file descriptor and it's I/O buffers, etc.
   ************/
  
+ #ifndef _MINIX
+ 
  static void
  CloseDownFileDescriptor(oc)
      register OsCommPtr oc;
***************
*** 761,766 ****
--- 1477,1485 ----
      FreeOsBuffers(oc);
      BITCLEAR(AllSockets, connection);
      BITCLEAR(AllClients, connection);
+ #ifdef SERVER_LOCALCONN
+     BITCLEAR(AllStreams, connection);
+ #endif
      BITCLEAR(ClientsWithInput, connection);
      if (GrabInProgress)
      {
***************
*** 806,813 ****
   	    curclient = curoff + (i << 5);
              CLEARBITS(tmask);
              BITSET(tmask, curclient);
!             r = select (curclient + 1, (int *)tmask, (int *)NULL, (int *)NULL, 
! 			&notime);
              if (r < 0)
  		CloseDownClient(clients[ConnectionTranslation[curclient]]);
  	    mask &= ~(1 << curoff);
--- 1525,1532 ----
   	    curclient = curoff + (i << 5);
              CLEARBITS(tmask);
              BITSET(tmask, curclient);
!             r = select (curclient + 1, (fd_set *)tmask, (fd_set *)NULL,
! 			(fd_set *)NULL, &notime);
              if (r < 0)
  		CloseDownClient(clients[ConnectionTranslation[curclient]]);
  	    mask &= ~(1 << curoff);
***************
*** 815,821 ****
      }	
  }
  
- 
  /*****************
   * CloseDownConnection
   *    Delete client from AllClients and free resources 
--- 1534,1539 ----
***************
*** 974,979 ****
--- 1692,2678 ----
      }
  }
  
+ #else  /* _MINIX */
+ 
+ char * 
+ ClientAuthorized(client, proto_n, auth_proto, string_n, auth_string)
+     ClientPtr client;
+     char *auth_proto, *auth_string;
+     unsigned short proto_n, string_n;
+ {
+     register OsCommPtr priv;
+     XID	 auth_id;
+     int 		len;
+     int 		r;
+     struct sockaddr 	addr;
+     nwio_tcpconf_t	tcpconf;
+ 
+     auth_id = CheckAuthorization (proto_n, auth_proto,
+ 				  string_n, auth_string);
+ 
+     priv = (OsCommPtr)client->osPrivate;
+ 
+     /* Assume we only have tcp connections. */
+     r= ioctl(priv->fd, NWIOGTCPCONF, &tcpconf);
+     if (r == -1)
+     {
+ 	Error("Unable to get remote address from tcp fd");
+ 	return ;
+     }
+     addr.sa_u.sa_in.sin_family= AF_INET;
+     addr.sa_u.sa_in.sin_addr= tcpconf.nwtc_remaddr;
+     addr.sa_u.sa_in.sin_port= tcpconf.nwtc_remport;
+     len= sizeof(addr);
+ 
+     if (auth_id == (XID) ~0L && 
+         !InvalidHost (&addr, len))
+     {
+     	ErrorF("(warning) Authorization succeeded\n");
+ 	auth_id = (XID) 0;
+     }
+ 
+     if (auth_id == (XID) ~0L)
+ 	return "Client is not authorized to connect to Server";
+ 
+     priv->auth_id = auth_id;
+     priv->conn_time = 0;
+ 
+ #ifdef XDMCP
+     /* indicate to Xdmcp protocol that we've opened new client */
+     XdmcpOpenDisplay(priv->fd);
+ #endif /* XDMCP */
+ 
+     return((char *)NULL);
+ }
+ 
+ void CheckListeners();
+ 
+ Bool
+ EstablishNewConnections(clientUnused, closure)
+     ClientPtr clientUnused;
+     pointer closure;
+ {
+     struct NewConnection *newConnP;
+     register int newconn;         /* fd of new client */
+     long connect_time;
+     register ClientPtr client;
+     register OsCommPtr oc;
+     int i;
+ 
+     newConnP= (struct NewConnection *)closure;
+ 
+     newconn= -1;
+ 
+     /* Let's take some transport protocol specific actions */
+     if (newConnP == &NewTcpConnection)
+     {
+     	if (TcpListenFd < 0 || TcpListenFd > lastfdesc)
+     		FatalError("strange value in TcpListenFd\n");
+     	if (!ASIO_FD_ISSET(TcpListenFd, ASIO_IOCTL, &ListenFdSet) ||
+     		!ASIO_FD_ISSET(TcpListenFd, ASIO_IOCTL, &InprogressFdSet))
+     		FatalError("TcpListenFd not in progress\n");
+     	ASIO_FD_CLR(TcpListenFd, ASIO_IOCTL, &ListenFdSet);
+     	ASIO_FD_CLR(TcpListenFd, ASIO_IOCTL, &InprogressFdSet);
+     	newconn= TcpListenFd;
+     	TcpListenFd= -1;
+     }
+ 
+     if (newconn == -1)
+     	FatalError("Unable to locate transport protocol for NewConnection\n");
+ 
+     connect_time = GetTimeInMillis();
+     /* kill off stragglers */
+     for (i=1; i<currentMaxClients; i++)
+     {
+ 	if (client = clients[i])
+ 	{
+ 	    oc = (OsCommPtr)(client->osPrivate);
+ 	    if (oc && (oc->conn_time != 0) &&
+ 		(connect_time - oc->conn_time) >= TimeOutValue)
+ 		CloseDownClient(client);     
+ 	}
+     }
+ 
+     /* Let's check if we can start some listeners that stopped */
+     CheckListeners();
+ 
+     oc = (OsCommPtr)xalloc(sizeof(OsCommRec));
+     if (!oc)
+     {
+ 	ErrorConnMax(newconn);
+ 	close(newconn);
+ 	return TRUE;
+     }
+     /* Make sure that the client get called the first time */
+     ASIO_FD_SET(newconn, ASIO_READ, &CompletedFdSet);
+     AnyClientsWithInput= TRUE;
+ 
+     oc->fd = newconn;
+     oc->input = (ConnectionInputPtr)NULL;
+     oc->inputFake = (ConnectionInputPtr)NULL;
+     oc->output = (ConnectionOutputPtr)NULL;
+     oc->outputNext = (ConnectionOutputPtr)NULL;
+     oc->conn_time = connect_time;
+     if ((newconn < lastfdesc) &&
+ 	(client = NextAvailableClient((pointer)oc)))
+     {
+ 	ConnectionTranslation[newconn] = client->index;
+     }
+     else
+     {
+ 	ErrorConnMax(newconn);
+ 	CloseDownFileDescriptor(oc);
+     }
+     return TRUE;
+ }
+ 
+ static void
+ CloseDownFileDescriptor(oc)
+     register OsCommPtr oc;
+ {
+     int connection = oc->fd;
+     int i;
+ 
+     close(connection);
+     FreeOsBuffers(oc);
+ 
+     for (i= 0; i< ASIO_NR; i++)
+     {
+ 	ASIO_FD_CLR(connection, i, &InprogressFdSet);
+ 	ASIO_FD_CLR(connection, i, &CompletedFdSet);
+ 	ASIO_FD_CLR(connection, i, &ClientFdSet);
+ 	ASIO_FD_CLR(connection, i, &IgnoreFdSet);
+ 	ASIO_FD_CLR(connection, i, &GrabFdSet);
+     }
+     xfree(oc);
+ }
+ 
+ CloseDownConnection(client)
+     ClientPtr client;
+ {
+     OsCommPtr oc = (OsCommPtr)client->osPrivate;
+ 
+     if (oc->output && oc->output->count)
+ 	FlushClient(client, oc, (char *)NULL, 0);
+     ConnectionTranslation[oc->fd] = 0;
+ #ifdef XDMCP
+     XdmcpCloseDisplay(oc->fd);
+ #endif
+     CloseDownFileDescriptor(oc);
+     client->osPrivate = (pointer)NULL;
+ }
+ 
+ AddEnabledDevice(fd)
+     int fd;
+ {
+     ASIO_FD_SET(fd, ASIO_READ, &InprogressFdSet);
+ }
+ 
+ RemoveEnabledDevice(fd)
+     int fd;
+ {
+     ASIO_FD_CLR(fd, ASIO_READ, &InprogressFdSet);
+ }
+ 
+ OnlyListenToOneClient(client)
+     ClientPtr client;
+ {
+     OsCommPtr oc = (OsCommPtr)client->osPrivate;
+     int connection = oc->fd;
+ 
+     if (! GrabInProgress)
+     {
+         ASIO_FD_ZERO(&GrabFdSet);
+         ASIO_FD_SET(connection, ASIO_READ, &GrabFdSet);
+         GrabInProgress = TRUE;
+     }
+ }
+ 
+ ListenToAllClients()
+ {
+     if (GrabInProgress)
+     {
+ 	GrabInProgress = 0;
+ 	AnyClientsWithInput= TRUE;
+     }
+ }
+ 
+ IgnoreClient (client)
+     ClientPtr	client;
+ {
+     OsCommPtr   oc = (OsCommPtr) client->osPrivate;
+     int         connection = oc->fd;
+ 
+     ASIO_FD_SET(connection, ASIO_READ, &IgnoreFdSet);
+ }
+ 
+ AttendClient (client)
+     ClientPtr	client;
+ {
+     OsCommPtr   oc = (OsCommPtr) client->osPrivate;
+     int         connection = oc->fd;
+ 
+     ASIO_FD_CLR(connection, ASIO_READ, &IgnoreFdSet);
+     AnyClientsWithInput= TRUE;
+ }
+ 
+ void
+ EnqueueNewConnection(fd, operation, result, error)
+ int fd;
+ int operation;
+ int result;
+ int error;
+ {
+ 	/* Let's see which transport protocol got a new connection */
+ 	if (!ASIO_FD_ISSET(fd, operation, &ListenFdSet))
+ 		FatalError("result not in ListenFdSet\n");
+ 
+ 	if (fd == TcpListenFd)
+ 	{
+ 		/* New tcp connection */
+ 		NewTcpConnection.nc_result= result;
+ 		NewTcpConnection.nc_errno= error;
+ 
+ 		/* Let EstablishNewConnections deal with this
+ 		 * situation
+ 		 */
+ 		QueueWorkProc(EstablishNewConnections, NULL, 
+ 			(pointer)&NewTcpConnection);
+ 		return;
+ 	}
+ 
+ 	FatalError("Unable to find transport protocol for new connection\n");
+ }
+ 
+ void 
+ CheckListeners()
+ {
+ 	/* Check if all devices have listeners hanging around */
+ #ifdef TCPCONN
+ 	if (TcpListenFd == -1)
+ 	{
+ 	    TcpListenFd = MNX_open_tcp_socket (NULL);
+ 	    if (TcpListenFd != -1)
+ 	    {
+ 		    if (TcpListenFd < 0 || TcpListenFd > lastfdesc)
+ 			    FatalError("invalid tcp fd: %d\n", TcpListenFd);
+ 		    ASIO_FD_SET(TcpListenFd, ASIO_IOCTL, &ListenFdSet);
+ 		    ASIO_FD_SET(TcpListenFd, ASIO_IOCTL, &InprogressFdSet);
+ 	    }
+ 	}
+ #endif /* TCPCONN */
+ }
+ #endif /* _MINIX */
+ 
+ #else /* AMOEBA */
+ 
+ #include <amoeba.h>
+ #include <cmdreg.h>
+ #include <stdcom.h>
+ #include <stderr.h>
+ #include <ampolicy.h>
+ #include <server/ip/hton.h>
+ #include <server/ip/types.h>
+ #include <server/ip/tcpip.h>
+ #include <server/ip/tcp_io.h>
+ #include <server/ip/gen/in.h>
+ #include <server/ip/gen/tcp.h>
+ #include <server/ip/gen/tcp_io.h>
+ 
+ /*
+  * Size of reply buffer 
+  */
+ #define REPLY_BUFSIZE   30000
+ 
+ #ifdef XDEBUG
+ Bool		amDebug;		/* amoeba debug toggle */
+ #define dbprintf(list)	if (amDebug) { ErrorF list; }
+ #else
+ #define dbprintf(list)	/* nothing */
+ #endif /* XDEBUG */
+ 
+ capability	X;			/* X capability */
+ char		*XServerHostName;	/* X server host name */
+ char		*XTcpServerName;	/* TCP/IP server name */
+ long		MaxClients = MAXTASKS;
+ ClientPtr	newClient = NULL;	/* new connections */
+ ClientPtr	Clients[MAXTASKS];	/* clients with input */
+ int		maxClient;		/* Highest numbered client */
+ int		totalClients;		/* all connected applications */
+ ClientPtr       grabClient = NULL;	/* for grabs */
+ 
+ mutex		NewConnsLock;		/* prevent concurrent updates */
+ int		nNewConns;		/* # of new clients */
+ OsCommPtr	NewConns[MAXTASKS];	/* new client connections */
+ 
+ static void AmoebaConnectorThread();
+ static void AmoebaTCPConnectorThread();
+ 
+ void
+ CreateWellKnownSockets()
+ {
+     char		host[100];
+     char		*getenv();
+     void		DeviceReader();
+     errstat		err;
+     capability		pubX;
+     static int		threadsStarted = FALSE;
+ 
+     /*
+      * Each time the server is reset this routine is called to
+      * setup the new well known sockets. For Amoeba we'll just
+      * keep using the old threads that are already running.
+      */
+     if (!threadsStarted) {
+ 	threadsStarted = TRUE;
+ 	/*
+ 	 * Create a new capability for this X server
+ 	 */
+ 	if (XServerHostName == NULL)
+ 	    XServerHostName = getenv("XHOST");
+ 	if (XServerHostName == NULL)
+ 	    FatalError("XHOST not set, or server host name not given\n");
+ 	sprintf(host, "%s/%s:%s", DEF_XSVRDIR, XServerHostName, display);
+ 
+ 	uniqport(&X.cap_port);
+ 	priv2pub(&X.cap_port, &pubX.cap_port);
+ 	(void) name_delete(host);
+ 	if ((err = name_append(host, &pubX)) != 0) {
+ 	    (void) ErrorF("Cannot create capability %s: %s\n",
+ 		host, err_why(err));
+ 	    exit(1);
+ 	}
+ 
+ 	/*
+ 	 * Initialize new connections lock
+ 	 */
+ 	mu_init(&NewConnsLock);
+ 
+ 	/*
+ 	 * This critical region prevents the subthread from proceeding until
+ 	 * main has finished initializing. The matching sema_down() is in
+ 	 * WaitFor.c.
+ 	 */
+ 	sema_init(&init_sema, 0);
+ 
+ 	/*
+ 	 * Also, initialize main thread locking
+ 	 */
+ 	InitMainThread();
+ 
+ 	/*
+ 	 * Initialize and start IOP reader thread
+ 	 */
+ 	InitializeIOPServerReader();
+ 
+ 	/*
+ 	 * Start native Amoeba service threads
+ 	 */
+ 	if (thread_newthread(AmoebaConnectorThread, CONNECTOR_STACK, 0, 0) <= 0)
+ 	    FatalError("Cannot start Amoeba connector thread\n");
+ 	if (thread_newthread(AmoebaConnectorThread, CONNECTOR_STACK, 0, 0) <= 0)
+ 	    FatalError("Cannot start Amoeba connector thread\n");
+ 
+ 	/*
+ 	 * Start TCP/IP service threads
+ 	 */
+ 	if (XTcpServerName) {
+ 	    if (thread_newthread(AmoebaTCPConnectorThread,
+ 	      CONNECTOR_STACK, 0, 0) <= 0)
+ 		FatalError("Cannot start TCP connector thread\n");
+ 	    if (thread_newthread(AmoebaTCPConnectorThread,
+ 	      CONNECTOR_STACK, 0, 0) <= 0)
+ 		FatalError("Cannot start TCP connector thread\n");
+ 	}
+     }
+ 
+     ResetHosts(display);
+ 
+ #ifdef XDMCP
+     XdmcpInit ();
+ #endif
+ }
+ 
+ void
+ ResetWellKnownSockets ()
+ {
+     ResetAuthorization ();
+     ResetHosts(display);
+ 
+     /*
+      * restart XDMCP
+      */
+ #ifdef XDMCP
+     XdmcpReset ();
+ #endif
+ }
+ 
+ char * 
+ ClientAuthorized(client, proto_n, auth_proto, string_n, auth_string)
+     ClientPtr client;
+     char *auth_proto, *auth_string;
+     unsigned short proto_n, string_n;
+ {
+     register OsCommPtr priv;
+     XID	 auth_id;
+ 
+     auth_id = CheckAuthorization (proto_n, auth_proto,
+ 				  string_n, auth_string);
+ 
+     priv = (OsCommPtr)client->osPrivate;
+     /*
+      * Access control only works for X connections over a TCP/IP stream.
+      * The Amoeba philosophy is, when you have the capability you are
+      * allowed to talk with the server.
+      */
+     if (auth_id == (XID) ~0L) {
+ 	nwio_tcpconf_t tcpconf;
+ 
+ 	if (priv->family == FamilyInternet && 
+ 	  tcp_ioc_getconf(&priv->conn.tcp.cap, &tcpconf) == STD_OK &&
+ 	  !InvalidHost(&tcpconf.nwtc_remaddr, sizeof(ipaddr_t)))
+ 	    auth_id = (XID) 0;
+ 	if (priv->family == FamilyAmoeba)
+ 	    auth_id = (XID) 0;
+     }
+ 
+     if (auth_id == (XID) ~0L)
+ 	return "Client is not authorized to connect to Server";
+ 
+     priv->auth_id = auth_id;
+     priv->conn_time = 0;
+ 
+ #ifdef XDMCP
+     /* indicate to Xdmcp protocol that we've opened new client */
+     XdmcpOpenDisplay(priv->fd);
+ #endif /* XDMCP */
+     /* At this point, if the client is authorized to change the access control
+      * list, we should getpeername() information, and add the client to
+      * the selfhosts list.  It's not really the host machine, but the
+      * true purpose of the selfhosts list is to see who may change the
+      * access control list.
+      */
+     return((char *)NULL);
+ }
+ 
+ /*ARGSUSED*/
+ Bool
+ EstablishNewConnections(clientUnused, closure)
+     ClientPtr clientUnused;
+     pointer closure;
+ {
+     register ClientPtr	newClient;
+     register OsCommPtr	oc;
+     register int	i;
+     struct vc		*vc;
+     int			index;
+ 
+     mu_lock(&NewConnsLock);
+     for(index = 0; index < nNewConns; index++) {
+ 	oc = NewConns[index];
+ 
+ 	/*
+ 	 * Find a new slot
+ 	 */
+ 	if (totalClients >= MAXTASKS) {
+ 	    ErrorF("Too many X-clients are being served already\n");
+ 	    am_close(oc, VC_BOTH|VC_ASYNC);
+ 	    xfree((char *)oc);
+ 	    continue;
+ 	}
+ 	totalClients++;
+ 	for (i = 0; i < maxClient+1; i++)
+ 	    if (Clients[i] == 0) break;
+ 	if (i == maxClient) maxClient++;
+ 
+ 	/*
+ 	 * Fill in client's connection number
+ 	 */
+ 	oc->number = i;
+ 
+ 	/*
+ 	 * Now stuff the new client in the array where
+ 	 * WaitForSomething will find it and hand it up.
+ 	 */
+ 	newClient = NextAvailableClient((pointer)oc);
+ 	Clients[i] = newClient;
+     }
+     nNewConns = 0;
+     mu_unlock(&NewConnsLock);
+     return TRUE;
+ }
+ 
+ #define NOROOM "Maximum number of clients reached"
+ 
+ OnlyListenToOneClient(client)
+     ClientPtr client;
+ {
+     if (grabClient != NULL && grabClient != client) {
+ 	ErrorF("Uncancelled OnlyListenToOneClient()?\n");
+ 	grabClient = NULL;
+     } else
+ 	grabClient = client;
+ }
+ 
+ CloseDownConnection(client)
+     ClientPtr client;
+ {
+     register OsCommPtr	oc;
+ 
+     dbprintf(("Connection closed\n"));
+     oc = (OsCommPtr)client->osPrivate;
+     Clients[oc->number] = NULL;
+     if (oc->number == maxClient) maxClient--;
+     am_close(oc, VC_BOTH|VC_ASYNC);
+     if (oc->buffer) xfree(oc->buffer);
+     xfree(oc);
+     client->osPrivate = (pointer) NULL;
+ }
+ 
+ ListenToAllClients()
+ {
+     grabClient = NULL;
+ }
+ 
+ IgnoreClient (client)
+     ClientPtr	client;
+ {
+     OsCommPtr oc = (OsCommPtr)client->osPrivate;
+     oc->status |= IGNORE;
+ }
+ 
+ AttendClient (client)
+     ClientPtr	client;
+ {
+     OsCommPtr oc = (OsCommPtr)client->osPrivate;
+     oc->status &= ~IGNORE;
+     if (am_avail(oc, VC_IN)) {
+ 	WakeUpMainThread();
+     }
+ }
+ 
+ /* These two are dummies -- and are never called at run-time */
+ AddEnabledDevice(fd)
+     int fd;
+ {
+     return;
+ }
+ 
+ RemoveEnabledDevice(fd)
+     int fd;
+ {
+     return;
+ }
+ 
+ /*
+  * Wakeup main thread if necessary
+  */
+ static void
+ UnblockMain(oc)
+     register OsCommPtr oc;
+ {
+     if ((oc->status & IGNORE) == 0) {
+ 	WakeUpMainThread();
+     }
+ }
+ 
+ static char *
+ OsCommFamily(family)
+     int family;
+ {
+     switch (family) {
+     case FamilyAmoeba:
+ 	return "AMOEBA";
+     case FamilyInternet:
+ 	return "TCP/IP";
+     }
+     return "UNKNOWN";
+ }
+ 
+ static char *
+ OsCommStatus(status)
+     int status;
+ {
+     static char buf[100];
+ 
+     buf[0] = '\0';
+     if (status == 0)
+ 	sprintf(buf, "NONE");
+     if (status & CONN_KILLED)
+ 	sprintf(buf, "%s KILLED", buf);
+     if (status & REQ_PUSHBACK)
+ 	sprintf(buf, "%s PUSHBACK", buf);
+     if (status & IGNORE)
+ 	sprintf(buf, "%s IGNORE", buf);
+     return buf;
+ }
+ 
+ /*
+  * Return status information about the open connections
+  */
+ errstat
+ ConnectionStatus(hdr, buf, size)
+     header *hdr;
+     char *buf;
+     int size;
+ {
+     OsCommPtr	oc;
+     int		i;
+     char	*begin, *end;
+     char	*bprintf();
+ 
+     begin = buf;
+     end = buf + size;
+ 
+     /* all active clients */
+     if (maxClient > 0) {
+ 	begin = bprintf(begin, end, "Active clients:\n");
+ 	for (i = 0; i < maxClient; i++) {
+ 	    if (Clients[i] && (oc = (OsCommPtr)Clients[i]->osPrivate)) {
+ 		begin = bprintf(begin, end, "%d: Family %s, Status %s\n",
+ 		    i, OsCommFamily(oc->family), OsCommStatus(oc->status));
+ 	    }
+ 	}
+     }
+ 
+     /* all new (awaiting) clients */
+     mu_lock(&NewConnsLock);
+     if (nNewConns > 0) {
+ 	begin = bprintf(begin, end, "New clients:\n");
+ 	for (i = 0; i < nNewConns; i++) {
+ 	    oc = NewConns[i];
+ 	    begin = bprintf(begin, end, "%d: Family %s, Status %s\n",
+ 		i, OsCommFamily(oc->family), OsCommStatus(oc->status));
+ 	}
+     }
+     mu_unlock(&NewConnsLock);
+ 
+     if (begin == NULL) {
+ 	hdr->h_size = 0;
+ 	return STD_SYSERR;
+     } else {
+ 	hdr->h_size = begin - buf;
+ 	return STD_OK;
+     }
+ 	
+ }
+     
+ /*
+  * Establishing a new connection is done in two phases. This thread does the
+  * first part. It filters out bad connect requests. A new rendevous port is
+  * sent to the client and the main loop is informed if there is a legal
+  * request. The sleep synchronizes with the main loop so that the paperwork
+  * is finished for the current connect request before the thread is ready to
+  * accept another connect.
+  */
+ static void
+ AmoebaConnectorThread()
+ {
+     header	req, rep;
+     port	client_ports[2];
+     port	server_ports[2];
+     short	s;
+     OsCommPtr	oc;
+     char	*repb;
+     extern	CreateNewClient();
+ 
+     WaitForInitialization();
+     dbprintf(("AmoebaConnectorThread() running ...\n"));
+     if ((repb = (char *)malloc(REPLY_BUFSIZE)) == NULL)
+ 	FatalError("Amoeba connector thread: malloc failed");
+     for (;;) {
+ 	do {
+ 	    req.h_port = X.cap_port;
+ 	    s = getreq(&req, NILBUF, 0);
+ 	} while (ERR_CONVERT(s) == RPC_ABORTED);
+ 	if (ERR_STATUS(s))
+ 	    FatalError("Amoeba connector thread: getreq failed");
+ 	/* TODO: check privilege fields here */
+ 
+ 	dbprintf(("AmoebaConnectorThread() accepting a request\n"));
+ 
+ 	switch (req.h_command) {
+ 
+ 	case STD_INFO:
+ 	    rep.h_status = STD_OK;
+ 	    sprintf(repb, "X11R5 server on %s", XServerHostName);
+ 	    rep.h_size = strlen(repb);
+ 	    putrep(&rep, repb, rep.h_size);
+ 	    break;
+ 
+ 	case STD_STATUS:
+ 	    rep.h_status = ConnectionStatus(&rep, repb, REPLY_BUFSIZE);
+ 	    putrep(&rep, repb, rep.h_size);
+ 	    break;
+ 
+ 	case AX_SHUTDOWN:
+ 	    GiveUp();
+ 	    rep.h_status = STD_OK;
+ 	    putrep(&rep, NILBUF, 0);
+ 	    break;
+ 
+ 	case AX_REINIT:
+ 	    AutoResetServer();
+ 	    rep.h_status = STD_OK;
+ 	    putrep(&rep, NILBUF, 0);
+ 	    break;
+ 
+ 	case AX_CONNECT:
+ 	    /*
+ 	     * All is well. Open a virtual circuit and read the prefix
+ 	     */
+ 	    if (totalClients >= MAXTASKS) {
+ 		ErrorF("Connection refused: %s\n", NOROOM);
+ 		goto NoSpace;
+ 	    }
+ 
+ 	    /*
+ 	     * Fill operating system's communication structure
+ 	     */
+ 	    oc = (OsCommPtr)xalloc(sizeof(OsCommRec));
+ 	    if (oc == (OsCommPtr)NULL) {
+ 		ErrorF("Connection refused: No memory for connection data\n");
+ 		goto NoSpace;
+ 	    }
+ 	    oc->number = -1;
+ 	    oc->buffer = NULL;
+ 	    oc->size = 0;
+ 	    oc->status = 0;
+ 	    oc->family = FamilyAmoeba;
+ 	    oc->conn_time = 0L;
+ 
+ 	    /*
+ 	     * Now some priv2pub magic vc_create must be called with a put
+ 	     * port as first parameter and a get port as 2nd parameter.
+ 	     * Since we are a server we send the opposite to the client; ie.
+ 	     * a get port and a put port respectively.
+ 	     */
+ 	    uniqport(&client_ports[0]);
+ 	    uniqport(&server_ports[1]);
+ 	    priv2pub(&client_ports[0], &server_ports[0]);
+ 	    priv2pub(&server_ports[1], &client_ports[1]);
+ 	    oc->conn.vc = vc_create(&server_ports[0], &server_ports[1],
+ 				    MAXBUFSIZE, MAXBUFSIZE);
+ 	    if (oc->conn.vc == (struct vc *)NULL) {
+ NoSpace:
+ 	        rep.h_status = AX_FULLHOUSE;
+ 	        putrep(&rep, NILBUF, 0);
+ 	    } else {
+ 	        rep.h_status = AX_OK;
+ 	        putrep(&rep, (bufptr)client_ports, 2*sizeof(port));
+ 	        dbprintf(("Amoeba connection accepted\n"));
+ 
+ 		/*
+ 		 * Store for the main loop to finish creation
+ 		 */
+ 		vc_warn(oc->conn.vc, VC_IN, UnblockMain, (int) oc);
+ 		mu_lock(&NewConnsLock);
+ 		NewConns[nNewConns++] = oc;
+ 		mu_unlock(&NewConnsLock);
+ 		WakeUpMainThread();
+ 	    }
+ 	    break;
+ 
+ 	default:
+ 	    rep.h_status = STD_COMBAD;
+ 	    putrep(&rep, NILBUF, 0);
+ 	    break;
+ 	}
+     }
+ }
+ 
+ static void
+ TcpIpReaderSignalCatcher(sig, us, extra)
+     signum sig;
+     thread_ustate *us;
+     char *extra;
+ {
+     register OsCommPtr oc = (OsCommPtr) extra;
+ 
+     dbprintf(("TcpIpReaderSignalCatcher(%d), number %d\n", sig, oc->number));
+     if (oc->conn.tcp.signal != sig) {
+ 	ErrorF("TCP/IP Reader: Connection %s got unexpected signal %d\n",
+ 	    oc->number, sig);
+     }
+     oc->conn.tcp.signal = -1;
+     thread_exit();
+ }
+ 
+ /*
+  * TCP/IP reader thread
+  */
+ static void
+ TcpIpReaderThread(argptr, argsize)
+     void *argptr;
+     int argsize;
+ {
+     register OsCommPtr oc;
+ 
+     if (argsize != sizeof(OsCommPtr))
+ 	FatalError("Internal error: TcpIpReaderThread incorrectly called\n");
+     oc = *((OsCommPtr *) argptr);
+     (void)sig_catch(oc->conn.tcp.signal, TcpIpReaderSignalCatcher, (char*)oc);
+     while (TRUE) {
+ 	char buffer[MAXBUFSIZE];
+ 	bufsize size;
+ 
+ 	size = tcpip_read(&oc->conn.tcp.cap, buffer, sizeof(buffer));
+ 	dbprintf(("TcpIpReaderThread() read %d bytes\n", size));
+ 	if (ERR_STATUS(size)) {
+ 	    ErrorF("TCP/IP read failed (%s)\n", tcpip_why(ERR_CONVERT(size)));
+ 	    oc->status |= CONN_KILLED;
+ 	    oc->conn.tcp.signal = -1;
+ 	    thread_exit();
+ 	}
+ 	if (size == 0 || cb_puts(oc->conn.tcp.cb, buffer, size)) {
+ 	    if (size != 0)
+ 		ErrorF("TCP/IP short write to circular buffer\n");
+ 	    oc->status |= CONN_KILLED;
+ 	    oc->conn.tcp.signal = -1;
+ 	    thread_exit();
+ 	}
+ 	UnblockMain(oc);
+     }
+ }
+ 
+ /*
+  * To prevent the X-server from generating lots of error messages,
+  * in case the server is gone or when its full.
+  */
+ #define	LOOP_OPEN	1
+ #define	LOOP_SETCONF	2
+ #define	LOOP_LISTEN	4
+ 
+ /*
+  * The TCP/IP connector thread listens to a well known port (6000 +
+  * display number) for connection request. When such a request arrives
+  * it allocates a communication structure and a reader thread. This
+  * thread prevents the main loop from blocking when there's no data.
+  */
+ static void
+ AmoebaTCPConnectorThread()
+ {
+     capability		svrcap, chancap;
+     nwio_tcpconf_t	tcpconf;
+     nwio_tcpcl_t	tcpconnopt;
+     char 		name[BUFSIZ];
+     OsCommPtr		oc, *param;
+     errstat 		err;
+     int			result;
+     int			looping = 0;
+ 
+     strncpy(name, XTcpServerName, BUFSIZ);
+     if ((err = name_lookup(name, &svrcap)) != STD_OK) {
+ 	sprintf(name, "%s/%s", TCP_SVR_NAME, XTcpServerName);
+ 	if ((err = name_lookup(name, &svrcap)) != STD_OK)
+ 	    FatalError("Lookup %s failed: %s\n", XTcpServerName, err_why(err));
+     }
+ 
+     WaitForInitialization();
+     dbprintf(("AmoebaTCPConnectorThread() running ...\n"));
+ 
+     for (;;) {
+ 	/*
+ 	 * Listen to TCP/IP port X_TCP_PORT + display for connections.
+ 	 * Some interesting actions have to be taken to keep this connection
+ 	 * alive and kicking :-)
+ 	 */
+ 	if ((err = tcpip_open(&svrcap, &chancap)) != STD_OK) {
+ 	    /* the server probably disappeared, just wait for it to return */
+ 	    if (looping & LOOP_OPEN) {
+ 		ErrorF("TCP/IP open failed: %s\n", tcpip_why(err));
+ 		looping |= LOOP_OPEN;
+ 	    }
+ 	    sleep(60);
+ 	    (void) name_lookup(name, &svrcap);
+ 	    continue;
+ 	}
+ 	looping &= ~LOOP_OPEN;
+ 
+ 	tcpconf.nwtc_locport = htons(X_TCP_PORT + atoi(display));
+ 	tcpconf.nwtc_flags = NWTC_EXCL | NWTC_LP_SET | NWTC_UNSET_RA | 
+ 								NWTC_UNSET_RP;
+ 	if ((err = tcp_ioc_setconf(&chancap, &tcpconf)) != STD_OK) {
+ 	    /* couldn't configure, probably server space problem */
+ 	    if (looping & LOOP_SETCONF) {
+ 		ErrorF("TCP/IP setconf failed: %s\n", tcpip_why(err));
+ 		looping |= LOOP_SETCONF;
+ 	    }
+ 	    std_destroy(&chancap);
+ 	    sleep(60);
+ 	    continue;
+ 	}
+ 	looping &= ~LOOP_SETCONF;
+ 
+ 	tcpconnopt.nwtcl_flags = 0;
+ 	if ((err = tcp_ioc_listen(&chancap, &tcpconnopt)) != STD_OK) {
+ 	    /* couldn't listen, definitely a server memory problem */
+ 	    if (looping & LOOP_LISTEN) {
+ 		ErrorF("TCP/IP listen failed: %s\n", tcpip_why(err));
+ 		looping |= LOOP_LISTEN;
+ 	    }
+ 	    std_destroy(&chancap);
+ 	    sleep(60);
+ 	    continue;
+ 	}
+ 	looping &= ~LOOP_LISTEN;
+ 
+ 	if ((err = tcpip_keepalive_cap(&chancap)) != STD_OK) {
+ 	    ErrorF("TCP/IP keep alive failed: %s\n", tcpip_why(err));
+ 	    std_destroy(&chancap);
+ 	    continue;
+ 	}
+ 
+ 	/*
+ 	 * Fill operating system's communication structure
+ 	 */
+ 	oc = (OsCommPtr)xalloc(sizeof(OsCommRec));
+ 	if (oc == (OsCommPtr)NULL) {
+ 	    ErrorF("Connection refused: No memory for connection data\n");
+ 	    goto NoSpace;
+ 	}
+ 	oc->number = -1;
+ 	oc->buffer = NULL;
+ 	oc->size = 0;
+ 	oc->status = 0;
+ 	oc->family = FamilyInternet;
+ 	oc->conn_time = 0L;
+ 	oc->conn.tcp.cap = chancap;
+ 	if ((oc->conn.tcp.cb = cb_alloc(MAXBUFSIZE)) == NULL) {
+ 	    ErrorF("Connection refused: No memory for circular buffer\n");
+ 	    xfree((char *)oc);
+ 	    goto NoSpace;
+ 	}
+ 
+ 	/*
+ 	 * Start TCP/IP reader thread
+ 	 */
+ 	oc->conn.tcp.signal = sig_uniq();
+ 	param = (OsCommPtr *) malloc(sizeof(OsCommPtr));
+ 	*param = oc; /* stupid convention */
+ 	result = thread_newthread(TcpIpReaderThread,
+ 	    MAXBUFSIZE + CONNECTOR_STACK, (char *)param, sizeof(OsCommPtr));
+ 	if (result == 0) {
+ 	    ErrorF("Cannot start reader thread\n");
+ 	    cb_close(oc->conn.tcp.cb);
+ 	    cb_free(oc->conn.tcp.cb);
+ 	    xfree((char *)oc);
+ NoSpace:
+ 	    std_destroy(&chancap);
+ 	    continue;
+ 	}
+ 
+ 	/*
+ 	 * Store for the main loop to finish creation
+ 	 */
+ 	mu_lock(&NewConnsLock);
+ 	NewConns[nNewConns++] = oc;
+ 	mu_unlock(&NewConnsLock);
+ 	WakeUpMainThread();
+     }
+ }
+ #endif /* AMOEBA */
+ 
  #ifdef AIXV3
  
  static int grabbingClient;
***************
*** 1026,1028 ****
--- 2725,2769 ----
  }
  
  #endif
+ 
+ 
+ #if defined(SYSV) && defined(SYSV386) && !defined(STREAMSCONN)
+ #ifdef SCO
+ 
+ /*
+  * SCO does not have writev so we emulate
+  */
+ 
+ #include <sys/uio.h>
+ 
+ int _OSWriteV(fd, iov, iovcnt)
+ 	int				 fd;
+ 	struct iovec	*iov;
+ 	int				 iovcnt;
+ {
+     int i, len, total;
+     char *base;
+ 
+     errno = 0;
+     for (i = 0, total = 0; i < iovcnt; i++, iov++) {
+ 		len = iov->iov_len;
+ 		base = iov->iov_base;
+ 		while (len > 0) {
+ 			register int nbytes;
+ 
+ 			nbytes = write(fd, base, len);
+ 			if (nbytes < 0 && total == 0)
+ 				return(-1);
+ 			if (nbytes <= 0)
+ 				return(total);
+ 			errno = 0;
+ 			len   -= nbytes;
+ 			total += nbytes;
+ 			base  += nbytes;
+ 		}
+     }
+     return(total);
+ }
+ 
+ #endif /* SCO */
+ #endif /* SYSV && SYSV386 && !STREAMSCONN */
diff -c mit/server/os/io.c:1.1.1.1 mit/server/os/io.c:1.7
*** mit/server/os/io.c:1.1.1.1	Sat Mar 12 00:35:21 1994
--- mit/server/os/io.c	Sat Mar 12 00:35:21 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/os/io.c,v 1.7 1993/05/04 15:14:11 dawes Exp $ */
  /* $XConsortium: io.c,v 1.68 91/03/29 09:34:07 rws Exp $ */
  /*****************************************************************
   * i/o functions
***************
*** 34,41 ****
--- 35,44 ----
  #include "Xos.h"
  #include "Xmd.h"
  #include <errno.h>
+ #if !defined(AMOEBA) && !defined(_MINIX)
  #include <sys/param.h>
  #include <sys/uio.h>
+ #endif
  #include "X.h"
  #include "Xproto.h"
  #include "os.h"
***************
*** 44,49 ****
--- 47,57 ----
  #include "dixstruct.h"
  #include "misc.h"
  
+ #ifndef SCO
+ #define	_OSWriteV	writev
+ #endif /* SCO */
+ 
+ #if !defined(AMOEBA) && !defined(_MINIX)
  /* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
   * systems are broken and return EWOULDBLOCK when they should return EAGAIN
   */
***************
*** 61,71 ****
--- 69,81 ----
  extern long ClientsWithInput[];
  extern long ClientsWriteBlocked[];
  extern long OutputPending[];
+ #endif /* AMOEBA || _MINIX */
  extern int ConnectionTranslation[];
  extern Bool NewOutputPending;
  extern Bool AnyClientsWriteBlocked;
  static Bool CriticalOutputPending;
  static int timesThisConnection = 0;
+ #ifndef AMOEBA
  static ConnectionInputPtr FreeInputs = (ConnectionInputPtr)NULL;
  static ConnectionOutputPtr FreeOutputs = (ConnectionOutputPtr)NULL;
  static OsCommPtr AvailableInput = (OsCommPtr)NULL;
***************
*** 72,77 ****
--- 82,88 ----
  
  static ConnectionInputPtr AllocateInputBuffer();
  static ConnectionOutputPtr AllocateOutputBuffer();
+ #endif /* AMOEBA */
  
  extern int errno;
  
***************
*** 105,116 ****
--- 116,139 ----
  #define YieldControl()				\
          { isItTimeToYield = TRUE;		\
  	  timesThisConnection = 0; }
+ #ifndef _MINIX
  #define YieldControlNoInput()			\
          { YieldControl();			\
  	  BITCLEAR(ClientsWithInput, fd); }
+ #else
+ #define YieldControlNoInput()			\
+ 	{ YieldControl();			\
+ 	  ASIO_FD_CLR(fd, ASIO_READ, &CompletedFdSet); }
+ #endif
  #define YieldControlDeath()			\
          { timesThisConnection = 0; }
  
+ 
+     /* lookup table for adding padding bytes to data that is read from
+     	or written to the X connection.  */
+ static int padlength[4] = {0, 3, 2, 1};
+ 
+ #if !defined(AMOEBA) && !defined(_MINIX)
  int
  ReadRequestFromClient(client)
      ClientPtr client;
***************
*** 194,204 ****
--- 217,229 ----
  		      oci->size - oci->bufcnt); 
  	if (result <= 0)
  	{
+ #if !defined(SYSV386) || !defined(SVR4)
  	    if ((result < 0) && ETEST(errno))
  	    {
  		YieldControlNoInput();
  		return 0;
  	    }
+ #endif
  	    YieldControlDeath();
  	    return -1;
  	}
***************
*** 367,376 ****
  	YieldControlNoInput();
  }
  
-     /* lookup table for adding padding bytes to data that is read from
-     	or written to the X socket.  */
- static int padlength[4] = {0, 3, 2, 1};
- 
   /********************
   * FlushClient()
   *    If the client isn't keeping up with us, then we try to continue
--- 392,397 ----
***************
*** 441,447 ****
  	InsertIOV (padBuffer, padsize)
  
  	errno = 0;
! 	if ((len = writev(connection, iov, i)) >= 0)
  	{
  	    written += len;
  	    notWritten -= len;
--- 462,468 ----
  	InsertIOV (padBuffer, padsize)
  
  	errno = 0;
! 	if ((len = _OSWriteV(connection, iov, i)) >= 0)
  	{
  	    written += len;
  	    notWritten -= len;
***************
*** 454,459 ****
--- 475,483 ----
  #ifdef EMSGSIZE /* check for another brain-damaged OS bug */
  		 || ((errno == EMSGSIZE) && (todo == 1))
  #endif
+ #ifdef SERVER_LOCALCONN /* STREAMS ... */
+ 		 || ((errno == ERANGE) && (todo == 1))
+ #endif
  		)
  	{
  	    /* If we've arrived here, then the client is stuffed to the gills
***************
*** 513,518 ****
--- 537,548 ----
  	    todo >>= 1;
  	}
  #endif
+ #ifdef SERVER_LOCALCONN /* STREAMS ... */
+ 	else if (errno == ERANGE)
+ 	{
+ 	    todo >>= 1;
+ 	}
+ #endif
  	else
  	{
  	    close(connection);
***************
*** 598,603 ****
--- 628,634 ----
      }
  
  }
+ #endif /* !AMOEBA && !_MINIX */
  
  void
  FlushIfCriticalOutputPending()
***************
*** 623,628 ****
--- 654,660 ----
   *    this routine as int.
   *****************/
  
+ #if !defined(AMOEBA) && !defined(_MINIX)
  int
  WriteToClient (who, count, buf)
      ClientPtr who;
***************
*** 668,674 ****
--- 700,708 ----
      
      return(count);
  }
+ #endif /* !AMOEBA && !_MINIX */
  
+ #ifndef AMOEBA
  static ConnectionInputPtr
  AllocateInputBuffer()
  {
***************
*** 716,723 ****
--- 750,776 ----
      register ConnectionInputPtr oci;
      register ConnectionOutputPtr oco;
  
+ #ifndef _MINIX
      if (AvailableInput == oc)
  	AvailableInput = (OsCommPtr)NULL;
+ #else
+     if (oci = oc->inputFake)
+     {
+ 	if (FreeInputs)
+ 	{
+ 	    xfree(oci->buffer);
+ 	    xfree(oci);
+ 	}
+ 	else
+ 	{
+ 	    FreeInputs = oci;
+ 	    oci->next = (ConnectionInputPtr)NULL;
+ 	    oci->bufptr = oci->buffer;
+ 	    oci->bufcnt = 0;
+ 	    oci->lenLastReq = 0;
+ 	}
+     }
+ #endif
      if (oci = oc->input)
      {
  	if (FreeInputs)
***************
*** 748,753 ****
--- 801,822 ----
  	    oco->count = 0;
  	}
      }
+ #ifdef _MINIX
+     if (oco = oc->outputNext)
+     {
+ 	if (FreeOutputs)
+ 	{
+ 	    xfree(oco->buf);
+ 	    xfree(oco);
+ 	}
+ 	else
+ 	{
+ 	    FreeOutputs = oco;
+ 	    oco->next = (ConnectionOutputPtr)NULL;
+ 	    oco->count = 0;
+ 	}
+     }
+ #endif
  }
  
  void
***************
*** 769,771 ****
--- 838,1749 ----
  	xfree(oco);
      }
  }
+ #endif /* AMOEBA */
+ 
+ /*
+  * The rest of this file contains the Amoeba and Minix implementations.
+  */
+ 
+ #ifdef AMOEBA
+ #include <amoeba.h>
+ #include <cmdreg.h>
+ #include <stdcom.h>
+ #include <stderr.h>
+ #include <ampolicy.h>
+ #include <server/ip/hton.h>
+ #include <server/ip/types.h>
+ #include <server/ip/tcpip.h>
+ #include <server/ip/tcp_io.h>
+ #include <server/ip/gen/in.h>
+ #include <server/ip/gen/tcp.h>
+ #include <server/ip/gen/tcp_io.h>
+ 
+ /*
+  * Philip's TCP/IP server silently assumes a
+  * maximum buffer size of 30000 bytes.
+  */
+ #define	TCPIP_BUFSIZE	16384
+ 
+ int
+ ReadRequestFromClient(client)
+     ClientPtr client;
+ {
+     register OsCommPtr	oc = (OsCommPtr)client->osPrivate;
+     register xReq	*request;
+     register int	havenow, needed;
+     register char	*p;
+     int			stat, n, rv;
+ 
+     oc->status &= ~REQ_PUSHBACK;
+     if (oc->size == 0) {
+ 	if (oc->buffer) {
+ 	    Xfree(oc->buffer);
+ 	    oc->buffer = NULL;
+ 	}
+ 	if ((rv = am_avail(oc, VC_IN)) >= (SIZEOF(xReq))) {
+ 	    /*
+ 	     * Enough available to read first portion of
+ 	     * the request.
+ 	     */
+ 	    oc->buffer = (char *) xalloc(SIZEOF(xReq));
+ 	    if (oc->buffer == NULL) {
+ 		ErrorF("ReadRequestFromClient: out of memory\n");
+ 		return -1;
+ 	    }
+ 	    oc->size = SIZEOF(xReq);
+ 	    n = am_read(oc, oc->buffer, SIZEOF(xReq));
+ 	    if (n != SIZEOF(xReq)) {
+ 		ErrorF("ReadRequestFromClient: got %d wanted %d\n",
+ 		    n, SIZEOF(xReq));
+ 		return -1;
+ 	    }
+ 	} else if (rv < 0) {
+ 	    ErrorF("ReadRequestFromClient: read failed (connection %d)\n",
+ 		oc->number);
+ 	    oc->status |= CONN_KILLED;
+ 	    return -1;
+ 	} else {
+ 	    isItTimeToYield = TRUE;
+ 	    return 0;
+ 	}
+     }
+ 
+     /*
+      * See if we have enough in the local buffer,
+      * plus what is still in the virtual circuit.
+      */
+     if ((stat = am_avail(oc, VC_IN)) < 0) { /* oc closed */
+ 	ErrorF("ReadRequestFromClient: read failed (connection %d)\n",
+ 	    oc->number);
+ 	oc->status |= CONN_KILLED;
+ 	return -1;
+     }
+ 
+     havenow = oc->size + stat;
+     request = (xReq *)oc->buffer;
+     if (havenow < SIZEOF(xReq)) {
+ NotAllHereYet:
+ 	/* not a whole message yet; return */
+ 	isItTimeToYield = TRUE;
+ 	return 0;
+     }
+ 
+     /*
+      * Everything is ok, see how much we need to read
+      */
+     if (request != 0)
+ 	needed = request_length(request, client);
+     else
+ 	needed = -1;
+     if (needed <= 0)
+ 	needed = sizeof(xReq);
+     if (needed > havenow) {
+ 	if (havenow > oc->size) {
+ 	    if ((oc->buffer = (char *)xrealloc(oc->buffer, havenow)) == 0) {
+ 		ErrorF("ReadRequestFromClient: out of memory\n");
+ 		return -1;
+ 	    }
+ 	    n = am_read(oc, oc->buffer + oc->size, havenow - oc->size);
+ 	    if (n != havenow-oc->size) {
+ 		ErrorF("ReadRequestFromClient: got %d wanted %d\n",
+ 		    n, havenow-oc->size);
+ 		return -1;
+ 	    }
+ 	    oc->size = havenow;
+ 	}
+ 	goto NotAllHereYet;
+     }
+     if (needed > oc->size) {
+ 	if ((oc->buffer = (char *)Xrealloc(oc->buffer, needed)) == 0) {
+ 	    ErrorF("ReadRequestFromClient: out of memory\n");
+ 	    return -1;
+ 	}
+ 	request = (xReq *)oc->buffer;
+ 	n = am_read(oc, oc->buffer + oc->size, needed - oc->size);
+ 	if (n != needed-oc->size) {
+ 	    ErrorF("ReadRequestFromClient: got %d wanted %d\n",
+ 		n, needed-oc->size);
+ 	    return -1;
+ 	}
+     }
+     oc->size = 0;
+     if (++timesThisConnection >= MAX_TIMES_PER || isItTimeToYield) {
+ 	isItTimeToYield = TRUE;
+ 	timesThisConnection = 0;
+     }
+     client->requestBuffer = (pointer)oc->buffer;
+     return needed;
+ }
+ 
+ Bool
+ InsertFakeRequest(client, data, count)
+     ClientPtr client;
+     char *data;
+     int count;
+ {
+     register OsCommPtr      oc = (OsCommPtr)client->osPrivate;
+ 
+     oc->status |= REQ_PUSHBACK;
+     WakeUpMainThread();
+     if (oc->size) {
+ 	ErrorF("Warning: InsertFakeRequest(%d): %d already\n", count, oc->size);
+ 	oc->buffer = (char *)xrealloc(oc->buffer, oc->size+count);
+ 	if (oc->buffer == NULL) {
+ 	    ErrorF("InsertFakeClient: out of memory\n");
+ 	    oc->size = 0;
+ 	    oc->buffer = 0;
+ 	    return FALSE;
+ 	}
+     } else {
+ 	oc->buffer = (char *)xalloc(count);
+ 	if (oc->buffer == NULL) {
+ 	    ErrorF("InsertFakeRequest: out of memory\n");
+ 	    oc->size = 0;
+ 	    oc->buffer = 0;
+ 	    return FALSE;
+ 	}
+     }
+     bcopy(data, oc->buffer + oc->size, count);
+     oc->size += count;
+     return TRUE;
+ }
+ 
+ ResetCurrentRequest(client)
+     ClientPtr client;
+ {
+     register OsCommPtr	oc = (OsCommPtr)client->osPrivate;
+     register xReq	*request;
+ 
+     oc->status |= REQ_PUSHBACK;
+     WakeUpMainThread();
+     if (oc->size) {
+ 	ErrorF("ResetCurrentRequest: partial request\n");
+ 	return;
+     }
+     if (oc->buffer == NULL) {
+ 	ErrorF("ResetCurrentRequest: no request\n");
+ 	return;
+     }
+     request = (xReq *)oc->buffer;
+     oc->size = request_length(request, client);
+ }
+ 
+ int
+ FlushClient(who, oc, extraBuf, extraCount)
+     ClientPtr who;
+     OsCommPtr oc;
+     char *extraBuf;
+     int extraCount;
+ {
+     return 0;
+ }
+ 
+ void
+ FlushAllOutput()
+ {
+ }
+ 
+ int
+ WriteToClient (who, count, buf)
+     ClientPtr who;
+     char *buf;
+     int count;
+ {
+     register OsCommPtr oc = (OsCommPtr)who->osPrivate;
+     int padBytes;
+ 
+     if (count == 0) return 0;
+     if (count < 0) {
+ 	ErrorF("WriteToClient: count %d < 0?\n", count);
+ 	return 0; /* silly request */
+     }
+ 
+     padBytes = padlength[count & 3];
+     if ((count = am_write(oc, buf, count)) < 0)
+ 	oc->status |= CONN_KILLED;
+     if (count > 0 && count & 3) {
+ 	if (am_write(oc, "\0\0\0\0", padlength[count & 3]) < 0)
+ 	    oc->status |= CONN_KILLED;
+     }
+     return count;
+ }
+ 
+ int
+ am_avail(oc, which)
+     OsCommPtr oc;
+     int which;
+ {
+     if (oc->family == FamilyAmoeba)
+ 	return vc_avail(oc->conn.vc, which);
+     if (oc->family == FamilyInternet)
+ 	return cb_full(oc->conn.tcp.cb);
+     return -1;
+ }
+ 
+ int
+ am_read(oc, buffer, size)
+     OsCommPtr oc;
+     char *buffer;
+     int size;
+ {
+     if (oc->family == FamilyAmoeba)
+ 	return vc_readall(oc->conn.vc, buffer, size);
+     if (oc->family == FamilyInternet)
+ 	return cb_gets(oc->conn.tcp.cb, buffer, size, size);
+     return -1;
+ }
+ 
+ int
+ am_write(oc, buffer, size)
+     OsCommPtr oc;
+     char *buffer;
+     int size;
+ {
+     if (oc->family == FamilyAmoeba)
+ 	return vc_write(oc->conn.vc, buffer, size);
+     if (oc->family == FamilyInternet) {
+ 	bufsize bsize;
+ 	int count, wrcnt;
+ 
+ 	for (count = 0; size > 0; ) {
+ 	    wrcnt = size > TCPIP_BUFSIZE ? TCPIP_BUFSIZE : size;
+ 	    bsize = tcpip_write(&oc->conn.tcp.cap, buffer, wrcnt);
+ 	    if (ERR_STATUS(bsize)) {
+ 		ErrorF("TCP/IP write failed: %s\n",
+ 		    tcpip_why(ERR_CONVERT(bsize)));
+ 		return -1;
+ 	    }
+ 	    if (bsize != wrcnt) {
+ 		ErrorF("TCP/IP write failed (expected %d, wrote %d)\n",
+ 		    (int)bsize, wrcnt);
+ 		return -1;
+ 	    }
+ 	    buffer += bsize;
+ 	    size -= bsize;
+ 	    count += bsize;
+ 	}
+ 
+ 	return size;
+     }
+     return -1;
+ }
+ 
+ void
+ am_close(oc, which)
+     OsCommPtr oc;
+     int which;
+ {
+     if (amDebug) ErrorF("am_close() %s, %d\n",
+ 	oc->family == FamilyAmoeba ? "Amoeba" : "TCP/IP", oc->number);
+ 
+     if (oc->family == FamilyAmoeba)
+ 	vc_close(oc->conn.vc, which);
+     if (oc->family == FamilyInternet) {
+ 	if (oc->conn.tcp.signal != -1)
+ 	    sig_raise(oc->conn.tcp.signal);
+ 	std_destroy(&oc->conn.tcp.cap);
+ 	cb_close(oc->conn.tcp.cb);
+ 	cb_free(oc->conn.tcp.cb);
+ 	oc->conn.tcp.cb = NULL;
+     }
+ }
+ #endif /* AMOEBA */
+ 
+ #ifdef _MINIX
+ extern asio_fd_set_t InprogressFdSet;
+ extern asio_fd_set_t ListenFdSet;
+ extern asio_fd_set_t ClientFdSet;
+ extern asio_fd_set_t CompletedFdSet;
+ extern asio_fd_set_t IgnoreFdSet;
+ extern asio_fd_set_t GrabFdSet;
+ 
+ extern Bool AnyClientsWithInput;
+ extern int lastfdesc;                 /* maximum file descriptor */
+ extern int GrabInProgress;
+ 
+ int
+ ReadRequestFromClient(client)
+     ClientPtr client;
+ {
+     OsCommPtr oc = (OsCommPtr)client->osPrivate;
+     register ConnectionInputPtr oci, oci_r;
+     int fd = oc->fd;
+     register int gotnow, gotnow_r, needed;
+     int result;
+     register xReq *request;
+ 
+     if (GrabInProgress && !ASIO_FD_ISSET(fd, ASIO_READ, &GrabFdSet))
+     {
+ 	YieldControl();
+ 	return 0;
+     }
+     if (ASIO_FD_ISSET(fd, ASIO_READ, &IgnoreFdSet))
+     {
+ 	YieldControl();
+ 	return 0;
+     }
+ 
+     ASIO_FD_CLR(fd, ASIO_READ, &CompletedFdSet);
+     oci= oc->inputFake;
+     if (oci)
+     {
+     	oci->bufptr += oci->lenLastReq;
+ 	oci->lenLastReq= 0;
+     }
+     oci= oc->input;
+     if (oci)
+     {
+     	oci->bufptr += oci->lenLastReq;
+ 	oci->lenLastReq= 0;
+     }
+     for(;;)
+     {
+ 	/* Let's check Fake requests first */
+ 
+ 	oci= oc->inputFake;
+ 	if (oci)
+ 	{
+ 	    gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
+ 	    if (gotnow == 0)
+ 	    {
+ 		/* End of fake request */
+ 		xfree(oci->buffer);
+ 		xfree(oci);
+ 		oc->inputFake= NULL;
+ 
+ 		continue;
+ 	    }
+ 
+ 	    /* Let's move the data down, if necessary */
+ 	    if (oci->bufptr != oci->buffer)
+ 	    {
+ 		bcopy(oci->bufptr, oci->buffer, gotnow);
+ 		oci->bufptr= oci->buffer;
+ 	    }
+ 
+ 	    if (gotnow < sizeof(xReq))
+ 		FatalError("Fake request is too small\n"); 
+ 	    request = (xReq *)oci->bufptr;
+ 	    needed= request_length(request, client);
+ 	    if (needed < sizeof(xReq))
+ 	       needed= sizeof(xReq);
+ 	    else if (needed > MAXBUFSIZE)
+ 	    	FatalError("Fake request is too large\n");
+ 	    if (needed > oci->size)
+ 	    {
+ 		char *ibuf;
+ 
+ 		ibuf = (char *)xrealloc(oci->buffer, needed);
+ 		if (!ibuf)
+ 		{
+ 		    YieldControlDeath();
+ 		    ErrorF("ReadRequestFromClient: cannot reallocate buffer\n");
+ 		    return -1;
+ 		}
+ 		oci->size = needed;
+ 		oci->buffer = ibuf;
+ 		oci->bufptr = ibuf;
+ 	    }
+ 	    if (gotnow >= needed)
+ 	    {
+ 		if (++timesThisConnection >= MAX_TIMES_PER)
+ 		    YieldControl();
+ 		ASIO_FD_SET(fd, ASIO_READ, &CompletedFdSet);
+ 		AnyClientsWithInput= TRUE;
+ 
+ 		client->requestBuffer = (pointer)oci->bufptr;
+ 	    	oci->lenLastReq= needed;
+ 		ErrorF("ReadRequestFromClient: gotnow = %d; needed = %d\n",
+ 			gotnow, needed);
+ 		return needed;
+ 	    }
+ 
+ 	    /* Do we have something in the input buffer, we can use? */
+ 	    oci_r= oc->input;
+ 	    if (oci_r == NULL)
+ 	    {
+ 	    	/* No input buffer, we can make the fake buffer the input 
+ 	    	 * buffer */
+ 	    	if (ASIO_FD_ISSET(fd, ASIO_READ, &InprogressFdSet))
+ 		    FatalError("no input buffer but in progress\n");
+ 		oc->input= oci;
+ 		oc->inputFake= NULL;
+ 		continue;
+ 	    }
+ 	    gotnow_r = oci_r->bufcnt + oci_r->buffer - oci_r->bufptr;
+ 	    if (gotnow_r == 0)
+ 	    {
+ 		/* No input buffer, do we have a read in progress? */
+ 		if (ASIO_FD_ISSET(fd, ASIO_READ, &InprogressFdSet))
+ 		{
+ 		    YieldControlNoInput();
+ 		    ErrorF("ReadRequestFromClient: no read in progress\n");
+ 		    return 0;
+ 		}
+ 
+ 		xfree(oci_r->buffer);
+ 		xfree(oci_r);
+ 		oc->input= oci;
+ 		oc->inputFake= NULL;
+ 		continue;
+ 	    }
+ 	    if (gotnow_r > needed-gotnow)
+ 	    	gotnow_r= needed-gotnow;
+ 	    bcopy(oci_r->bufptr, oci->buffer+gotnow, gotnow_r);
+ 	    oci_r->bufptr += gotnow_r;
+ 	    continue;
+ 	}
+ 
+ 	/* No fake input */
+ 	oci= oc->input;
+ 	if (!oci)
+ 	{
+ 	    if (oci = FreeInputs)
+ 	    {
+ 		FreeInputs = oci->next;
+ 	    }
+ 	    else if (!(oci = AllocateInputBuffer()))
+ 	    {
+ 		YieldControlDeath();
+ 		ErrorF("ReadRequestFromClient: cannot allocate buffer\n");
+ 		return -1;
+ 	    }
+ 	    oc->input = oci;
+ 	}
+ 
+ 	request = (xReq *)oci->bufptr;
+ 	gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
+ 	if ((gotnow < sizeof(xReq)) ||
+ 	    (gotnow < (needed = request_length(request, client))))
+ 	{
+ 	    if ((gotnow < sizeof(xReq)) || (needed < sizeof(xReq)))
+ 	       needed = sizeof(xReq);
+ 	    else if (needed > MAXBUFSIZE)
+ 	    {
+ 		YieldControlDeath();
+ 		ErrorF("ReadRequestFromClient: request too big(%d)\n", needed);
+ 		return -1;
+ 	    }
+ 
+ 	    /* Let's check for a read in progress */
+ 	    if (ASIO_FD_ISSET(fd, ASIO_READ, &InprogressFdSet))
+ 	    {
+ 		YieldControlNoInput();
+ 		return 0;
+ 	    }
+ 	    if ((gotnow == 0) ||
+ 		((oci->bufptr - oci->buffer + needed) > oci->size))
+ 	    {
+ 		if ((gotnow > 0) && (oci->bufptr != oci->buffer))
+ 		    bcopy(oci->bufptr, oci->buffer, gotnow);
+ 		if (needed > oci->size)
+ 		{
+ 		    char *ibuf;
+ 
+ 		    ibuf = (char *)xrealloc(oci->buffer, needed);
+ 		    if (!ibuf)
+ 		    {
+ 			YieldControlDeath();
+ 			return -1;
+ 		    }
+ 		    oci->size = needed;
+ 		    oci->buffer = ibuf;
+ 		}
+ 		oci->bufptr = oci->buffer;
+ 		oci->bufcnt = gotnow;
+ 	    }
+ 	    result = read(fd, oci->buffer + oci->bufcnt, 
+ 			  oci->size - oci->bufcnt); 
+ 	    if (result <= 0)
+ 	    {
+ 		if ((result < 0) && errno == EINPROGRESS)
+ 		{
+ 		    ASIO_FD_SET(fd, ASIO_READ, &InprogressFdSet);
+ 		    ASIO_FD_SET(fd, ASIO_READ, &ClientFdSet);
+ 		    YieldControlNoInput();
+ 		    return 0;
+ 		}
+ 		YieldControlDeath();
+ 		ErrorF("ReadRequestFromClient: read failed\n");
+ 		ErrorF("result = %d; errno = %d; size-bufcnt = %d\n",
+ 			result, errno, oci->size - oci->bufcnt);
+ 		return -1;
+ 	    }
+ 	    oci->bufcnt += result;
+ 	    gotnow += result;
+ 
+ 	    /* free up some space after huge requests */
+ 	    if ((oci->size > BUFWATERMARK) &&
+ 		(oci->bufcnt < BUFSIZE) && (needed < BUFSIZE))
+ 	    {
+ 		char *ibuf;
+ 
+ 		ibuf = (char *)xrealloc(oci->buffer, BUFSIZE);
+ 		if (ibuf)
+ 		{
+ 		    oci->size = BUFSIZE;
+ 		    oci->buffer = ibuf;
+ 		    oci->bufptr = ibuf + oci->bufcnt - gotnow;
+ 		}
+ 	    }
+ 	    continue;
+ 	}
+ 	else
+ 		break;
+     }
+ 
+     if (needed < sizeof(xReq))
+ 	needed = sizeof(xReq);
+ 
+     if (++timesThisConnection >= MAX_TIMES_PER)
+ 	YieldControl();
+ 
+     client->requestBuffer = (pointer)oci->bufptr;
+     oci->lenLastReq= needed;
+     ASIO_FD_SET(fd, ASIO_READ, &CompletedFdSet);
+     ASIO_FD_SET(fd, ASIO_READ, &ClientFdSet);
+     AnyClientsWithInput= TRUE;
+     return needed;
+ }
+ 
+ Bool
+ InsertFakeRequest(client, data, count)
+     ClientPtr client;
+     char *data;
+     int count;
+ {
+     OsCommPtr oc = (OsCommPtr)client->osPrivate;
+     register ConnectionInputPtr oci;
+     int fd = oc->fd;
+     register int gotnow, moveup;
+ 
+     oci= oc->input;
+     if (oci)
+     {
+ 	oci->bufptr += oci->lenLastReq;
+ 	oci->lenLastReq = 0;
+     }
+     oci= oc->inputFake;
+     if (!oci)
+     {
+ 	if (oci = FreeInputs)
+ 	    FreeInputs = oci->next;
+ 	else if (!(oci = AllocateInputBuffer()))
+ 	    return FALSE;
+ 	oc->inputFake = oci;
+     }
+     oci->bufptr += oci->lenLastReq;
+     oci->lenLastReq = 0;
+     gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
+     if ((gotnow + count) > oci->size)
+     {
+ 	char *ibuf;
+ 
+ 	ibuf = (char *)xrealloc(oci->buffer, gotnow + count);
+ 	if (!ibuf)
+ 	    return(FALSE);
+ 	oci->size = gotnow + count;
+ 	oci->buffer = ibuf;
+ 	oci->bufptr = ibuf + oci->bufcnt - gotnow;
+     }
+     moveup = count - (oci->bufptr - oci->buffer);
+     if (moveup > 0)
+     {
+ 	if (gotnow > 0)
+ 	    bcopy(oci->bufptr, oci->bufptr + moveup, gotnow);
+ 	oci->bufptr += moveup;
+ 	oci->bufcnt += moveup;
+     }
+     bcopy(data, oci->bufptr - count, count);
+     oci->bufptr -= count;
+     ASIO_FD_SET(fd, ASIO_READ, &CompletedFdSet);
+     AnyClientsWithInput= TRUE;
+     return(TRUE);
+ }
+ 
+ ResetCurrentRequest(client)
+     ClientPtr client;
+ {
+     OsCommPtr oc = (OsCommPtr)client->osPrivate;
+     register ConnectionInputPtr oci;
+     int fd = oc->fd;
+ 
+     oci= oc->inputFake;
+     if (oci)
+ 	oci->lenLastReq = 0;
+     oci= oc->input;
+     if (oci)
+ 	oci->lenLastReq = 0;
+     ASIO_FD_SET(fd, ASIO_READ, &CompletedFdSet);
+     AnyClientsWithInput= TRUE;
+     YieldControl();
+ }
+ 
+ int
+ FlushClient(who, oc, extraBuf, extraCount)
+     ClientPtr who;
+     OsCommPtr oc;
+     char *extraBuf;
+     int extraCount; /* do not modify... returned below */
+ {
+     register ConnectionOutputPtr oco;
+     int fd = oc->fd;
+     long padsize;
+     char padBuffer[3];
+     int newsize, r;
+ 
+     ASIO_FD_CLR(fd, ASIO_WRITE, &CompletedFdSet);
+     padsize = padlength[extraCount & 3];
+ 
+     /* Insert new data in outputNext */
+     if (extraCount + padsize != 0)
+     {
+ 	oco= oc->outputNext;
+ 	if (!oco)
+ 	{
+ 	    if (oco = FreeOutputs)
+ 	    {
+ 		FreeOutputs = oco->next;
+ 	    }
+ 	    else if (!(oco = AllocateOutputBuffer()))
+ 	    {
+ 		close(oc->fd);
+ 		CheckListeners();
+ 		MarkClientException(who);
+ 		return -1;
+ 	    }
+ 	    oc->outputNext = oco;
+ 	}
+ 	newsize= oco->count + extraCount + padsize;
+ 	if (newsize > oco->size)
+ 	{
+ 	    unsigned char *obuf;
+ 
+ 	    obuf= (unsigned char *)xrealloc(oco->buf, newsize + BUFSIZE);
+ 	    if (obuf == NULL)
+ 	    {
+ 		close(oc->fd);
+ 		CheckListeners();
+ 		MarkClientException(who);
+ 		oco->count = 0;
+ 		return -1;
+ 	    }
+ 	    oco->buf= obuf;
+ 	    oco->size= newsize + BUFSIZE;
+ 	}
+ 	bcopy(extraBuf, oco->buf + oco->count, extraCount);
+ 	oco->count += extraCount;
+ 	bcopy(padBuffer, oco->buf + oco->count, padsize);
+ 	oco->count += padsize;
+     }
+ 
+     for (;;)
+     {
+ 	/* If we have a write in progress we can quit imediately */
+ 	if (ASIO_FD_ISSET(fd, ASIO_WRITE, &InprogressFdSet))
+ 		return extraCount;
+ 
+ 	oco= oc->output;
+ 	if (oco == NULL)
+ 	{
+ 		/* If we have no output buffer, but do have an outputNext,
+ 		 * move outputNext to output and retry */
+ 
+ 		if (oc->outputNext)
+ 		{
+ 			oc->output= oc->outputNext;
+ 			oc->outputNext= NULL;
+ 			continue;
+ 		}
+ 
+ 		/* We are done */
+ 		return extraCount;
+ 	}
+ 
+ 	/* If the write buffer exists but is empty we can remove that buffer */
+ 	if (oco->count == 0)
+ 	{
+ 	    if (oco->size > BUFWATERMARK)
+ 	    {
+ 		xfree(oco->buf);
+ 		xfree(oco);
+ 	    }
+ 	    else
+ 	    {
+ 		oco->next = FreeOutputs;
+ 		FreeOutputs = oco;
+ 	    }
+ 	    oc->output = (ConnectionOutputPtr)NULL;
+ 	    continue;
+ 	}
+ 
+ 	/* We have some work to do */
+ 	r= write(fd, (char *)oco->buf, oco->count);
+ 	if (r > 0)
+ 	{
+ 		if (r == oco->count)
+ 		{
+ 			/* The normal case we assume */
+ 			oco->count= 0;
+ 			continue;
+ 		}
+ 		oco->count -= r;
+ 		bcopy(oco->buf+r, oco->buf, oco->count);
+ 		continue;
+ 	}
+ 	if (r == -1 && errno == EINPROGRESS)
+ 	{
+ 		ASIO_FD_SET(fd, ASIO_WRITE, &InprogressFdSet);
+ 		ASIO_FD_SET(fd, ASIO_WRITE, &ClientFdSet);
+ 		continue;
+ 	}
+ 
+ 	/* Now we got an error */
+ 	close(fd);
+ 	CheckListeners();
+ 	MarkClientException(who);
+ 	oco->count = 0;
+ 	return(-1);
+     }
+ }
+ 
+ void
+ FlushAllOutput()
+ {
+     int i, index;
+     register ClientPtr client;
+     OsCommPtr oc;
+ 
+     if (! NewOutputPending)
+ 	return;
+ 
+     /*
+      * It may be that some client still has critical output pending,
+      * but he is not yet ready to receive it anyway, so we will
+      * simply wait for the select to tell us when he's ready to receive.
+      */
+     CriticalOutputPending = FALSE;
+     NewOutputPending = FALSE;
+ 
+     for (i = 0; i <= lastfdesc; i++)
+     {
+     	if (ASIO_FD_ISSET(i, ASIO_WRITE, &CompletedFdSet) &&
+     		ASIO_FD_ISSET(i, ASIO_WRITE, &ClientFdSet))
+ 	{
+ 	    ASIO_FD_CLR(i, ASIO_WRITE, &CompletedFdSet);
+ 	    if ((index = ConnectionTranslation[i]) == 0)
+ 		continue;
+ 	    client = clients[index];
+ 	    if (client->clientGone)
+ 		continue;
+ 	    oc = (OsCommPtr)client->osPrivate;
+ 	    if (ASIO_FD_ISSET(i, ASIO_READ, &CompletedFdSet))
+ 	    {
+ 		ASIO_FD_SET(i, ASIO_WRITE, &CompletedFdSet);
+ 		NewOutputPending = TRUE;
+ 	    }
+ 	    else
+ 		(void)FlushClient(client, oc, (char *)NULL, 0);
+ 	}
+     }
+ }
+ 
+ WriteToClient (who, count, buf)
+     ClientPtr who;
+     int count;
+     char *buf;
+ {
+     OsCommPtr oc = (OsCommPtr)who->osPrivate;
+     register ConnectionOutputPtr oco;
+     int padBytes;
+ 
+     if (!count)
+ 	return(0);
+ 
+     oco= oc->output;
+     if (!oco)
+     {
+ 	if (oco = FreeOutputs)
+ 	{
+ 	    FreeOutputs = oco->next;
+ 	}
+ 	else if (!(oco = AllocateOutputBuffer()))
+ 	{
+ 	    close(oc->fd);
+ 	    CheckListeners();
+ 	    MarkClientException(who);
+ 	    return -1;
+ 	}
+ 	oc->output = oco;
+     }
+     if (oc->outputNext)
+     	oco= oc->outputNext;
+ 
+     padBytes =  padlength[count & 3];
+ 
+     if (oco->count + count + padBytes > oco->size)
+     {
+ 	CriticalOutputPending = FALSE;
+ 	NewOutputPending = FALSE;
+ 	return FlushClient(who, oc, buf, count);
+     }
+ 
+     NewOutputPending = TRUE;
+     ASIO_FD_SET(oc->fd, ASIO_WRITE, &CompletedFdSet);
+     ASIO_FD_SET(oc->fd, ASIO_WRITE, &ClientFdSet);
+     bcopy(buf, (char *)oco->buf + oco->count, count);
+     oco->count += count + padBytes;
+     
+     return(count);
+ }
+ 
+ void
+ UpdateClientIOStatus(fd, operation, result, error)
+ int fd;
+ int operation;
+ int result;
+ int error;
+ {
+ 	int client_no;
+ 	ClientPtr client;
+ 	OsCommPtr oc;
+ 	ConnectionInputPtr oci;
+ 	ConnectionOutputPtr oco;
+ 
+ 	ASIO_FD_CLR(fd, operation, &InprogressFdSet);
+ 	client_no= ConnectionTranslation[fd];
+ 	client= clients[client_no];
+ 	oc= (OsCommPtr)client->osPrivate;
+ 
+ 	switch (operation) {
+ 	case ASIO_READ:
+ 		AnyClientsWithInput= TRUE;
+ 		ASIO_FD_SET(fd, ASIO_READ, &CompletedFdSet);
+ 		if (result == -1)
+ 		{
+ 		    /* Assume the error will happen again on the next read */
+ 		    ErrorF("(warning) read error: %s\n", strerror(error));
+ 		    return;
+ 		}
+ 		oci= oc->input;
+ 		oci->bufcnt += result;
+ 		break;
+ 	case ASIO_WRITE:
+ 		if (result == -1)
+ 		{
+ 		    /* Assume the error will happen again on the next write */
+ 		    ErrorF("(warning) write error: %s\n", strerror(error));
+ 		    return;
+ 		}
+ 		oco= oc->output;
+ 		oco->count -= result;
+ 		if (oco->count != 0)
+ 		    bcopy(oco->buf+result, oco->buf, oco->count);
+ 		FlushClient(client, oc, NULL, 0);
+ 		break;
+ 	default:
+ 		FatalError("UpdateClientIOStatus: oper %d not implemented\n",
+ 			   operation);
+ 	}
+ }
+ #endif /* _MINIX */
diff -c /dev/null mit/server/os/iopreader.c:1.1
*** /dev/null	Sat Mar 12 00:35:22 1994
--- mit/server/os/iopreader.c	Sat Mar 12 00:35:22 1994
***************
*** 0 ****
--- 1,161 ----
+ #ifdef AMOEBA
+ /*
+  * iopreader.c
+  *
+  * $XFree86: mit/server/os/iopreader.c,v 1.1 1993/03/20 04:31:22 dawes Exp $
+  *
+  */
+ #include <amoeba.h>
+ #include <ampolicy.h>
+ #include <cmdreg.h>
+ #include <stdcom.h>
+ #include <stderr.h>
+ #include <server/iop/iop.h>
+ 
+ #include "osdep.h"
+ 
+ #define	MAXEVENTQUEUE	32
+ 
+ capability iopcap;
+ 
+ static mutex lock;
+ static semaphore empty, filled;
+ 
+ static IOPEvent event_queue[MAXEVENTQUEUE];
+ static int event_qin, event_qout;
+ 
+ void IOPCleanUp();
+ static void IOPServerReader();
+ 
+ /*
+  * Initialize the IOP server
+  */
+ void
+ InitializeIOPServerReader()
+ {
+     char		host[100];
+     errstat		err;
+ 
+     /*
+      * Initialize event queue
+      */
+     event_qin = event_qout = 0;
+     sema_init(&empty, MAXEVENTQUEUE);
+     sema_init(&filled, 0);
+     mu_init(&lock);
+ 
+     /* 
+      * Get IOP capability, and enable the server
+      */
+     if (XServerHostName == NULL)
+ 	FatalError("No hostname, no screen\n");
+     sprintf(host, "%s/%s/%s", HOST_DIR, XServerHostName, DEF_IOPSVRNAME);
+     if ((err = name_lookup(host, &iopcap)) != STD_OK)
+ 	FatalError("Cannot find IOP server %s: %s\n", host, err_why(err));
+ 
+     /*
+      * Enable IOP server
+      */
+     if ((err = iop_enable(&iopcap)) != STD_OK)
+ 	FatalError("iop_enable failed (%s)\n", err_why(err));
+ 
+     /*
+      * Start IOP reader thread
+      */
+     atexit(IOPCleanUp);
+     if (thread_newthread(IOPServerReader, DEVREADER_STACK, 0, 0) <= 0)
+ 	FatalError("Cannot start IOP reader thread\n");
+ }
+ 
+ /*
+  * IOP clean up, actuall disable the IOP server. Its the IOP's own choice
+  * what do do (perhaps restore the screen?).
+  */
+ void
+ IOPCleanUp()
+ {
+     errstat err;
+ 
+     if ((err = iop_disable(&iopcap)) != STD_OK)
+ 	ErrorF("iop_disable failed (%s)\n", err_why(err));
+ }
+ 
+ /*
+  * This threads polls the IOP server for events. Once an event (or a
+  * number of events) are read, they are queued up using a traditional
+  * producer/consumer approach.
+  */
+ static void
+ IOPServerReader()
+ {
+     IOPEvent		queue[MAXEVENTQUEUE-1];
+     int			nevents, i;
+     errstat		err;
+ 
+     WaitForInitialization();
+ 
+ #ifdef XDEBUG
+     if (amDebug) ErrorF("IOPServerReader() running ...\n");
+ #endif
+ 
+     for (;;) {
+ 	do {
+ 	    nevents = MAXEVENTQUEUE - 1;
+ 	    err = iop_getevents(&iopcap, queue, &nevents);
+ 	    if (err != STD_OK) {
+ 	        if (err != RPC_FAILURE) {
+ 		    ErrorF("iop_getevents failed (%s)\n", err_why(err));
+ 		}
+ 		nevents = 0;
+ 	    }
+ 	} while (nevents <= 0);
+ 
+ 	/* store event(s) in the global event queue */
+ 	sema_mdown(&empty, nevents);
+ 	mu_lock(&lock);
+ 	for (i = 0; i < nevents; i++) {
+ 	    event_queue[event_qin] = queue[i];
+ 	    event_qin = (event_qin + 1) % MAXEVENTQUEUE;
+ 	}
+ 	mu_unlock(&lock);
+ 	sema_mup(&filled, nevents);
+ 	WakeUpMainThread();
+     }
+ }
+ 
+ /*
+  * Return the number of IOP events waiting
+  */
+ int
+ AmoebaEventsAvailable()
+ {
+     return sema_level(&filled);
+ }
+ 
+ /*
+  * Get the IOP events from the queue. ``size'' is the maximum the
+  * requestor cares to handle, the actual size read is returned as
+  * result.
+  */
+ int
+ AmoebaGetEvents(queue, size)
+     IOPEvent	*queue;
+     int		size;
+ {
+     int		nevents, i;
+ 
+     if (sema_level(&filled) <= 0) return 0;
+     if ((nevents = sema_level(&filled)) > size)
+ 	nevents = size;
+     sema_mdown(&filled, nevents);
+     mu_lock(&lock);
+     for (i = 0; i < nevents; i++) {
+ 	queue[i] = event_queue[event_qout];
+ 	event_qout = (event_qout + 1) % MAXEVENTQUEUE;
+     }
+     mu_unlock(&lock);
+     sema_mup(&empty, nevents);
+     return nevents;
+ }
+ #endif /* AMOEBA */
+ 
diff -c mit/server/os/oscolor.c:1.1.1.1 mit/server/os/oscolor.c:2.4
*** mit/server/os/oscolor.c:1.1.1.1	Sat Mar 12 00:35:23 1994
--- mit/server/os/oscolor.c	Sat Mar 12 00:35:23 1994
***************
*** 21,36 ****
  SOFTWARE.
  
  ******************************************************************/
  /* $XConsortium: oscolor.c,v 1.20 91/06/30 15:58:30 rws Exp $ */
  #ifdef NDBM
  #include <ndbm.h>
  #else
! #ifdef SVR4
  #include <rpcsvc/dbm.h>
  #else
  #include <dbm.h>
  #endif
  #endif
  #include "rgb.h"
  #include "os.h"
  #include "opaque.h"
--- 21,53 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/os/oscolor.c,v 2.4 1994/02/10 21:27:30 dawes Exp $ */
  /* $XConsortium: oscolor.c,v 1.20 91/06/30 15:58:30 rws Exp $ */
+ 
+ 
+ #ifndef USE_RGB_TXT
+ 
+ #ifdef AMOEBA
+ #include <sdbm.h>
+ #else
  #ifdef NDBM
+ #include <X11/Xos.h>
+ #if (BSD >= 199103)
+ #include <sys/types.h>
+ #endif
+ #ifdef SDBM
+ #include <sdbm.h>
+ #else
  #include <ndbm.h>
+ #endif
  #else
! #if defined(SVR4) || defined(ISC)
  #include <rpcsvc/dbm.h>
  #else
  #include <dbm.h>
  #endif
  #endif
+ #endif /* AMOEBA */
  #include "rgb.h"
  #include "os.h"
  #include "opaque.h"
***************
*** 112,114 ****
--- 129,286 ----
      return(0);
  }
  
+ 
+ #else /* USE_RGB_TXT */
+ 
+ 
+ /*
+  * Sorry, but I can't stand it anymore !!! Why using a libdbm thing, indstead
+  * of reading the plain rgb.txt and create the database online while starting
+  * the server ?? As result we would have fewer disk accesses ...
+  */
+ 
+ #include <stdio.h>
+ #include "os.h"
+ #include "opaque.h"
+ 
+ #define HASHSIZE 511
+ 
+ typedef struct _dbEntry * dbEntryPtr;
+ typedef struct _dbEntry {
+   dbEntryPtr     link;
+   unsigned short red;
+   unsigned short green;
+   unsigned short blue;
+   char           name[1];	/* some compilers complain if [0] */
+ } dbEntry;
+ 
+ 
+ extern void CopyISOLatin1Lowered();
+ 
+ static dbEntryPtr hashTab[HASHSIZE];
+ 
+ 
+ static dbEntryPtr
+ lookup(name, len, create)
+      char *name;
+      int  len;
+      Bool create;
+ {
+   unsigned int h = 0, g;
+   dbEntryPtr   entry, *prev;
+   char         *str = name;
+ 
+   if (!(name = (char*)ALLOCATE_LOCAL(len +1))) return NULL;
+   CopyISOLatin1Lowered(name, str, len);
+   name[len] = '\0';
+ 
+   for(str = name; *str; str++) {
+     h = (h << 4) + *str;
+     if ((g = h) & 0xf0000000) h ^= (g >> 24);
+     h &= g;
+   }
+   h %= HASHSIZE;
+ 
+   if ( entry = hashTab[h] )
+     {
+       for( ; entry; prev = (dbEntryPtr*)entry, entry = entry->link )
+ 	if (! strcmp(name, entry->name) ) break;
+     }
+   else
+     prev = &(hashTab[h]);
+ 
+   if (!entry && create && (entry = (dbEntryPtr)Xalloc(sizeof(dbEntry) +len)))
+     {
+       *prev = entry;
+       entry->link = NULL;
+       strcpy( entry->name, name );
+     }
+ 
+   DEALLOCATE_LOCAL(name);
+ 
+   return entry;
+ }
+ 
+ 
+ Bool
+ OsInitColors()
+ {
+   FILE       *rgb;
+   char       *path;
+   char       line[BUFSIZ];
+   char       name[BUFSIZ];
+   int        red, green, blue, lineno = 0;
+   dbEntryPtr entry;
+ 
+   static Bool was_here = FALSE;
+ 
+   if (!was_here)
+     {
+       path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5);
+       strcpy(path, rgbPath);
+       strcat(path, ".txt");
+ 
+       if (!(rgb = fopen(path, "r")))
+         {
+ 	   ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath );
+ 	   DEALLOCATE_LOCAL(path);
+ 	   return FALSE;
+ 	}
+ 
+       while(fgets(line, sizeof(line), rgb))
+ 	{
+ 	  lineno++;
+ 	  if (sscanf(line,"%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4)
+ 	    {
+ 	      if (red >= 0   && red <= 0xff &&
+ 		  green >= 0 && green <= 0xff &&
+ 		  blue >= 0  && blue <= 0xff)
+ 		{
+ 		  if (entry = lookup(name, strlen(name), TRUE))
+ 		    {
+ 		      entry->red   = (red * 65535)   / 255;
+ 		      entry->green = (green * 65535) / 255;
+ 		      entry->blue  = (blue  * 65535) / 255;
+ 		    }
+ 		}
+ 	      else
+ 		ErrorF("Value for \"%s\" out of range: %s:%d\n",
+ 		       name, path, lineno);
+ 	    }
+ 	  else if (*line && *line != '#')
+ 	    ErrorF("Syntax Error: %s:%d\n", path, lineno);
+ 	}
+       
+       fclose(rgb);
+       DEALLOCATE_LOCAL(path);
+ 
+       was_here = TRUE;
+     }
+ 
+   return TRUE;
+ }
+ 
+ 
+ 
+ Bool
+ OsLookupColor(screen, name, len, pred, pgreen, pblue)
+     int		   screen;
+     char	   *name;
+     unsigned	   len;
+     unsigned short *pred, *pgreen, *pblue;
+ 
+ {
+   dbEntryPtr entry;
+ 
+   if (entry = lookup(name, len, FALSE))
+     {
+       *pred   = entry->red;
+       *pgreen = entry->green;
+       *pblue  = entry->blue;
+       return TRUE;
+     }
+ 
+   return FALSE;
+ }
+ 
+ #endif /* USE_RGB_TXT */
diff -c mit/server/os/osdep.h:1.1.1.1 mit/server/os/osdep.h:1.6
*** mit/server/os/osdep.h:1.1.1.1	Sat Mar 12 00:35:24 1994
--- mit/server/os/osdep.h	Sat Mar 12 00:35:24 1994
***************
*** 21,32 ****
--- 21,53 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/os/osdep.h,v 1.6 1993/05/24 12:47:35 dawes Exp $ */
  /* $XConsortium: osdep.h,v 1.27 91/07/23 19:04:22 rws Exp $ */
  
+ #ifdef AMOEBA
+ #include <stddef.h>
+ #include <amoeba.h>
+ #include <stdio.h>
+ #include <assert.h>
+ #include <semaphore.h>
+ #include <circbuf.h>
+ #include <exception.h>
+ #include <vc.h>
+ #include <fault.h>
+ #include <module/signals.h>
+ #include <server/x11/Xamoeba.h>
+ 
+ #include "X.h"
+ #include "misc.h"
+ #include "dixstruct.h"
+ #endif /* AMOEBA */
+ 
  #define BOTIMEOUT 200 /* in milliseconds */
  #define BUFSIZE 4096
  #define BUFWATERMARK 8192
+ #ifndef MAXBUFSIZE
  #define MAXBUFSIZE (1 << 18)
+ #endif
  
  #ifndef X_NOT_POSIX
  #ifdef _POSIX_SOURCE
***************
*** 46,56 ****
--- 67,103 ----
  #ifdef NOFILE
  #define OPEN_MAX NOFILE
  #else
+ #if defined(_POSIX_OPEN_MAX) && !defined(SCO)
+ #define OPEN_MAX _POSIX_OPEN_MAX
+ #else
  #define OPEN_MAX NOFILES_MAX
  #endif
  #endif
  #endif
  #endif
+ #endif
+ 
+ #ifdef AMOEBA
+ /*
+  * Some fundamental constants
+  */
+ #define CONNECTOR_STACK	4000	/* stack for connector task */
+ #define DEVREADER_STACK	4000	/* stack for device reader */
+ #define CREATOR_STACK	4000	/* stack for connection creator */
+ #define MAXTASKS	100	/* Maximum # clients */
+ 
+ /*
+  * OsComm status bits
+  */
+ #define	CONN_KILLED	01	/* Connection being closed */
+ #define	REQ_PUSHBACK	02	/* Request pushed back */
+ #define	IGNORE		04	/* True if client ignored */
+ #endif /* AMOEBA */
+ 
+ /*
+  * Just to prevent confusion, I ifdef-ed it out
+  */
+ #ifndef AMOEBA
  
  #if OPEN_MAX <= 128
  #define MAXSOCKS (OPEN_MAX - 1)
***************
*** 62,67 ****
--- 109,116 ----
  #define NULL 0
  #endif
  
+ #ifndef _MINIX
+ 
  #define mskcnt ((MAXSOCKS + 31) / 32)	/* size of bit array */
  
  #if (mskcnt==1)
***************
*** 166,171 ****
--- 215,222 ----
   */
  #endif
  
+ #endif /* !_MINIX */
+ 
  typedef struct _connectionInput {
      struct _connectionInput *next;
      char *buffer;               /* contains current client input */
***************
*** 182,191 ****
--- 233,282 ----
      int count;
  } ConnectionOutput, *ConnectionOutputPtr;
  
+ #endif /* AMOEBA */
+ 
+ #ifdef AMOEBA
+ typedef struct _amTcpIpComm {
+     capability cap;		/* connection capability */
+     struct circbuf *cb;		/* input buffer */
+     signum signal;		/* signal to kill reader thread */
+ } AmTcpIpCommRec;
+ #endif
+ 
  typedef struct _osComm {
+ #ifndef AMOEBA
      int fd;
      ConnectionInputPtr input;
      ConnectionOutputPtr output;
+ #ifdef _MINIX
+     ConnectionInputPtr inputFake;
+     ConnectionOutputPtr outputNext;
+ #endif
+ #else
+     int		family;		/* connection family */
+     int		number;		/* connection number */
+     char	status;		/* connection status */
+     int		size;		/* input buffer size */
+     char	*buffer;	/* input buffer */
+     union {
+ 	struct vc *vc;		/* virtual circuit */
+ 	AmTcpIpCommRec tcp;	/* TCP/IP connection info */
+     } conn;
+ #endif
      XID	auth_id;		/* authorization id */
      long conn_time;		/* timestamp if not established, else 0  */
  } OsCommRec, *OsCommPtr;
+ 
+ #ifdef AMOEBA
+ #ifdef XDEBUG
+ extern Bool		amDebug;		/* amoeba debug toggle */
+ #endif /* XDEBUG */
+ extern char		*XServerHostName;	/* X server host name */
+ extern char		*XTcpServerName;	/* TCP/IP server name */
+ extern ClientPtr	grabClient;		/* for grabs */
+ extern ClientPtr	Clients[MAXTASKS];	/* All clients */
+ extern int		maxClient;		/* Highest client# */
+ extern int		nNewConns;		/* # of new clients */
+ 
+ extern semaphore	init_sema;		/* Initialize semaphore */
+ #endif /* AMOEBA */
diff -c mit/server/os/osinit.c:1.1.1.3 mit/server/os/osinit.c:2.2
*** mit/server/os/osinit.c:1.1.1.3	Sat Mar 12 00:35:25 1994
--- mit/server/os/osinit.c	Sat Mar 12 00:35:25 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/os/osinit.c,v 2.2 1994/02/10 21:27:32 dawes Exp $ */
  /* $XConsortium: osinit.c,v 1.40 91/11/29 15:21:07 rws Exp $ */
  #include "X.h"
  #include "os.h"
***************
*** 37,43 ****
  #endif
  #endif
  
! #ifndef SYSV
  #include <sys/resource.h>
  #endif
  
--- 38,44 ----
  #endif
  #endif
  
! #if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX)
  #include <sys/resource.h>
  #endif
  
***************
*** 58,63 ****
--- 59,65 ----
  
  OsInit()
  {
+ #ifndef AMOEBA
      static Bool been_here = FALSE;
      char fname[PATH_MAX];
  
***************
*** 66,73 ****
--- 68,77 ----
  #endif
  
      if (!been_here) {
+ #if !defined(SCO) && !(BSD >= 199103)
  	fclose(stdin);
  	fclose(stdout);
+ #endif
  	/* hack test to decide where to log errors */
  	if (write (2, fname, 0)) 
  	{
***************
*** 84,90 ****
  		dup2 (fileno (err), 2);
  		fclose (err);
  	    }
! #if defined(SYSV) || defined(SVR4)
  	    {
  	    static char buf[BUFSIZ];
  	    setvbuf (stderr, buf, _IOLBF, BUFSIZ);
--- 88,94 ----
  		dup2 (fileno (err), 2);
  		fclose (err);
  	    }
! #if defined(SYSV) || defined(SVR4) || defined(AMOEBA) || defined(_MINIX)
  	    {
  	    static char buf[BUFSIZ];
  	    setvbuf (stderr, buf, _IOLBF, BUFSIZ);
***************
*** 153,158 ****
--- 157,166 ----
  #endif
  	been_here = TRUE;
      }
+ #endif /* AMOEBA */
  
+     /* For XFree86 this is delayed until the Xconfig file has been read */
+ #ifndef XFREE86
      OsInitColors();
+ #endif
  }
diff -c mit/server/os/utils.c:1.1.1.2 mit/server/os/utils.c:2.3
*** mit/server/os/utils.c:1.1.1.2	Sat Mar 12 00:35:26 1994
--- mit/server/os/utils.c	Sat Mar 12 00:35:26 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/os/utils.c,v 2.3 1993/09/22 15:49:47 dawes Exp $ */
  /* $XConsortium: utils.c,v 1.109 92/02/24 19:03:14 keith Exp $ */
  #include "Xos.h"
  #include <stdio.h>
***************
*** 29,38 ****
  #include "input.h"
  #include "opaque.h"
  #include <signal.h>
! #ifndef SYSV
  #include <sys/resource.h>
  #endif
  
  #ifdef SIGNALRETURNSINT
  #define SIGVAL int
  #else
--- 30,45 ----
  #include "input.h"
  #include "opaque.h"
  #include <signal.h>
! #if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX)
  #include <sys/resource.h>
  #endif
  
+ #ifdef AMOEBA
+ #include "osdep.h"
+ #include <amoeba.h>
+ #include <module/mutex.h>
+ #endif
+ 
  #ifdef SIGNALRETURNSINT
  #define SIGVAL int
  #else
***************
*** 47,53 ****
--- 54,62 ----
  extern int defaultBackingStore;
  extern Bool disableBackingStore;
  extern Bool disableSaveUnders;
+ #ifndef AMOEBA
  extern Bool PartialNetwork;
+ #endif
  #ifndef NOLOGOHACK
  extern int logoScreenSaver;
  #endif
***************
*** 68,76 ****
  
  Bool CoreDump;
  
  void ddxUseMsg();
  
! #ifndef SVR4
  extern char *sbrk();
  #endif
  
--- 77,89 ----
  
  Bool CoreDump;
  
+ #ifdef AMOEBA
+ static mutex print_lock;
+ #endif
+ 
  void ddxUseMsg();
  
! #if !defined(SVR4) && !defined(linux) && !defined(AMOEBA) && !defined(_MINIX)
  extern char *sbrk();
  #endif
  
***************
*** 98,103 ****
--- 111,270 ----
  
  char *dev_tty_from_init = NULL;		/* since we need to parse it anyway */
  
+ #ifdef SERVER_LOCK
+ /*
+  * Explicit support for a server lock file like the ones used for UUCP.
+  * For architectures with virtual terminals that can run more than one
+  * server at a time.  This keeps the servers from stomping on each other
+  * if the user forgets to give them different display numbers.
+  */
+ #define LOCK_PATH "/tmp/.X"
+ #define LOCK_TMPPATH "/tmp/.tX"
+ #define LOCK_SUFFIX "-lock"
+ 
+ #ifdef _MINIX
+ #include <limits.h>	/* For PATH_MAX */
+ #endif
+ 
+ #ifndef PATH_MAX
+ #include <sys/param.h>
+ #ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+ #define PATH_MAX MAXPATHLEN
+ #else
+ #define PATH_MAX 1024
+ #endif
+ #endif
+ #endif
+ 
+ #include <errno.h>
+ extern int errno;
+ 
+ static Bool StillLocking = FALSE;
+ 
+ /*
+  * Lock_Server --
+  *      Check if the server lock file exists.  If so, check if the PID
+  *      contained inside is valid.  If so, then die.  Otherwise, create
+  *      the lock file containing the PID.
+  */
+ void
+ Lock_Server()
+ {
+ #ifndef AMOEBA
+   char tmp[PATH_MAX], lock[PATH_MAX], pid_str[12];
+   int lfd, i, haslock, l_pid, t;
+ 
+   /*
+    * Path names
+    */
+   (void) sprintf(tmp, "%s%s%s", LOCK_TMPPATH, display, LOCK_SUFFIX);
+   (void) sprintf(lock, "%s%s%s", LOCK_PATH, display, LOCK_SUFFIX);
+ 
+   /*
+    * Create a temporary file containing our PID.  Attempt three times
+    * to create the file.
+    */
+   StillLocking = TRUE;
+   i = 0;
+   do {
+     i++;
+     lfd = creat(tmp, 0444);
+     if (lfd < 0)
+        sleep(2);
+     else
+        break;
+   } while (i < 3);
+   if (lfd < 0)
+     FatalError("Could not create lock file in %s\n", tmp);
+   (void) sprintf(pid_str, "%10d\n", getpid());
+   (void) write(lfd, pid_str, 11);
+   (void) close(lfd);
+   (void) chmod(tmp, 0444);
+ 
+   /*
+    * OK.  Now the tmp file exists.  Try three times to move it in place
+    * for the lock.
+    */
+   i = 0;
+   haslock = 0;
+   while ((!haslock) && (i++ < 3)) {
+     haslock = (link(tmp,lock) == 0);
+     if (haslock) {
+       /*
+        * We're done.
+        */
+       break;
+     }
+     else {
+       /*
+        * Read the pid from the existing file
+        */
+       lfd = open(lock, O_RDONLY);
+       if (lfd < 0) {
+         unlink(tmp);
+         FatalError("Can't read lock file %s\n", lock);
+       }
+       pid_str[0] = '\0';
+       if (read(lfd, pid_str, 11) != 11) {
+         /*
+          * Bogus lock file.
+          */
+         unlink(lock);
+         close(lfd);
+         continue;
+       }
+       pid_str[11] = '\0';
+       sscanf(pid_str, "%d", &l_pid);
+       close(lfd);
+ 
+       /*
+        * Now try to kill the PID to see if it exists.
+        */
+       errno = 0;
+       t = kill(l_pid, 0);
+       if ((t< 0) && (errno == ESRCH)) {
+         /*
+          * Stale lock file.
+          */
+         unlink(lock);
+         continue;
+       }
+       else if (((t < 0) && (errno == EPERM)) || (t == 0)) {
+         /*
+          * Process is still active.
+          */
+         unlink(tmp);
+ 	FatalError("Server is already active for display %s\n%s %s\n%s\n",
+ 		   display, "\tIf this server is no longer running, remove",
+ 		   lock, "\tand start again.");
+       }
+     }
+   }
+   unlink(tmp);
+   if (!haslock)
+     FatalError("Could not create server lock file: %s\n", lock);
+   StillLocking = FALSE;
+ #endif /* !AMOEBA */
+ }
+ 
+ /*
+  * Unlock_Server --
+  *      Remove the server lock file.
+  */
+ void Unlock_Server()
+ {
+ #ifndef AMOEBA
+   char buf[PATH_MAX];
+ 
+   if (StillLocking)
+     return;
+   (void)sprintf(buf, "%s%s%s", LOCK_PATH, display, LOCK_SUFFIX);
+   (void) unlink(buf);
+ #endif
+ }
+ #endif /* SERVER_LOCK */
+ 
  /* Force connections to close on SIGHUP from init */
  
  SIGVAL
***************
*** 109,117 ****
      chdir ("/tmp");
      exit (0);
  #endif
! #ifdef SYSV
      signal (SIGHUP, AutoResetServer);
  #endif
  }
  
  /* Force connections to close and then exit on SIGTERM, SIGINT */
--- 276,287 ----
      chdir ("/tmp");
      exit (0);
  #endif
! #if defined(SYSV) || defined (SVR4) || defined(linux) || defined(_MINIX)
      signal (SIGHUP, AutoResetServer);
  #endif
+ #ifdef AMOEBA
+     WakeUpMainThread();
+ #endif
  }
  
  /* Force connections to close and then exit on SIGTERM, SIGINT */
***************
*** 119,126 ****
--- 289,310 ----
  SIGVAL
  GiveUp()
  {
+ 
+ #if defined(SYSV) || defined(SVR4) || defined(linux) || defined(_MINIX)
+     /*
+      * Don't let any additional occurrances of these signals cause
+      * premature termination (xdm seems to send two SIGTERMs).
+      * DHD Dec 1991
+      */
+     signal(SIGTERM,SIG_IGN);
+     signal(SIGINT,SIG_IGN);
+ #endif
+ 
      dispatchException |= DE_TERMINATE;
      isItTimeToYield = TRUE;
+ #ifdef AMOEBA
+     WakeUpMainThread();
+ #endif
  }
  
  
***************
*** 132,138 ****
--- 316,327 ----
      AbortDDX();
      fflush(stderr);
      if (CoreDump)
+     {
+ #ifdef AMOEBA
+ 	IOPCleanUp();
+ #endif
  	abort();
+     }
      exit (1);
  }
  
***************
*** 140,146 ****
--- 329,341 ----
  Error(str)
      char *str;
  {
+ #ifdef AMOEBA
+     mu_lock(&print_lock);
+ #endif
      perror(str);
+ #ifdef AMOEBA
+     mu_unlock(&print_lock);
+ #endif
  }
  
  #if defined (UTEK) || defined (UTEKV) || defined(sgi)
***************
*** 150,155 ****
--- 345,351 ----
   * inside the driver.  SGI has their own GetTimeInMillis.
   */
  #else
+ #ifndef AMOEBA
  long
  GetTimeInMillis()
  {
***************
*** 158,163 ****
--- 354,366 ----
      gettimeofday(&tp, 0);
      return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
  }
+ #else
+ long
+ GetTimeInMillis()
+ {
+     return sys_milli();
+ }
+ #endif /* AMOEBA */
  #endif
  
  AdjustWaitForDelay (waitTime, newdelay)
***************
*** 188,194 ****
--- 391,401 ----
  void UseMsg()
  {
  #if !defined(AIXrt) && !defined(AIX386)
+ #ifndef AMOEBA
      ErrorF("use: X [:<display>] [option]\n");
+ #else
+     ErrorF("use: X [[<host>]:<display>] [option]\n");
+ #endif /* AMOEBA */
      ErrorF("-a #                   mouse acceleration (pixels)\n");
      ErrorF("-ac                    disable access control restrictions\n");
  #ifdef MEMBUG
***************
*** 222,227 ****
--- 429,443 ----
      ErrorF("nologo                 disable logo in screen saver\n");
  #endif
      ErrorF("-p #                   screen-saver pattern duration (minutes)\n");
+ #ifndef AMOEBA
+ #ifdef PART_NET
+     ErrorF("-pn                    partial networking enabled [default]\n");
+     ErrorF("-nopn                  partial networking disabled\n");
+ #else
+     ErrorF("-pn                    partial networking enabled\n");
+     ErrorF("-nopn                  partial networking disabled [default]\n");
+ #endif
+ #endif
      ErrorF("-r                     turns off auto-repeat\n");
      ErrorF("r                      turns on auto-repeat \n");
      ErrorF("-s #                   screen-saver timeout (minutes)\n");
***************
*** 236,241 ****
--- 452,460 ----
  #ifdef XDMCP
      XdmcpUseMsg();
  #endif
+ #ifdef AMOEBA
+     ErrorF("-tcp capability        specify TCP/IP server capability\n");
+ #endif
  #endif /* !AIXrt && ! AIX386 */
      ddxUseMsg();
  }
***************
*** 253,258 ****
--- 472,481 ----
  {
      int i, skip;
  
+ #ifdef AMOEBA
+     mu_init(&print_lock);
+ #endif
+ 
  #ifdef MEMBUG
  #ifndef AIXV3
      if (!minfree)
***************
*** 263,268 ****
--- 486,496 ----
  #endif
  #endif
      defaultKeyboardControl.autoRepeat = TRUE;
+ #ifndef AMOEBA
+ #ifdef PART_NET
+     PartialNetwork = TRUE;
+ #endif
+ #endif
  
  #ifdef AIXV3
      OpenDebug();
***************
*** 280,285 ****
--- 508,523 ----
  	    display = argv[i];
  	    display++;
  	}
+ #ifdef AMOEBA
+ 	else if (strchr(argv[i], ':') != NULL) {
+ 	    register char *p;
+ 	    XServerHostName = argv[i];
+ 	    if ((p = strchr(argv[i], ':')) != NULL) {
+ 		*p++ = '\0';
+ 		display = p;
+ 	    }
+ 	}
+ #endif /* AMOEBA */
  	else if ( strcmp( argv[i], "-a") == 0)
  	{
  	    if(++i < argc)
***************
*** 431,438 ****
--- 669,680 ----
  	    else
  		UseMsg();
  	}
+ #ifndef AMOEBA
  	else if ( strcmp( argv[i], "-pn") == 0)
  	    PartialNetwork = TRUE;
+ 	else if ( strcmp( argv[i], "-nopn") == 0)
+ 	    PartialNetwork = FALSE;
+ #endif
  	else if ( strcmp( argv[i], "r") == 0)
  	    defaultKeyboardControl.autoRepeat = TRUE;
  	else if ( strcmp( argv[i], "-r") == 0)
***************
*** 521,526 ****
--- 763,783 ----
              SyncOn++;
          }
  #endif
+ #ifdef AMOEBA
+ #ifdef XDEBUG
+         else if ( strcmp( argv[i], "-amdebug") == 0)
+         {
+ 	    amDebug++;
+ 	}
+ #endif /* XDEBUG */
+         else if ( strcmp( argv[i], "-tcp") == 0)
+ 	{
+ 	    if(++i < argc)
+ 	        XTcpServerName = argv[i];
+ 	    else
+ 		UseMsg();
+ 	}
+ #endif /* AMOEBA */
   	else
   	{
  	    UseMsg();
***************
*** 850,855 ****
--- 1107,1197 ----
      DumpMemoryInUse (MarkedTime);
  }
  #endif
+ #else  /* SPECIAL_MALLOC */
+ #ifdef CAHILL_MALLOC
+ #include <malloc.h>
+ 
+ unsigned long * 
+ debug_Xalloc (file, line, amount)
+     char *file;
+     int line;
+     unsigned long amount;
+ {
+     register pointer  ptr;
+ 	
+     if ((long)amount <= 0)
+ 	return (unsigned long *)NULL;
+     /* aligned extra on long word boundary */
+     amount = (amount + 3) & ~3;
+     if (ptr = (pointer)debug_malloc(file, line, amount))
+ 	return (unsigned long *)ptr;
+     if (Must_have_memory)
+ 	FatalError("Out of memory");
+     return (unsigned long *)NULL;
+ }
+ 
+ /*****************
+  * Xcalloc
+  *****************/
+ 
+ unsigned long *
+ debug_Xcalloc (file, line, amount)
+     char *file;
+     int line;
+     unsigned long   amount;
+ {
+     unsigned long   *ret;
+ 
+     ret = debug_Xalloc (file, line, amount);
+     if (ret)
+ 	bzero ((char *) ret, (int) amount);
+     return ret;
+ }
+ 
+ /*****************
+  * Xrealloc
+  *****************/
+ 
+ unsigned long *
+ debug_Xrealloc (file, line, ptr, amount)
+     char *file;
+     int line;
+     register pointer ptr;
+     unsigned long amount;
+ {
+     if ((long)amount <= 0)
+     {
+ 	if (ptr && !amount)
+ 	    debug_free(file, line, ptr);
+ 	return (unsigned long *)NULL;
+     }
+     amount = (amount + 3) & ~3;
+     if (ptr)
+         ptr = (pointer)debug_realloc(file, line, (char *)ptr, amount);
+     else
+ 	ptr = (pointer)debug_malloc(file, line, amount);
+     if (ptr)
+         return (unsigned long *)ptr;
+     if (Must_have_memory)
+ 	FatalError("Out of memory");
+     return (unsigned long *)NULL;
+ }
+                     
+ /*****************
+  *  Xfree
+  *    calls free 
+  *****************/    
+ 
+ void
+ debug_Xfree(file, line, ptr)
+     char *file;
+     int line;
+     register pointer ptr;
+ {
+     if (ptr)
+ 	debug_free(file, line, (char *)ptr); 
+ }
+ #endif
  #endif /* SPECIAL_MALLOC */
  
  /*VARARGS1*/
***************
*** 878,884 ****
--- 1220,1232 ----
      if (SyncOn)
          sync();
  #else
+ #ifdef AMOEBA
+     mu_lock(&print_lock);
+ #endif
      fprintf( stderr, f, s0, s1, s2, s3, s4, s5, s6, s7, s8, s9);
+ #ifdef AMOEBA
+     mu_unlock(&print_lock);
+ #endif
  #endif
  }
  
diff -c mit/server/os/xdmcp.c:1.1.1.2 mit/server/os/xdmcp.c:2.1
*** mit/server/os/xdmcp.c:1.1.1.2	Sat Mar 12 00:35:27 1994
--- mit/server/os/xdmcp.c	Sat Mar 12 00:35:28 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/server/os/xdmcp.c,v 2.1 1993/09/27 12:29:46 dawes Exp $ */
  /* $XConsortium: xdmcp.c,v 1.22 92/05/19 17:22:10 keith Exp $ */
  /*
   * Copyright 1989 Network Computing Devices, Inc., Mountain View, California.
***************
*** 14,24 ****
--- 15,45 ----
   *
   */
  
+ #ifdef XDMCP
+ 
  #include "Xos.h"
+ #ifndef _MINIX
  #include <sys/param.h>
+ #ifndef AMOEBA
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
+ #else
+ #include <server/ip/gen/netdb.h>
+ #endif
+ #endif /* _MINIX */
+ #if _MINIX
+ #include <assert.h>
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <sys/ioctl.h>
+ #include <net/netlib.h>
+ #include <net/gen/netdb.h>
+ #include <net/gen/socket.h>
+ #include <net/gen/udp.h>
+ #include <net/gen/udp_hdr.h>
+ #include <net/gen/udp_io.h>
+ #endif
  #include <stdio.h>
  #include "X.h"
  #include "Xmd.h"
***************
*** 28,34 ****
  #include "dixstruct.h"
  #include "opaque.h"
  
- #ifdef XDMCP
  #undef REQUEST
  #include "Xdmcp.h"
  
--- 49,54 ----
***************
*** 60,66 ****
--- 80,90 ----
  
  static get_manager_by_name(), get_xdmcp_sock();
  
+ #ifndef _MINIX
  static	receive_packet(), send_packet();
+ #else 
+ static	MNX_receive_packet(), send_packet();
+ #endif
  static	timeout(), restart();
  
  static	recv_willing_msg();
***************
*** 74,80 ****
--- 98,108 ----
  static	send_keepalive_msg();
  
  static XdmcpFatal(), XdmcpWarning();
+ #ifndef _MINIX
  static void XdmcpBlockHandler(), XdmcpWakeupHandler();
+ #else /* _MINIX */
+ static void MNX_XdmcpBlockHandler(), MNX_XdmcpWakeupHandler();
+ #endif /* !_MINIX */
  
  static short	xdm_udp_port = XDM_UDP_PORT;
  static Bool	OneSession = FALSE;
***************
*** 161,166 ****
--- 189,195 ----
  static struct sockaddr_in   BroadcastAddresses[MAX_BROADCAST];
  static int		    NumBroadcastAddresses;
  
+ #ifndef _MINIX
  XdmcpRegisterBroadcastAddress (addr)
      struct sockaddr_in	*addr;
  {
***************
*** 173,178 ****
--- 202,221 ----
      bcast->sin_port = htons (xdm_udp_port);
      bcast->sin_addr = addr->sin_addr;
  }
+ #else /* _MINIX */
+ MNX_XdmcpRegisterBroadcastAddress (addr)
+     ipaddr_t	addr;
+ {
+     struct sockaddr_in	*bcast;
+     if (NumBroadcastAddresses >= MAX_BROADCAST)
+ 	return;
+     bcast = &BroadcastAddresses[NumBroadcastAddresses++];
+     bzero (bcast, sizeof (struct sockaddr_in));
+     bcast->sin_family = AF_INET;
+     bcast->sin_port = htons (xdm_udp_port);
+     bcast->sin_addr = addr;
+ }
+ #endif /* !_MINIX */
  
  /*
   * Each authentication type is registered here; Validator
***************
*** 394,401 ****
  	XdmcpRegisterAuthorizations();
  	XdmcpRegisterDisplayClass (defaultDisplayClass, strlen (defaultDisplayClass));
  	AccessUsingXdmcp();
! 	RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler,
! 				        (pointer) 0);
      	timeOutRtx = 0;
      	DisplayNumber = (CARD16) atoi(display);
      	get_xdmcp_sock();
--- 437,449 ----
  	XdmcpRegisterAuthorizations();
  	XdmcpRegisterDisplayClass (defaultDisplayClass, strlen (defaultDisplayClass));
  	AccessUsingXdmcp();
! #ifndef _MINIX
! 	RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler, 
! 			(pointer) 0);
! #else /* _MINIX */
! 	RegisterBlockAndWakeupHandlers (MNX_XdmcpBlockHandler, 
! 					MNX_XdmcpWakeupHandler, (pointer) 0);
! #endif /* !_MINIX */
      	timeOutRtx = 0;
      	DisplayNumber = (CARD16) atoi(display);
      	get_xdmcp_sock();
***************
*** 409,416 ****
      state = XDM_INIT_STATE;
      if (state != XDM_OFF)
      {
! 	RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler,
! 				        (pointer) 0);
      	timeOutRtx = 0;
      	send_packet();
      }
--- 457,469 ----
      state = XDM_INIT_STATE;
      if (state != XDM_OFF)
      {
! #ifndef _MINIX
! 	RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler, 
! 			(pointer) 0);
! #else /* _MINIX */
! 	RegisterBlockAndWakeupHandlers (MNX_XdmcpBlockHandler, 
! 					MNX_XdmcpWakeupHandler, (pointer) 0);
! #endif /* !_MINIX */
      	timeOutRtx = 0;
      	send_packet();
      }
***************
*** 454,459 ****
--- 507,513 ----
   * dynamically while starting up
   */
  
+ #ifndef _MINIX
  /*ARGSUSED*/
  static void
  XdmcpBlockHandler(data, wt, LastSelectMask)
***************
*** 488,493 ****
--- 542,610 ----
  	}
      }
  }
+ #else /* _MINIX */
+ 
+ static int read_inprogress= FALSE;
+ static int read_completed= FALSE;
+ static int read_result;
+ static char read_buffer[XDM_MAX_MSGLEN+sizeof(udp_io_hdr_t)];
+ static size_t read_buffer_size= sizeof(read_buffer);
+ /*ARGSUSED*/
+ static void
+ MNX_XdmcpBlockHandler(data, wt, fdset)
+     pointer	    data;   /* unused */
+     struct timeval  wt[2];
+     struct asio_fd_set *fdset;
+ {
+     long millisToGo, wtMillis;
+     struct timeval waittime;
+     int r;
+ 
+     if (state == XDM_OFF)
+ 	return;
+     if (!read_inprogress)
+     {
+     	r= read(xdmcpSocket, read_buffer, read_buffer_size);
+     	if (r == -1 && errno == EINPROGRESS)
+     	{
+     		read_inprogress= TRUE;
+     		read_completed= FALSE;
+     		ASIO_FD_SET(xdmcpSocket, ASIO_READ,  fdset);
+     	}
+     	else if (r > 0)
+     	{
+     		read_completed= TRUE;
+     		read_result= r;
+     		wt[0]= wt[1];	/* Don't wait */
+     		return;
+     	}
+     	else
+     	{
+     		ErrorF("(warning got read error (%d, %s)\n", r, 
+ 		    strerror(errno));
+     		read_completed= FALSE;
+     	}
+     }
+     else
+     	ASIO_FD_SET(xdmcpSocket, ASIO_READ,  fdset);
+     millisToGo = timeOutTime - GetTimeInMillis() + 1;
+     if (millisToGo < 0)
+ 	millisToGo = 0;
+     waittime= wt[1];
+     waittime.tv_sec += millisToGo / 1000;
+     waittime.tv_usec += (millisToGo % 1000) * 1000;
+     if (waittime.tv_usec >= 1000000)
+     {
+     	waittime.tv_usec -= 1000000;
+     	waittime.tv_sec++;
+     }
+     if (waittime.tv_sec < wt[0].tv_sec || 
+     	(waittime.tv_sec == wt[0].tv_sec && waittime.tv_usec < wt[0].tv_usec))
+     {
+     	wt[0]= waittime;
+     }
+ }
+ #endif /* !_MINIX */
  
  /*
   * called after select returns; this routine will
***************
*** 495,500 ****
--- 612,618 ----
   * process them appropriately
   */
  
+ #ifndef _MINIX
  /*ARGSUSED*/
  static void
  XdmcpWakeupHandler(data, i, LastSelectMask)
***************
*** 535,540 ****
--- 653,715 ----
  	    timeout();
      }
  }
+ #else /* _MINIX */
+ static void
+ MNX_XdmcpWakeupHandler(data, i, fw)
+     pointer data;   /* unused */
+     int	    i;
+     struct fwait    *fw;
+ {
+     if (state == XDM_OFF)
+ 	return;
+     if (fw && fw->fw_fd == xdmcpSocket)
+     {
+     	assert(fw->fw_operation == ASIO_READ);
+     	fw->fw_fd= -1;
+     	assert(read_inprogress);
+     	read_inprogress= FALSE;
+     	assert(!read_completed);
+     	if (fw->fw_result <= 0)
+     	{
+     		ErrorF("(warning got read error (%d, %s)\n", fw->fw_fd, 
+ 		    strerror(fw->fw_errno));
+     	}
+     	else
+     	{
+     		read_result= fw->fw_result;
+     		read_completed= TRUE;
+     	}
+     }
+     if (read_completed)
+     {
+     	read_completed= FALSE;
+     	MNX_receive_packet(read_buffer, read_result);
+     }
+     if (fw != NULL)
+     {
+         extern asio_fd_set_t ClientFdSet;	/* HACK XXX */
+ 	if (state == XDM_AWAIT_USER_INPUT)
+ 	    restart();
+ 	else if (state == XDM_RUN_SESSION)
+ 	    keepaliveDormancy = defaultKeepaliveDormancy;
+ 	if (memchr((char *)&ClientFdSet, '\0', sizeof(ClientFdSet)) != NULL && 
+ 		state == XDM_RUN_SESSION)
+ 	{
+ 	    timeOutTime = GetTimeInMillis() +  keepaliveDormancy * 1000;
+ 	}
+     }
+     else if (timeOutTime && GetTimeInMillis() >= timeOutTime)
+     {
+     	if (state == XDM_RUN_SESSION)
+     	{
+ 	    state = XDM_KEEPALIVE;
+ 	    send_packet();
+     	}
+     	else
+ 	    timeout();
+     }
+ }
+ #endif /* !_MINIX */
  
  /*
   * This routine should be called from the routine that drives the
***************
*** 574,579 ****
--- 749,755 ----
  
  ARRAY8	UnwillingMessage = { (CARD8) 14, (CARD8 *) "Host unwilling" };
  
+ #ifndef _MINIX
  static
  receive_packet()
  {
***************
*** 618,623 ****
--- 794,848 ----
  	break;
      }
  }
+ #else /* _MINIX */
+ static
+ MNX_receive_packet(buf, size)
+ char *buf;
+ int size;
+ {
+     struct sockaddr_in from;
+     int fromlen = sizeof(struct sockaddr_in);
+     XdmcpHeader	header;
+ 
+     /* read message off socket */
+     if (!MNX_XdmcpFill (xdmcpSocket, &buffer, (struct sockaddr *) &from, 
+     	&fromlen, buf, size))
+ 	return;
+ 
+     /* reset retransmission backoff */
+     timeOutRtx = 0;
+ 
+     if (!XdmcpReadHeader (&buffer, &header))
+ 	return;
+ 
+     if (header.version != XDM_PROTOCOL_VERSION)
+ 	return;
+ 
+     switch (header.opcode) {
+     case WILLING:
+ 	recv_willing_msg(&from, fromlen, header.length);
+ 	break;
+     case UNWILLING:
+ 	XdmcpFatal("Manager unwilling", &UnwillingMessage);
+ 	break;
+     case ACCEPT:
+ 	recv_accept_msg(header.length);
+ 	break;
+     case DECLINE:
+ 	recv_decline_msg(header.length);
+ 	break;
+     case REFUSE:
+ 	recv_refuse_msg(header.length);
+ 	break;
+     case FAILED:
+ 	recv_failed_msg(header.length);
+ 	break;
+     case ALIVE:
+ 	recv_alive_msg(header.length);
+ 	break;
+     }
+ }
+ #endif /* !_MINIX */
  
  /*
   * send the appropriate message given the current state
***************
*** 627,632 ****
--- 852,858 ----
  send_packet()
  {
      int rtx;
+ 
      switch (state) {
      case XDM_QUERY:
      case XDM_BROADCAST:
***************
*** 751,759 ****
--- 977,1023 ----
  static
  get_xdmcp_sock()
  {
+ #ifndef _MINIX
      int soopts = 1;
  
      if ((xdmcpSocket = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ #else
+     char *udp_device;
+     int r, s_errno;
+     nwio_udpopt_t udpopt;
+ 
+     udp_device= getenv("UDP_DEVICE");
+     if (udp_device == NULL)
+     	udp_device= UDP_DEVICE;
+     xdmcpSocket= open(udp_device, O_RDWR);
+     if (xdmcpSocket != -1)
+     {
+     	udpopt.nwuo_flags= NWUO_COPY | NWUO_LP_SEL | NWUO_EN_LOC | 
+     		NWUO_DI_BROAD | NWUO_RP_ANY | NWUO_RA_ANY | NWUO_RWDATALL |
+     		NWUO_DI_IPOPT;
+     	r= ioctl(xdmcpSocket, NWIOSUDPOPT, &udpopt);
+     	if (r == -1)
+     	{
+     		s_errno= errno;
+     		close(xdmcpSocket);
+     		xdmcpSocket= -1;
+     		errno= s_errno;
+     	}
+     	ioctl(xdmcpSocket, NWIOGUDPOPT, &udpopt);
+     	ErrorF("0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", 
+     		udpopt.nwuo_flags,
+     		udpopt.nwuo_locport,
+     		udpopt.nwuo_remport,
+     		udpopt.nwuo_locaddr,
+     		udpopt.nwuo_remaddr);
+     }
+     if (xdmcpSocket != -1)
+     {
+ 	fcntl(xdmcpSocket, F_SETFD, fcntl(xdmcpSocket, F_GETFD) | 
+     								FD_ASYNCHIO);
+     }
+     if (xdmcpSocket == -1)
+ #endif
  	XdmcpWarning("UDP socket creation failed");
  #ifdef SO_BROADCAST
      else if (setsockopt(xdmcpSocket, SOL_SOCKET, SO_BROADCAST, &soopts,
***************
*** 1120,1126 ****
--- 1384,1394 ----
  	ErrorF("Xserver: unknown host: %s\n", argv[i]);
  	exit(1);
      }
+ #ifndef _MINIX
      if (hep->h_length == sizeof (struct in_addr))
+ #else
+     if (hep->h_length == sizeof (ipaddr_t))
+ #endif
      {
  	bcopy(hep->h_addr, &ManagerAddress.sin_addr, hep->h_length);
  	ManagerAddress.sin_family = AF_INET;
diff -c mit/server/ddx/cfb/Imakefile:1.1.1.1 mit/server/ddx/cfb/Imakefile:2.2
*** mit/server/ddx/cfb/Imakefile:1.1.1.1	Sat Mar 12 00:35:32 1994
--- mit/server/ddx/cfb/Imakefile	Sat Mar 12 00:35:32 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/server/ddx/cfb/Imakefile,v 2.2 1993/09/22 15:36:38 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.31 91/07/16 22:51:52 gildea Exp $
  #include <Server.tmpl>
  
***************
*** 57,62 ****
--- 58,69 ----
  NormalLibraryTarget(cfb,$(OBJS))
  LintLibraryTarget(cfb,$(SRCS))
  
+ InstallLinkKitLibrary(cfb,$(LINKKITDIR)/lib)
+ InstallLinkKitNonExecFile(cfb.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(cfb8bit.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(cfbmskbits.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(cfbrrop.h,$(LINKKITDIR)/include)
+ 
  NormalLintTarget($(SRCS))
  
  #if HasSaberC
***************
*** 90,96 ****
  
  ObjectFromSpecialSource(cfbseg,cfbline,-DPOLYSEGMENT)
  ObjectFromSpecialSource(cfbglrop8,cfbglblt8,-DGLYPHROP)
! SpecialObjectRule(cfbglblt8.o,$(NOTDEF),$(STIPPLEDEF))
  
  ObjectFromSpecialSource(cfbfillarcC,cfbfillarc,-DRROP=GXcopy)
  ObjectFromSpecialSource(cfbfillarcG,cfbfillarc,-DRROP=GXset)
--- 97,103 ----
  
  ObjectFromSpecialSource(cfbseg,cfbline,-DPOLYSEGMENT)
  ObjectFromSpecialSource(cfbglrop8,cfbglblt8,-DGLYPHROP)
! SpecialObjectRule(cfbglblt8.o,cfbglblt8.c,$(STIPPLEDEF))
  
  ObjectFromSpecialSource(cfbfillarcC,cfbfillarc,-DRROP=GXcopy)
  ObjectFromSpecialSource(cfbfillarcG,cfbfillarc,-DRROP=GXset)
diff -c mit/server/ddx/cfb/cfbgetsp.c:1.1.1.1 mit/server/ddx/cfb/cfbgetsp.c:2.0
*** mit/server/ddx/cfb/cfbgetsp.c:1.1.1.1	Sat Mar 12 00:35:33 1994
--- mit/server/ddx/cfb/cfbgetsp.c	Sat Mar 12 00:35:33 1994
***************
*** 22,27 ****
--- 22,29 ----
  
  ******************************************************************/
  
+ /* $XFree86: mit/server/ddx/cfb/cfbgetsp.c,v 2.0 1993/07/22 12:46:11 dawes Exp $ */
+ 
  #include "X.h"
  #include "Xmd.h"
  #include "servermd.h"
***************
*** 76,82 ****
      }
  
      
!     cfbGetLongWidthAndPointer (pDrawable, widthSrc, psrcBase)
  
  #if PPW == 4
      if ((nspans == 1) && (*pwidth == 1))
--- 78,84 ----
      }
  
      
!     cfbGetByteWidthAndPointer (pDrawable, widthSrc, (unsigned char *)psrcBase)
  
  #if PPW == 4
      if ((nspans == 1) && (*pwidth == 1))
diff -c mit/server/ddx/cfb/cfbimage.c:1.1.1.1 mit/server/ddx/cfb/cfbimage.c:2.0
*** mit/server/ddx/cfb/cfbimage.c:1.1.1.1	Sat Mar 12 00:35:33 1994
--- mit/server/ddx/cfb/cfbimage.c	Sat Mar 12 00:35:33 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/cfb/cfbimage.c,v 2.0 1993/07/24 07:13:25 dawes Exp $ */
  /* $XConsortium: cfbimage.c,v 1.7 91/07/18 23:36:48 keith Exp $ */
  
  #include "X.h"
***************
*** 61,66 ****
--- 62,69 ----
      	FakePixmap.drawable.y = 0;
      	FakePixmap.drawable.width = w+leftPad;
      	FakePixmap.drawable.height = h;
+     	FakePixmap.slot = -1;
+     	FakePixmap.cacheId = 0;
      	FakePixmap.devKind = PixmapBytePad(FakePixmap.drawable.width, depth);
      	FakePixmap.refcnt = 1;
      	FakePixmap.devPrivate.ptr = (pointer)pImage;
***************
*** 140,145 ****
--- 143,150 ----
      	FakePixmap.drawable.y = 0;
      	FakePixmap.drawable.width = w;
      	FakePixmap.drawable.height = h;
+     	FakePixmap.slot = -1;
+     	FakePixmap.cacheId = 0;
      	FakePixmap.devKind = PixmapBytePad(w, pDrawable->depth);
      	FakePixmap.refcnt = 1;
      	FakePixmap.devPrivate.ptr = (pointer)pdstLine;
***************
*** 169,174 ****
--- 174,181 ----
      	FakePixmap.drawable.y = 0;
      	FakePixmap.drawable.width = w;
      	FakePixmap.drawable.height = h;
+     	FakePixmap.slot = -1;
+     	FakePixmap.cacheId = 0;
      	FakePixmap.devKind = PixmapBytePad(w, 1);
      	FakePixmap.refcnt = 1;
      	FakePixmap.devPrivate.ptr = (pointer)pdstLine;
diff -c mit/server/ddx/cfb/cfbline.c:1.1.1.1 mit/server/ddx/cfb/cfbline.c:2.1
*** mit/server/ddx/cfb/cfbline.c:1.1.1.1	Sat Mar 12 00:35:34 1994
--- mit/server/ddx/cfb/cfbline.c	Sat Mar 12 00:35:34 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/cfb/cfbline.c,v 2.1 1993/09/21 16:09:15 dawes Exp $ */
  /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */
  #include "X.h"
  
***************
*** 133,138 ****
--- 134,140 ----
      int axis;			/* major axis */
  
  				/* a bunch of temporaries */
+     int fix;
      int tmp;
      register int y1, y2;
      register int x1, x2;
***************
*** 310,319 ****
--- 312,323 ----
  	else	/* sloped line */
  	{
  	    signdx = 1;
+ 	    fix = -1;
  	    if ((adx = x2 - x1) < 0)
  	    {
  		adx = -adx;
  		signdx = -1;
+ 		fix = 0;
  	    }
  	    signdy = 1;
  	    if ((ady = y2 - y1) < 0)
***************
*** 361,367 ****
  		    cfbBresS (alu, and, xor,
  			  addrl, nlwidth,
  			  signdx, signdy, axis, x1, y1,
! 			  e, e1, e2, len);
  		    break;
  		}
  		else if (oc1 & oc2)
--- 365,371 ----
  		    cfbBresS (alu, and, xor,
  			  addrl, nlwidth,
  			  signdx, signdy, axis, x1, y1,
! 			  e + fix, e1, e2, len);
  		    break;
  		}
  		else if (oc1 & oc2)
***************
*** 430,436 ****
  				     (alu, and, xor,
  				      addrl, nlwidth,
  				      signdx, signdy, axis, pt1Copy.x, pt1Copy.y,
! 				      err, e1, e2, len);
  		    	}
  		    }
  		    pbox++;
--- 434,440 ----
  				     (alu, and, xor,
  				      addrl, nlwidth,
  				      signdx, signdy, axis, pt1Copy.x, pt1Copy.y,
! 				      err + fix, e1, e2, len);
  		    	}
  		    }
  		    pbox++;
diff -c mit/server/ddx/cfb/cfbpixmap.c:1.1.1.1 mit/server/ddx/cfb/cfbpixmap.c:2.2
*** mit/server/ddx/cfb/cfbpixmap.c:1.1.1.1	Sat Mar 12 00:35:35 1994
--- mit/server/ddx/cfb/cfbpixmap.c	Sat Mar 12 00:35:35 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/server/ddx/cfb/cfbpixmap.c,v 2.2 1993/09/09 05:59:44 dawes Exp $ */
  /* $XConsortium: cfbpixmap.c,v 5.7 91/07/18 23:36:46 keith Exp $ */
  /***********************************************************
  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
***************
*** 35,40 ****
--- 36,42 ----
  
  #include "cfb.h"
  #include "mi.h"
+ #include "micache.h"
  
  extern void mfbXRotatePixmap(), mfbYRotatePixmap();
  
***************
*** 140,145 ****
--- 142,149 ----
      pPixmap->drawable.y = 0;
      pPixmap->drawable.width = width;
      pPixmap->drawable.height = height;
+     pPixmap->slot = -1;
+     pPixmap->cacheId = 0;
      pPixmap->devKind = size;
      pPixmap->refcnt = 1;
      pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
***************
*** 152,157 ****
--- 156,162 ----
  {
      if(--pPixmap->refcnt)
  	return TRUE;
+     (*miCacheFreeSlot)(pPixmap);
      xfree(pPixmap);
      return TRUE;
  }
***************
*** 170,175 ****
--- 175,182 ----
      pDst->drawable = pSrc->drawable;
      pDst->drawable.id = 0;
      pDst->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+     pDst->slot = -1;
+     pDst->cacheId = 0;
      pDst->devKind = pSrc->devKind;
      pDst->refcnt = 1;
      pDst->devPrivate.ptr = (pointer)(pDst + 1);
***************
*** 402,407 ****
--- 409,416 ----
  	pdstPix->drawable.depth = psrcPix->drawable.depth;
  	pdstPix->drawable.bitsPerPixel = psrcPix->drawable.bitsPerPixel;
  	pdstPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ 	pdstPix->slot = -1;
+ 	pdstPix->cacheId = 0;
      }
      else
      {
diff -c mit/server/ddx/cfb/cfbrrop.h:1.1.1.1 mit/server/ddx/cfb/cfbrrop.h:2.0
*** mit/server/ddx/cfb/cfbrrop.h:1.1.1.1	Sat Mar 12 00:35:36 1994
--- mit/server/ddx/cfb/cfbrrop.h	Sat Mar 12 00:35:36 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/server/ddx/cfb/cfbrrop.h,v 2.0 1993/12/10 14:33:58 dawes Exp $
   * $XConsortium: cfbrrop.h,v 1.6 91/04/10 11:42:06 keith Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 128,134 ****
      }
  #endif
  
! #if __STDC__ && !defined(UNIXCPP)
  #define RROP_NAME_CAT(prefix,suffix)	prefix##suffix
  #else
  #define RROP_NAME_CAT(prefix,suffix)	prefix/**/suffix
--- 129,135 ----
      }
  #endif
  
! #if (__STDC__ && !defined(UNIXCPP)) || (defined (SOLX86) && defined (__STDC__) && !defined (__GNUC__))
  #define RROP_NAME_CAT(prefix,suffix)	prefix##suffix
  #else
  #define RROP_NAME_CAT(prefix,suffix)	prefix/**/suffix
diff -c mit/server/ddx/mfb/Imakefile:1.1.1.1 mit/server/ddx/mfb/Imakefile:2.1
*** mit/server/ddx/mfb/Imakefile:1.1.1.1	Sat Mar 12 00:35:40 1994
--- mit/server/ddx/mfb/Imakefile	Sat Mar 12 00:35:40 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/server/ddx/mfb/Imakefile,v 2.1 1993/09/22 15:41:04 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.32 91/07/16 22:51:36 gildea Exp $
  #include <Server.tmpl>
  
***************
*** 37,42 ****
--- 38,50 ----
  NormalLibraryTarget(mfb,$(OBJS))
  LintLibraryTarget(mfb,$(SRCS1))
  NormalLintTarget($(LINTDEFS) $(SRCS1))
+ 
+ InstallLinkKitLibrary(mfb,$(LINKKITDIR)/lib)
+ InstallLinkKitNonExecFile(fastblt.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(mfb.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(mfbcustom.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(mfbmap.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(mergerop.h,$(LINKKITDIR)/include)
  
  ObjectFromSpecialSource(mfbseg,mfbline,-DPOLYSEGMENT)
  
diff -c mit/server/ddx/mfb/maskbits.c:1.1.1.1 mit/server/ddx/mfb/maskbits.c:1.3
*** mit/server/ddx/mfb/maskbits.c:1.1.1.1	Sat Mar 12 00:35:41 1994
--- mit/server/ddx/mfb/maskbits.c	Sat Mar 12 00:35:41 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/server/ddx/mfb/maskbits.c,v 1.3 1993/03/27 09:00:28 dawes Exp $ */
  /* $XConsortium: maskbits.c,v 1.11 91/07/09 17:05:36 rws Exp $ */
  /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
  /***********************************************************
***************
*** 23,28 ****
--- 24,30 ----
  SOFTWARE.
  
  ******************************************************************/
+ #include "mfb.h"
  #include "maskbits.h"
  #include "servermd.h"
  
diff -c mit/server/ddx/mfb/maskbits.h:1.1.1.1 mit/server/ddx/mfb/maskbits.h:2.0
*** mit/server/ddx/mfb/maskbits.h:1.1.1.1	Sat Mar 12 00:35:42 1994
--- mit/server/ddx/mfb/maskbits.h	Sat Mar 12 00:35:42 1994
***************
*** 22,27 ****
--- 22,28 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/maskbits.h,v 2.0 1993/11/24 12:32:34 dawes Exp $ */
  /* $XConsortium: maskbits.h,v 1.26 91/07/09 19:44:24 keith Exp $ */
  #include "X.h"
  #include "Xmd.h"
***************
*** 200,205 ****
--- 201,207 ----
  
  #if (BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER)
  #define LONG2CHARS(x) (x)
+ #define LONG2CHARS_F(x) (x)
  #else
  /*
   *  the unsigned case below is for compilers like
***************
*** 209,222 ****
                        | ( ( ( x ) & 0x0000FF00 ) << 0x08 ) \
                        | ( ( ( x ) & 0x00FF0000 ) >> 0x08 ) \
                        | ( ( ( x ) & (unsigned long)0xFF000000 ) >> 0x18 ) )
  #endif
  
  #ifdef STRICT_ANSI_SHIFT
! #define SHL(x,y)    ((y) >= 32 ? 0 : LONG2CHARS(LONG2CHARS(x) << (y)))
! #define SHR(x,y)    ((y) >= 32 ? 0 : LONG2CHARS(LONG2CHARS(x) >> (y)))
  #else
! #define SHL(x,y)    LONG2CHARS(LONG2CHARS(x) << (y))
! #define SHR(x,y)    LONG2CHARS(LONG2CHARS(x) >> (y))
  #endif
  
  #if (BITMAP_BIT_ORDER == MSBFirst)	/* pc/rt, 680x0 */
--- 211,234 ----
                        | ( ( ( x ) & 0x0000FF00 ) << 0x08 ) \
                        | ( ( ( x ) & 0x00FF0000 ) >> 0x08 ) \
                        | ( ( ( x ) & (unsigned long)0xFF000000 ) >> 0x18 ) )
+ #if defined(__GNUC__) && defined(i386)
+ #define LONG2CHARS_F(x) \
+ ({ unsigned long __x = (x);					\
+    __asm ("xchgb %%al,%%ah; ror $16,%%eax; xchgb %%al,%%ah"	\
+           : "=a" (__x) : "0" (__x));				\
+    __x;								\
+  })
+ #else
+ #define LONG2CHARS_F(x) LONG2CHARS(x)
+ #endif /* not __GNUC__ && i386 */
  #endif
  
  #ifdef STRICT_ANSI_SHIFT
! #define SHL(x,y)    ((y) >= 32 ? 0 : LONG2CHARS_F(LONG2CHARS_F(x) << (y)))
! #define SHR(x,y)    ((y) >= 32 ? 0 : LONG2CHARS_F(LONG2CHARS_F(x) >> (y)))
  #else
! #define SHL(x,y)    LONG2CHARS_F(LONG2CHARS_F(x) << (y))
! #define SHR(x,y)    LONG2CHARS_F(LONG2CHARS_F(x) >> (y))
  #endif
  
  #if (BITMAP_BIT_ORDER == MSBFirst)	/* pc/rt, 680x0 */
***************
*** 270,281 ****
  #define FASTGETBITS(psrc,x,w,dst) \
      __asm ("extzv %1,%2,%3,%0" \
  	 : "=g" (dst) \
! 	 : "g" (x), "g" (w), "m" (*(char *)(psrc)))
  #define getbits(psrc,x,w,dst) FASTGETBITS(psrc,x,w,dst)
  
  #define FASTPUTBITS(src, x, w, pdst) \
      __asm ("insv %3,%1,%2,%0" \
! 	 : "=m" (*(char *)(pdst)) \
  	 : "g" (x), "g" (w), "g" (src))
  #define putbits(src, x, w, pdst) FASTPUTBITS(src, x, w, pdst)
  #endif /* vax */
--- 282,293 ----
  #define FASTGETBITS(psrc,x,w,dst) \
      __asm ("extzv %1,%2,%3,%0" \
  	 : "=g" (dst) \
! 	 : "g" (x), "g" (w), "m" (*(char *)MAPR(psrc)))
  #define getbits(psrc,x,w,dst) FASTGETBITS(psrc,x,w,dst)
  
  #define FASTPUTBITS(src, x, w, pdst) \
      __asm ("insv %3,%1,%2,%0" \
! 	 : "=m" (*(char *)MAPW(pdst)) \
  	 : "g" (x), "g" (w), "g" (src))
  #define putbits(src, x, w, pdst) FASTPUTBITS(src, x, w, pdst)
  #endif /* vax */
***************
*** 282,288 ****
  #ifdef mc68020
  #define FASTGETBITS(psrc, x, w, dst) \
      __asm ("bfextu %3{%1:%2},%0" \
!     : "=d" (dst) : "di" (x), "di" (w), "o" (*(char *)(psrc)))
  
  #define getbits(psrc,x,w,dst) \
  { \
--- 294,300 ----
  #ifdef mc68020
  #define FASTGETBITS(psrc, x, w, dst) \
      __asm ("bfextu %3{%1:%2},%0" \
!     : "=d" (dst) : "di" (x), "di" (w), "o" (*(char *)MAPR(psrc)))
  
  #define getbits(psrc,x,w,dst) \
  { \
***************
*** 292,299 ****
  
  #define FASTPUTBITS(src, x, w, pdst) \
      __asm ("bfins %3,%0{%1:%2}" \
! 	 : "=o" (*(char *)(pdst)) \
! 	 : "di" (x), "di" (w), "d" (src), "0" (*(char *) (pdst)))
  
  #define putbits(src, x, w, pdst) FASTPUTBITS(SHR((src),32-(w)), x, w, pdst)
  
--- 304,311 ----
  
  #define FASTPUTBITS(src, x, w, pdst) \
      __asm ("bfins %3,%0{%1:%2}" \
! 	 : "=o" (*(char *)MAPW(pdst)) \
! 	 : "di" (x), "di" (w), "d" (src), "0" (*(char *)MAPW(pdst)))
  
  #define putbits(src, x, w, pdst) FASTPUTBITS(SHR((src),32-(w)), x, w, pdst)
  
***************
*** 330,342 ****
      { \
  	register int tmpmask; \
  	maskpartialbits((x), (w), tmpmask); \
! 	*(pdst) = (*(pdst) & ~tmpmask) | \
  		(SCRRIGHT(src, x) & tmpmask); \
      } \
      else \
      { \
! 	*(pdst) = (*(pdst) & endtab[x]) | (SCRRIGHT((src), x)); \
! 	(pdst)[1] = ((pdst)[1] & starttab[n]) | \
  		(SCRLEFT(src, 32-(x)) & endtab[n]); \
      } \
  }
--- 342,354 ----
      { \
  	register int tmpmask; \
  	maskpartialbits((x), (w), tmpmask); \
! 	*MAPW(pdst) = ((*MAPR(pdst)) & ~tmpmask) | \
  		(SCRRIGHT(src, x) & tmpmask); \
      } \
      else \
      { \
! 	*MAPW(pdst) = ((*MAPR(pdst)) & endtab[x]) | (SCRRIGHT((src), x)); \
! 	*MAPW(&((pdst)[1])) = ((*MAPR(&((pdst)[1]))) & starttab[n]) | \
  		(SCRLEFT(src, 32-(x)) & endtab[n]); \
      } \
  }
***************
*** 359,367 ****
  #ifndef getbits
  #define getbits(psrc, x, w, dst) \
  { \
!     dst = SCRLEFT(*(psrc), (x)); \
      if ( ((x) + (w)) > 32) \
! 	dst |= (SCRRIGHT(*((psrc)+1), 32-(x))); \
  }
  #endif
  
--- 371,379 ----
  #ifndef getbits
  #define getbits(psrc, x, w, dst) \
  { \
!     dst = SCRLEFT(*MAPR(psrc), (x)); \
      if ( ((x) + (w)) > 32) \
! 	dst |= (SCRRIGHT(*MAPR((psrc)+1), 32-(x))); \
  }
  #endif
  
***************
*** 374,380 ****
  	register int n = (x)+(w)-32; \
  	\
  	t1 = SCRRIGHT((src), (x)); \
! 	DoRop(t2, rop, t1, *(pdst)); \
  	\
      if (n <= 0) \
      { \
--- 386,392 ----
  	register int n = (x)+(w)-32; \
  	\
  	t1 = SCRRIGHT((src), (x)); \
! 	DoRop(t2, rop, t1, *MAPR(pdst)); \
  	\
      if (n <= 0) \
      { \
***************
*** 381,395 ****
  	register int tmpmask; \
  	\
  	maskpartialbits((x), (w), tmpmask); \
! 	*(pdst) = (*(pdst) & ~tmpmask) | (t2 & tmpmask); \
      } \
      else \
      { \
  	int m = 32-(x); \
! 	*(pdst) = (*(pdst) & endtab[x]) | (t2 & starttab[x]); \
  	t1 = SCRLEFT((src), m); \
! 	DoRop(t2, rop, t1, (pdst)[1]); \
! 	(pdst)[1] = ((pdst)[1] & starttab[n]) | (t2 & endtab[n]); \
      } \
  }
  
--- 393,409 ----
  	register int tmpmask; \
  	\
  	maskpartialbits((x), (w), tmpmask); \
! 	*MAPW(pdst) = ((*MAPR(pdst)) & ~tmpmask) | (t2 & tmpmask); \
      } \
      else \
      { \
  	int m = 32-(x); \
! 	*MAPW(pdst) = ((*MAPR(pdst)) & endtab[x]) | (t2 & starttab[x]); \
  	t1 = SCRLEFT((src), m); \
! 	CHECKRWONEXT(pdst); \
! 	DoRop(t2, rop, t1, *MAPR(&((pdst)[1]))); \
! 	*MAPW(&((pdst)[1])) = ((*MAPR(&((pdst)[1]))) & starttab[n]) | (t2 & endtab[n]); \
! 	CHECKRWU(pdst); \
      } \
  }
  
***************
*** 448,454 ****
  	register int n = (x)+(w)-32; \
  	\
  	t1 = SCRRIGHT((src), (x)); \
! 	t2 = DoRRop(rop, t1, *(pdst)); \
  	\
      if (n <= 0) \
      { \
--- 462,468 ----
  	register int n = (x)+(w)-32; \
  	\
  	t1 = SCRRIGHT((src), (x)); \
! 	t2 = DoRRop(rop, t1, *MAPR(pdst)); \
  	\
      if (n <= 0) \
      { \
***************
*** 455,475 ****
  	register int tmpmask; \
  	\
  	maskpartialbits((x), (w), tmpmask); \
! 	*(pdst) = (*(pdst) & ~tmpmask) | (t2 & tmpmask); \
      } \
      else \
      { \
  	int m = 32-(x); \
! 	*(pdst) = (*(pdst) & endtab[x]) | (t2 & starttab[x]); \
  	t1 = SCRLEFT((src), m); \
! 	t2 = DoRRop(rop, t1, (pdst)[1]); \
! 	(pdst)[1] = ((pdst)[1] & starttab[n]) | (t2 & endtab[n]); \
      } \
  }
  #endif
  
  #if GETLEFTBITS_ALIGNMENT == 1
! #define getleftbits(psrc, w, dst)	dst = *((unsigned int *) psrc)
  #endif /* GETLEFTBITS_ALIGNMENT == 1 */
  
  #if GETLEFTBITS_ALIGNMENT == 2
--- 469,491 ----
  	register int tmpmask; \
  	\
  	maskpartialbits((x), (w), tmpmask); \
! 	*MAPW(pdst) = ((*MAPR(pdst)) & ~tmpmask) | (t2 & tmpmask); \
      } \
      else \
      { \
  	int m = 32-(x); \
! 	*MAPW(pdst) = ((*MAPR(pdst)) & endtab[x]) | (t2 & starttab[x]); \
  	t1 = SCRLEFT((src), m); \
! 	CHECKRWONEXT(pdst); \
! 	t2 = DoRRop(rop, t1, *MAPR(&((pdst)[1]))); \
! 	*MAPW(&((pdst)[1])) = ((*MAPR(&((pdst)[1]))) & starttab[n]) | (t2 & endtab[n]); \
!         CHECKRWU(pdst); \
      } \
  }
  #endif
  
  #if GETLEFTBITS_ALIGNMENT == 1
! #define getleftbits(psrc, w, dst)	dst = *((unsigned int *)MAPR(psrc))
  #endif /* GETLEFTBITS_ALIGNMENT == 1 */
  
  #if GETLEFTBITS_ALIGNMENT == 2
***************
*** 587,597 ****
      register int          _flag = 32 - (sbindex); \
      register unsigned int _src; \
   \
!     _src = SCRLEFT (*(psrc), (sbindex)); \
      if ((width) > _flag) \
! 	_src |=  SCRRIGHT (*((psrc) + 1), _flag); \
   \
!     *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
  }
  
  
--- 603,613 ----
      register int          _flag = 32 - (sbindex); \
      register unsigned int _src; \
   \
!     _src = SCRLEFT (*MAPR(psrc), (sbindex)); \
      if ((width) > _flag) \
! 	_src |=  SCRRIGHT (*MAPR((psrc) + 1), _flag); \
   \
!     *MAPW(pdst) = ((*MAPR(pdst)) & starttab[(width)]) | (_src & endtab[(width)]); \
  }
  
  
***************
*** 600,611 ****
      register int          _flag = 32 - (sbindex); \
      register unsigned int _src; \
   \
!     _src = SCRLEFT (*(psrc), (sbindex)); \
      if ((width) > _flag) \
! 	_src |=  SCRRIGHT (*((psrc) + 1), _flag); \
!     DoRop(_src, rop, _src, *(pdst)); \
   \
!     *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
  }
  
  #define getandputrrop0(psrc, sbindex, width, pdst, rop) \
--- 616,627 ----
      register int          _flag = 32 - (sbindex); \
      register unsigned int _src; \
   \
!     _src = SCRLEFT (*MAPR(psrc), (sbindex)); \
      if ((width) > _flag) \
! 	_src |=  SCRRIGHT (*MAPR((psrc) + 1), _flag); \
!     DoRop(_src, rop, _src, *MAPR(pdst)); \
   \
!     *MAPW(pdst) = ((*MAPR(pdst)) & starttab[(width)]) | (_src & endtab[(width)]); \
  }
  
  #define getandputrrop0(psrc, sbindex, width, pdst, rop) \
***************
*** 613,624 ****
      int             _flag = 32 - (sbindex); \
      register unsigned int _src; \
   \
!     _src = SCRLEFT (*(psrc), (sbindex)); \
      if ((width) > _flag) \
! 	_src |=  SCRRIGHT (*((psrc) + 1), _flag); \
!     _src = DoRRop(rop, _src, *(pdst)); \
   \
!     *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
  }
  
  #endif  /* FASTGETBITS && FASTPUTBITS */
--- 629,640 ----
      int             _flag = 32 - (sbindex); \
      register unsigned int _src; \
   \
!     _src = SCRLEFT (*MAPR(psrc), (sbindex)); \
      if ((width) > _flag) \
! 	_src |=  SCRRIGHT (*MAPR((psrc) + 1), _flag); \
!     _src = DoRRop(rop, _src, *MAPR(pdst)); \
   \
!     *MAPW(pdst) = ((*MAPR(pdst)) & starttab[(width)]) | (_src & endtab[(width)]); \
  }
  
  #endif  /* FASTGETBITS && FASTPUTBITS */
diff -c mit/server/ddx/mfb/mergerop.h:1.1.1.1 mit/server/ddx/mfb/mergerop.h:2.0
*** mit/server/ddx/mfb/mergerop.h:1.1.1.1	Sat Mar 12 00:35:43 1994
--- mit/server/ddx/mfb/mergerop.h	Sat Mar 12 00:35:43 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/server/ddx/mfb/mergerop.h,v 2.0 1993/12/10 14:34:07 dawes Exp $
   * $XConsortium: mergerop.h,v 1.7 91/07/18 22:54:58 keith Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 176,182 ****
  #define MROP_PREBUILT_MASK(src,dst,mask)    MROP_MASK(src,dst,mask)
  #endif
  
! #if __STDC__ && !defined(UNIXCPP)
  #define MROP_NAME_CAT(prefix,suffix)	prefix##suffix
  #else
  #define MROP_NAME_CAT(prefix,suffix)	prefix/**/suffix
--- 177,183 ----
  #define MROP_PREBUILT_MASK(src,dst,mask)    MROP_MASK(src,dst,mask)
  #endif
  
! #if (__STDC__ && !defined(UNIXCPP)) || (defined (SOLX86) && defined (__STDC__) && !defined (__GNUC__))
  #define MROP_NAME_CAT(prefix,suffix)	prefix##suffix
  #else
  #define MROP_NAME_CAT(prefix,suffix)	prefix/**/suffix
diff -c mit/server/ddx/mfb/mfb.h:1.1.1.1 mit/server/ddx/mfb/mfb.h:1.3
*** mit/server/ddx/mfb/mfb.h:1.1.1.1	Sat Mar 12 00:35:43 1994
--- mit/server/ddx/mfb/mfb.h	Sat Mar 12 00:35:43 1994
***************
*** 22,31 ****
--- 22,35 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfb.h,v 1.3 1993/03/27 09:00:33 dawes Exp $ */
  /* $XConsortium: mfb.h,v 5.15 91/04/10 11:43:42 keith Exp $ */
  /* Monochrome Frame Buffer definitions 
     written by drewry, september 1986
  */
+ #include "misc.h"
+ #include "mfbcustom.h"
+ #include "mfbmap.h"
  #include "pixmap.h"
  #include "region.h"
  #include "gc.h"
diff -c mit/server/ddx/mfb/mfbblt.c:1.1.1.1 mit/server/ddx/mfb/mfbblt.c:1.7
*** mit/server/ddx/mfb/mfbblt.c:1.1.1.1	Sat Mar 12 00:35:44 1994
--- mit/server/ddx/mfb/mfbblt.c	Sat Mar 12 00:35:44 1994
***************
*** 18,25 ****
--- 18,27 ----
  Author: Keith Packard
  
  */
+ /* $XFree86: mit/server/ddx/mfb/mfbblt.c,v 1.7 1993/03/27 09:00:35 dawes Exp $ */
  /* $XConsortium: mfbblt.c,v 1.5 91/01/27 13:02:19 keith Exp $ */
  
+ #define BANKING_MODS
  #include	"X.h"
  #include	"Xmd.h"
  #include	"Xproto.h"
***************
*** 109,114 ****
--- 111,118 ----
  	widthDst = (int)(((PixmapPtr)pDst)->devKind) >> 2;
      }
  
+     BANK_FLAG_BOTH(psrcBase, pdstBase)
+ 
      /* XXX we have to err on the side of safety when both are windows,
       * because we don't know if IncludeInferiors is being used.
       */
***************
*** 260,272 ****
  		{
  		    psrc = psrcLine;
  		    pdst = pdstLine;
  		    pdstLine += widthDst;
  		    psrcLine += widthSrc;
  		    if (startmask)
  		    {
! 			*pdst = MROP_MASK(*psrc, *pdst, startmask);
! 			psrc++;
! 			pdst++;
  		    }
  		    nl = nlMiddle;
  
--- 264,281 ----
  		{
  		    psrc = psrcLine;
  		    pdst = pdstLine;
+                     SETW(pdst);
+                     SETR(psrc);
  		    pdstLine += widthDst;
  		    psrcLine += widthSrc;
  		    if (startmask)
  		    {
!                         bits = *MAPR(psrc);
!                         PUSHR();
! 			*MAPW(pdst) = MROP_MASK(bits, *MAPR(pdst), startmask);
! 			pdst++; CHECKWO(pdst);
!                         POPR();
! 			psrc++; CHECKRO(psrc);
  		    }
  		    nl = nlMiddle;
  
***************
*** 276,283 ****
  		    psrc += nl & (UNROLL-1);
  		    pdst += nl & (UNROLL-1);
  
! #define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
! #define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
  
  #define LoopReset \
  pdst += UNROLL; \
--- 285,292 ----
  		    psrc += nl & (UNROLL-1);
  		    pdst += nl & (UNROLL-1);
  
! #define BodyOdd(n) *MAPW(&(pdst[-n])) = MROP_SOLID (*MAPR(&(psrc[-n])), *MAPR(&(pdst[-n])));
! #define BodyEven(n) *MAPW(&(pdst[-n])) = MROP_SOLID (*MAPR(&(psrc[-n])), *MAPR(&(pdst[-n])));
  
  #define LoopReset \
  pdst += UNROLL; \
***************
*** 285,291 ****
  
  #else
  
! #define BodyOdd(n)  *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++;
  #define BodyEven(n) BodyOdd(n)
  
  #define LoopReset   ;
--- 294,300 ----
  
  #else
  
! #define BodyOdd(n)  *MAPW(pdst) = MROP_SOLID (*MAPR(psrc), *MAPR(pdst)); pdst++; psrc++
  #define BodyEven(n) BodyOdd(n)
  
  #define LoopReset   ;
***************
*** 306,328 ****
  		    while ((nl -= 6) >= 0)
  		    {
  			asm ("moveml %1+,#0x0c0f;moveml#0x0c0f,%0"
! 			     : "=m" (*(char *)pdst)
! 			     : "m" (*(char *)psrc)
  			     : "d0", "d1", "d2", "d3",
  			       "a2", "a3");
  			pdst += 6;
  		    }
  		    nl += 6;
! 		    while (nl--)
! 			*pdst++ = *psrc++;
  #endif
  		    DuffL(nl, label1,
! 			    *pdst = MROP_SOLID (*psrc, *pdst);
! 			    pdst++; psrc++;)
  #endif
  
  		    if (endmask)
! 			*pdst = MROP_MASK(*psrc, *pdst, endmask);
  		}
  	    }
  #ifndef DO_UNALIGNED_BITBLT
--- 315,347 ----
  		    while ((nl -= 6) >= 0)
  		    {
  			asm ("moveml %1+,#0x0c0f;moveml#0x0c0f,%0"
! 			     : "=m" (*(char *)MAPW(pdst))
! 			     : "m" (*(char *)MAPR(psrc))
  			     : "d0", "d1", "d2", "d3",
  			       "a2", "a3");
  			pdst += 6;
  		    }
  		    nl += 6;
! 		    while (nl--) {
! 			*MAPW(pdst) = *MAPR(psrc); pdst++; psrc++;
! 		      }
  #endif
  		    DuffL(nl, label1,
!                             bits = *MAPR(psrc);
!                             PUSHR();
! 			    *MAPW(pdst) = MROP_SOLID (bits, *MAPR(pdst));
! 			    pdst++; CHECKWO(pdst);
!                             POPR();
! 			    psrc++; CHECKRO(psrc))
  #endif
  
  		    if (endmask)
!                     {
! 			bits = *MAPR(psrc);
! 			PUSHR();
! 			*MAPW(pdst) = MROP_MASK(bits, *MAPR(pdst), endmask);
! 			POPR();
! 		    }
  		}
  	    }
  #ifndef DO_UNALIGNED_BITBLT
***************
*** 342,359 ****
  		{
  		    psrc = psrcLine;
  		    pdst = pdstLine;
  		    pdstLine += widthDst;
  		    psrcLine += widthSrc;
  		    bits = 0;
! 		    if (xoffSrc > xoffDst)
! 			bits = *psrc++;
  		    if (startmask)
  		    {
  			bits1 = BitLeft(bits,leftShift);
! 			bits = *psrc++;
  			bits1 |= BitRight(bits,rightShift);
! 			*pdst = MROP_MASK(bits1, *pdst, startmask);
! 			pdst++;
  		    }
  		    nl = nlMiddle;
  
--- 361,383 ----
  		{
  		    psrc = psrcLine;
  		    pdst = pdstLine;
+                     SETW(pdst);
+                     SETR(psrc);
  		    pdstLine += widthDst;
  		    psrcLine += widthSrc;
  		    bits = 0;
! 		    if (xoffSrc > xoffDst) {
! 			bits = *MAPR(psrc); psrc++; CHECKRO(psrc);
! 		    }
  		    if (startmask)
  		    {
  			bits1 = BitLeft(bits,leftShift);
! 			bits = *MAPR(psrc); psrc++; CHECKRO(psrc);
  			bits1 |= BitRight(bits,rightShift);
! 			PUSHR();
! 			*MAPW(pdst) = MROP_MASK(bits1, *MAPR(pdst), startmask);
! 			pdst++; CHECKWO(pdst);
! 			POPR();
  		    }
  		    nl = nlMiddle;
  
***************
*** 366,377 ****
  		    pdst += nl & (UNROLL-1);
  
  #define BodyOdd(n) \
! bits = psrc[-n]; \
! pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]);
  
  #define BodyEven(n) \
! bits1 = psrc[-n]; \
! pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]);
  
  #define LoopReset \
  pdst += UNROLL; \
--- 390,401 ----
  		    pdst += nl & (UNROLL-1);
  
  #define BodyOdd(n) \
! bits = *MAPR(&(psrc[-n])); \
! *MAPW(&(pdst[-n])) = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *MAPR(&(pdst[-n])));
  
  #define BodyEven(n) \
! bits1 = *MAPR(&(psrc[-n])); \
! *MAPW(&(pdst[-n])) = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *MAPR(&(pdst[-n])));
  
  #define LoopReset \
  pdst += UNROLL; \
***************
*** 380,392 ****
  #else
  
  #define BodyOdd(n) \
! bits = *psrc++; \
! *pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \
  pdst++;
  		   
  #define BodyEven(n) \
! bits1 = *psrc++; \
! *pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \
  pdst++;
  
  #define LoopReset   ;
--- 404,416 ----
  #else
  
  #define BodyOdd(n) \
! bits = *MAPR(psrc); psrc++; \
! *MAPW(pdst) = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *MAPR(pdst)); \
  pdst++;
  		   
  #define BodyEven(n) \
! bits1 = *MAPR(psrc); psrc++; \
! *MAPW(pdst) = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *MAPR(pdst)); \
  pdst++;
  
  #define LoopReset   ;
***************
*** 402,410 ****
  #else
  		    DuffL (nl,label2,
  			bits1 = BitLeft(bits, leftShift);
! 			bits = *psrc++;
! 			*pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst);
! 			pdst++;
  		    )
  #endif
  
--- 426,437 ----
  #else
  		    DuffL (nl,label2,
  			bits1 = BitLeft(bits, leftShift);
! 			bits = *MAPR(psrc); psrc++; CHECKRO(psrc);
! 			PUSHR();
! 			*MAPW(pdst) = MROP_SOLID (bits1 | BitRight(bits,
!                                                      rightShift), *MAPR(pdst));
! 			pdst++; CHECKWO(pdst);
! 			POPR();
  		    )
  #endif
  
***************
*** 413,422 ****
  			bits1 = BitLeft(bits, leftShift);
  			if (BitLeft(endmask, rightShift))
  			{
! 			    bits = *psrc;
  			    bits1 |= BitRight(bits, rightShift);
  			}
! 			*pdst = MROP_MASK (bits1, *pdst, endmask);
  		    }
  		}
  	    }
--- 440,451 ----
  			bits1 = BitLeft(bits, leftShift);
  			if (BitLeft(endmask, rightShift))
  			{
! 			    bits = *MAPR(psrc);
  			    bits1 |= BitRight(bits, rightShift);
  			}
! 			PUSHR();
! 			*MAPW(pdst) = MROP_MASK (bits1, *MAPR(pdst), endmask);
! 			POPR();
  		    }
  		}
  	    }
***************
*** 440,452 ****
  		{
  		    psrc = psrcLine;
  		    pdst = pdstLine;
  		    pdstLine += widthDst;
  		    psrcLine += widthSrc;
  		    if (endmask)
  		    {
! 			pdst--;
! 			psrc--;
! 			*pdst = MROP_MASK (*psrc, *pdst, endmask);
  		    }
  		    nl = nlMiddle;
  
--- 469,486 ----
  		{
  		    psrc = psrcLine;
  		    pdst = pdstLine;
+                     SETW(pdst);
+                     SETR(psrc);
  		    pdstLine += widthDst;
  		    psrcLine += widthSrc;
  		    if (endmask)
  		    {
! 			psrc--; CHECKRU(psrc);
! 			bits = *MAPR(psrc);
! 			PUSHR();
! 			pdst--; CHECKRWU(pdst);
! 			*MAPW(pdst) = MROP_MASK (bits, *MAPR(pdst), endmask);
! 			POPR();
  		    }
  		    nl = nlMiddle;
  
***************
*** 455,461 ****
  		    psrc -= nl & (UNROLL - 1);
  		    pdst -= nl & (UNROLL - 1);
  
! #define BodyOdd(n) pdst[n-1] = MROP_SOLID (psrc[n-1], pdst[n-1]);
  
  #define BodyEven(n) BodyOdd(n)
  
--- 489,495 ----
  		    psrc -= nl & (UNROLL - 1);
  		    pdst -= nl & (UNROLL - 1);
  
! #define BodyOdd(n) *MAPW(&(pdst[n-1])) = MROP_SOLID (*MAPR(&(psrc[n-1])), *MAPR(&(pdst[n-1])));
  
  #define BodyEven(n) BodyOdd(n)
  
***************
*** 465,471 ****
  
  #else
  
! #define BodyOdd(n)  --pdst; --psrc; *pdst = MROP_SOLID(*psrc, *pdst);
  #define BodyEven(n) BodyOdd(n)
  #define LoopReset   ;
  
--- 499,505 ----
  
  #else
  
! #define BodyOdd(n)  --pdst; --psrc; *MAPW(pdst) = MROP_SOLID(*MAPR(psrc), *MAPR(pdst));
  #define BodyEven(n) BodyOdd(n)
  #define LoopReset   ;
  
***************
*** 478,491 ****
  
  #else
  		    DuffL(nl,label3,
! 			 --pdst; --psrc; *pdst = MROP_SOLID (*psrc, *pdst);)
  #endif
  
  		    if (startmask)
  		    {
! 			--pdst;
! 			--psrc;
! 			*pdst = MROP_MASK(*psrc, *pdst, startmask);
  		    }
  		}
  	    }
--- 512,533 ----
  
  #else
  		    DuffL(nl,label3,
! 			  --psrc; CHECKRU(psrc);
! 			  bits = *MAPR(psrc);
! 			  PUSHR();
! 			  --pdst; CHECKRWU(pdst);
!                           *MAPW(pdst) = MROP_SOLID (bits, *MAPR(pdst));
! 			  POPR();)
  #endif
  
  		    if (startmask)
  		    {
! 			--psrc; CHECKRU(psrc);
! 			bits = *MAPR(psrc);
! 			PUSHR();
! 			--pdst; CHECKRWU(pdst);
! 			*MAPW(pdst) = MROP_MASK(bits, *MAPR(pdst), startmask);
! 			POPR();
  		    }
  		}
  	    }
***************
*** 506,523 ****
  		{
  		    psrc = psrcLine;
  		    pdst = pdstLine;
  		    pdstLine += widthDst;
  		    psrcLine += widthSrc;
  		    bits = 0;
! 		    if (xoffDst > xoffSrc)
! 			bits = *--psrc;
  		    if (endmask)
  		    {
  			bits1 = BitRight(bits, rightShift);
! 			bits = *--psrc;
  			bits1 |= BitLeft(bits, leftShift);
! 			pdst--;
! 			*pdst = MROP_MASK(bits1, *pdst, endmask);
  		    }
  		    nl = nlMiddle;
  
--- 548,570 ----
  		{
  		    psrc = psrcLine;
  		    pdst = pdstLine;
+                     SETW(pdst);
+                     SETR(psrc);
  		    pdstLine += widthDst;
  		    psrcLine += widthSrc;
  		    bits = 0;
! 		    if (xoffDst > xoffSrc) {
! 			--psrc; CHECKRU(psrc); bits = *MAPR(psrc);
! 		    }
  		    if (endmask)
  		    {
  			bits1 = BitRight(bits, rightShift);
! 			-- psrc; CHECKRU(psrc); bits = *MAPR(psrc);
  			bits1 |= BitLeft(bits, leftShift);
! 			PUSHR();
! 			pdst--; CHECKRWU(pdst);
! 			*MAPW(pdst) = MROP_MASK(bits1, *MAPR(pdst), endmask);
! 			POPR();
  		    }
  		    nl = nlMiddle;
  
***************
*** 528,539 ****
  		    pdst -= nl & (UNROLL - 1);
  
  #define BodyOdd(n) \
! bits = psrc[n-1]; \
! pdst[n-1] = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),pdst[n-1]);
  
  #define BodyEven(n) \
! bits1 = psrc[n-1]; \
! pdst[n-1] = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),pdst[n-1]);
  
  #define LoopReset \
  pdst -= UNROLL; \
--- 575,586 ----
  		    pdst -= nl & (UNROLL - 1);
  
  #define BodyOdd(n) \
! bits = *MAPR(&(psrc[n-1])); \
! *MAPW(&(pdst[n-1])) = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*MAPR(&(pdst[n-1])));
  
  #define BodyEven(n) \
! bits1 = *MAPR(&(psrc[n-1])); \
! *MAPW(&(pdst[n-1])) = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*MAPR(&(pdst[n-1])));
  
  #define LoopReset \
  pdst -= UNROLL; \
***************
*** 542,553 ****
  #else
  
  #define BodyOdd(n) \
! bits = *--psrc; --pdst; \
! *pdst = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*pdst);
  
  #define BodyEven(n) \
! bits1 = *--psrc; --pdst; \
! *pdst = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*pdst);
  
  #define LoopReset   ;
  
--- 589,600 ----
  #else
  
  #define BodyOdd(n) \
! --psrc; bits = *MAPR(psrc); \
! --pdst; *MAPW(pdst) = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*MAPR(pdst));
  
  #define BodyEven(n) \
! --psrc; bits1 = *MAPR(psrc); \
! --pdst; *MAPW(pdst) = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*MAPR(pdst));
  
  #define LoopReset   ;
  
***************
*** 562,570 ****
  #else
  		    DuffL (nl, label4,
  			bits1 = BitRight(bits, rightShift);
! 			bits = *--psrc;
! 			--pdst;
! 			*pdst = MROP_SOLID(bits1 | BitLeft(bits, leftShift),*pdst);
  		    )
  #endif
  
--- 609,619 ----
  #else
  		    DuffL (nl, label4,
  			bits1 = BitRight(bits, rightShift);
! 			--psrc; CHECKRU(psrc); bits = *MAPR(psrc);
! 			PUSHR();
! 			--pdst;	CHECKRWU(pdst);
!                         *MAPW(pdst) = MROP_SOLID(bits1 | BitLeft(bits, leftShift),*MAPR(pdst));
! 			POPR();
  		    )
  #endif
  
***************
*** 573,583 ****
  			bits1 = BitRight(bits, rightShift);
  			if (BitRight (startmask, leftShift))
  			{
! 			    bits = *--psrc;
  			    bits1 |= BitLeft(bits, leftShift);
  			}
! 			--pdst;
! 			*pdst = MROP_MASK(bits1, *pdst, startmask);
  		    }
  		}
  	    }
--- 622,634 ----
  			bits1 = BitRight(bits, rightShift);
  			if (BitRight (startmask, leftShift))
  			{
! 			    --psrc; CHECKRU(psrc); bits = *MAPR(psrc);
  			    bits1 |= BitLeft(bits, leftShift);
  			}
! 			PUSHR();
! 			--pdst; CHECKRWU(pdst);
!                         *MAPW(pdst) = MROP_MASK(bits1, *MAPR(pdst), startmask);
! 			POPR();
  		    }
  		}
  	    }
diff -c mit/server/ddx/mfb/mfbbres.c:1.1.1.1 mit/server/ddx/mfb/mfbbres.c:1.4
*** mit/server/ddx/mfb/mfbbres.c:1.1.1.1	Sat Mar 12 00:35:45 1994
--- mit/server/ddx/mfb/mfbbres.c	Sat Mar 12 00:35:45 1994
***************
*** 22,28 ****
--- 22,30 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbbres.c,v 1.4 1993/03/27 09:00:37 dawes Exp $ */
  /* $XConsortium: mfbbres.c,v 1.15 89/09/14 16:26:53 rws Exp $ */
+ #define BANKING_MODS
  #include "X.h"
  #include "misc.h"
  #include "mfb.h"
***************
*** 54,68 ****
  
      register int e3 = e2-e1;
      unsigned int	tmp;
  
      /* point to longword containing first point */
      addrb = (unsigned char *)(addrl + (y1 * nlwidth) + (x1 >> 5));
      yinc = signdy * nlwidth * 4;                /* 4 == sizeof(int) */
      e = e-e1;			/* to make looping easier */
      bit = mask[x1 & 31];
  
-     if (!len)
- 	return;
      if (rop == RROP_BLACK)
      {
          if (axis == X_AXIS)
--- 56,82 ----
  
      register int e3 = e2-e1;
      unsigned int	tmp;
+ #ifdef BANKED_MFB
+     unsigned char Oflag, Uflag;
+ #endif
  
+     if (!len)
+ 	return;
+ 
+     BANK_FLAG(addrl);
+ 
      /* point to longword containing first point */
      addrb = (unsigned char *)(addrl + (y1 * nlwidth) + (x1 >> 5));
+     SETRW(addrb);
      yinc = signdy * nlwidth * 4;                /* 4 == sizeof(int) */
+ #ifdef BANKED_MFB
+     Oflag = (vgaWriteFlag && (yinc > 0));
+     Uflag = (vgaWriteFlag && (yinc < 0));
+ #endif
+     
      e = e-e1;			/* to make looping easier */
      bit = mask[x1 & 31];
  
      if (rop == RROP_BLACK)
      {
          if (axis == X_AXIS)
***************
*** 69,75 ****
          {
  	    if (signdx > 0)
  	    {
! 		tmp = *(unsigned long*)addrb;
  		for (;;)
  		{ 
  		    tmp &= ~bit;
--- 83,89 ----
          {
  	    if (signdx > 0)
  	    {
! 		tmp = *MAPR(addrb);
  		for (;;)
  		{ 
  		    tmp &= ~bit;
***************
*** 79,107 ****
  		    e += e1;
   		    if (e >= 0)
  		    {
! 			*(unsigned long *) addrb = tmp;
! 			addrb += yinc;
  			e += e3;
  			if (!bit)
  			{
  			    bit = leftbit;
! 			    addrb += 4;
  			}
! 			tmp = *(unsigned long *) addrb;
  		    }
  		    else if (!bit)
   		    {
! 			*(unsigned long *) addrb = tmp;
  			bit = leftbit;
! 			addrb += 4;
! 			tmp = *(unsigned long *) addrb;
  		    }
  		}
! 		*(unsigned long *) addrb = tmp;
  	    }
  	    else
  	    {
! 		tmp = *(unsigned long *)addrb;
  		for (;;)
  		{ 
  		    tmp &= ~bit;
--- 93,121 ----
  		    e += e1;
   		    if (e >= 0)
  		    {
! 			*MAPW(addrb) = tmp;
! 			addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  			e += e3;
  			if (!bit)
  			{
  			    bit = leftbit;
! 			    addrb += 4; CHECKRWO(addrb);
  			}
! 			tmp = *MAPR(addrb);
  		    }
  		    else if (!bit)
   		    {
! 			*MAPW(addrb) = tmp;
  			bit = leftbit;
! 			addrb += 4; CHECKRWO(addrb);
! 			tmp = *MAPR(addrb);
  		    }
  		}
! 		*MAPW(addrb) = tmp;
  	    }
  	    else
  	    {
! 		tmp = *MAPR(addrb);
  		for (;;)
  		{ 
  		    tmp &= ~bit;
***************
*** 111,135 ****
  		    bit = SCRLEFT(bit,1);
  		    if (e >= 0)
  		    {
! 			*(unsigned long *) addrb = tmp;
! 			addrb += yinc;
  			e += e3;
  			if (!bit)
  			{
  			    bit = rightbit;
! 			    addrb -= 4;
  			}
! 			tmp = *(unsigned long *) addrb;
  		    }
  		    else if (!bit)
   		    {
! 			*(unsigned long *) addrb = tmp;
  			bit = rightbit;
! 			addrb -= 4;
! 			tmp = *(unsigned long *) addrb;
  		    }
  		}
! 		*(unsigned long *) addrb = tmp;
  	    }
          } /* if X_AXIS */
          else
--- 125,149 ----
  		    bit = SCRLEFT(bit,1);
  		    if (e >= 0)
  		    {
! 			*MAPW(addrb) = tmp;
! 			addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  			e += e3;
  			if (!bit)
  			{
  			    bit = rightbit;
! 			    addrb -= 4; CHECKRWU(addrb);
  			}
! 			tmp = *MAPR(addrb);
  		    }
  		    else if (!bit)
   		    {
! 			*MAPW(addrb) = tmp;
  			bit = rightbit;
! 			addrb -= 4; CHECKRWU(addrb);
! 			tmp = *MAPR(addrb);
  		    }
  		}
! 		*MAPW(addrb) = tmp;
  	    }
          } /* if X_AXIS */
          else
***************
*** 138,152 ****
  	    {
  		while(len--)
  		{
! 		    *(unsigned long *)addrb &= ~bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRRIGHT(bit,1);
! 			if (!bit) { bit = leftbit;addrb += 4; }
  			e += e3;
  		    }
! 		    addrb += yinc;
  		}
  	    }
  	    else
--- 152,166 ----
  	    {
  		while(len--)
  		{
! 		    *MAPRW(addrb) &= ~bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRRIGHT(bit,1);
! 			if (!bit) { bit = leftbit;addrb += 4; CHECKRWO(addrb); }
  			e += e3;
  		    }
! 		    addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  		}
  	    }
  	    else
***************
*** 153,167 ****
  	    {
  		while(len--)
  		{
! 		    *(unsigned long *)addrb &= ~bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRLEFT(bit,1);
! 			if (!bit) { bit = rightbit;addrb -= 4; }
  			e += e3;
  		    }
! 		    addrb += yinc;
  		}
  	    }
          } /* else Y_AXIS */
--- 167,181 ----
  	    {
  		while(len--)
  		{
! 		    *MAPRW(addrb) &= ~bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRLEFT(bit,1);
! 			if (!bit) { bit = rightbit;addrb -= 4; CHECKRWU(addrb);}
  			e += e3;
  		    }
! 		    addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  		}
  	    }
          } /* else Y_AXIS */
***************
*** 172,178 ****
          {
  	    if (signdx > 0)
  	    {
! 		tmp = *(unsigned long *)addrb;
  		for (;;)
  		{
  		    tmp |= bit;
--- 186,192 ----
          {
  	    if (signdx > 0)
  	    {
! 		tmp = *MAPR(addrb);
  		for (;;)
  		{
  		    tmp |= bit;
***************
*** 182,210 ****
  		    bit = SCRRIGHT(bit,1);
  		    if (e >= 0)
  		    {
! 			*(unsigned long *) addrb = tmp;
! 			addrb += yinc;
  			e += e3;
  			if (!bit)
  			{
  			    bit = leftbit;
! 			    addrb += 4;
  			}
! 			tmp = *(unsigned long *) addrb;
  		    }
  		    else if (!bit)
   		    {
! 			*(unsigned long *) addrb = tmp;
  			bit = leftbit;
! 			addrb += 4;
! 			tmp = *(unsigned long *) addrb;
  		    }
  		}
! 		*(unsigned long *) addrb = tmp;
  	    }
  	    else
  	    {
! 		tmp = *(unsigned long *) addrb;
  		for (;;)
  		{
  		    tmp |= bit;
--- 196,224 ----
  		    bit = SCRRIGHT(bit,1);
  		    if (e >= 0)
  		    {
! 			*MAPW(addrb) = tmp;
! 			addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  			e += e3;
  			if (!bit)
  			{
  			    bit = leftbit;
! 			    addrb += 4; CHECKRWO(addrb);
  			}
! 			tmp = *MAPR(addrb);
  		    }
  		    else if (!bit)
   		    {
! 			*MAPW(addrb) = tmp;
  			bit = leftbit;
! 			addrb += 4; CHECKRWO(addrb);
! 			tmp = *MAPR(addrb);
  		    }
  		}
! 		*MAPW(addrb) = tmp;
  	    }
  	    else
  	    {
! 		tmp = *MAPR(addrb);
  		for (;;)
  		{
  		    tmp |= bit;
***************
*** 214,238 ****
  		    bit = SCRLEFT(bit,1);
  		    if (e >= 0)
  		    {
! 			*(unsigned long *) addrb = tmp;
! 			addrb += yinc;
  			e += e3;
  			if (!bit)
  			{
  			    bit = rightbit;
! 			    addrb -= 4;
  			}
! 			tmp = *(unsigned long *) addrb;
  		    }
  		    else if (!bit)
  		    {
! 			*(unsigned long *) addrb = tmp;
  			bit = rightbit;
! 			addrb -= 4;
! 			tmp = *(unsigned long *) addrb;
  		    }
  		}
! 		*(unsigned long *) addrb = tmp;
  	    }
          } /* if X_AXIS */
          else
--- 228,252 ----
  		    bit = SCRLEFT(bit,1);
  		    if (e >= 0)
  		    {
! 			*MAPW(addrb) = tmp;
! 			addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  			e += e3;
  			if (!bit)
  			{
  			    bit = rightbit;
! 			    addrb -= 4; CHECKRWU(addrb);
  			}
! 			tmp = *MAPR(addrb);
  		    }
  		    else if (!bit)
  		    {
! 			*MAPW(addrb) = tmp;
  			bit = rightbit;
! 			addrb -= 4; CHECKRWU(addrb);
! 			tmp = *MAPR(addrb);
  		    }
  		}
! 		*MAPW(addrb) = tmp;
  	    }
          } /* if X_AXIS */
          else
***************
*** 241,255 ****
  	    {
  		while(len--)
  		{
! 		    *(unsigned long *)addrb |= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRRIGHT(bit,1);
! 			if (!bit) { bit = leftbit;addrb += 4; }
  			e += e3;
  		    }
! 		    addrb += yinc;
  		}
  	    }
  	    else
--- 255,269 ----
  	    {
  		while(len--)
  		{
! 		    *MAPRW(addrb) |= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRRIGHT(bit,1);
! 			if (!bit) { bit = leftbit;addrb += 4; CHECKRWO(addrb); }
  			e += e3;
  		    }
! 		    addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  		}
  	    }
  	    else
***************
*** 256,270 ****
  	    {
  		while(len--)
  		{
! 		    *(unsigned long *)addrb |= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRLEFT(bit,1);
! 			if (!bit) { bit = rightbit;addrb -= 4; }
  			e += e3;
  		    }
! 		    addrb += yinc;
  		}
  	    }
          } /* else Y_AXIS */
--- 270,284 ----
  	    {
  		while(len--)
  		{
! 		    *MAPRW(addrb) |= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRLEFT(bit,1);
! 			if (!bit) { bit = rightbit;addrb -= 4; CHECKRWU(addrb);}
  			e += e3;
  		    }
! 		    addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  		}
  	    }
          } /* else Y_AXIS */
***************
*** 277,291 ****
  	    {
  		while(len--)
  		{
! 		    *(unsigned long *)addrb ^= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
! 			addrb += yinc;
  			e += e3;
  		    }
  		    bit = SCRRIGHT(bit,1);
! 		    if (!bit) { bit = leftbit;addrb += 4; }
  		}
  	    }
  	    else
--- 291,305 ----
  	    {
  		while(len--)
  		{
! 		    *MAPRW(addrb) ^= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
! 			addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  			e += e3;
  		    }
  		    bit = SCRRIGHT(bit,1);
! 		    if (!bit) { bit = leftbit;addrb += 4; CHECKRWO(addrb); }
  		}
  	    }
  	    else
***************
*** 292,306 ****
  	    {
  		while(len--)
  		{
! 		    *(unsigned long *)addrb ^= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
! 			addrb += yinc;
  			e += e3;
  		    }
  		    bit = SCRLEFT(bit,1);
! 		    if (!bit) { bit = rightbit;addrb -= 4; }
  		}
  	    }
          } /* if X_AXIS */
--- 306,320 ----
  	    {
  		while(len--)
  		{
! 		    *MAPRW(addrb) ^= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
! 			addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  			e += e3;
  		    }
  		    bit = SCRLEFT(bit,1);
! 		    if (!bit) { bit = rightbit;addrb -= 4; CHECKRWU(addrb); }
  		}
  	    }
          } /* if X_AXIS */
***************
*** 310,324 ****
  	    {
  		while(len--)
  		{
! 		    *(unsigned long *)addrb ^= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRRIGHT(bit,1);
! 			if (!bit) { bit = leftbit;addrb += 4; }
  			e += e3;
  		    }
! 		    addrb += yinc;
  		}
  	    }
  	    else
--- 324,338 ----
  	    {
  		while(len--)
  		{
! 		    *MAPRW(addrb) ^= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRRIGHT(bit,1);
! 			if (!bit) { bit = leftbit;addrb += 4; CHECKRWO(addrb); }
  			e += e3;
  		    }
! 		    addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  		}
  	    }
  	    else
***************
*** 325,339 ****
  	    {
  		while(len--)
  		{
! 		    *(unsigned long *)addrb ^= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRLEFT(bit,1);
! 			if (!bit) { bit = rightbit;addrb -= 4; }
  			e += e3;
  		    }
! 		    addrb += yinc;
  		}
  	    }
          } /* else Y_AXIS */
--- 339,353 ----
  	    {
  		while(len--)
  		{
! 		    *MAPRW(addrb) ^= bit;
  		    e += e1;
  		    if (e >= 0)
  		    {
  			bit = SCRLEFT(bit,1);
! 			if (!bit) { bit = rightbit;addrb -= 4; CHECKRWU(addrb);}
  			e += e3;
  		    }
! 		    addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  		}
  	    }
          } /* else Y_AXIS */
diff -c mit/server/ddx/mfb/mfbbresd.c:1.1.1.1 mit/server/ddx/mfb/mfbbresd.c:1.4
*** mit/server/ddx/mfb/mfbbresd.c:1.1.1.1	Sat Mar 12 00:35:45 1994
--- mit/server/ddx/mfb/mfbbresd.c	Sat Mar 12 00:35:45 1994
***************
*** 21,27 ****
--- 21,29 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbbresd.c,v 1.4 1993/03/27 09:00:38 dawes Exp $ */
  /* $XConsortium: mfbbresd.c,v 1.3 89/11/08 17:12:27 keith Exp $ */
+ #define BANKING_MODS
  #include "X.h"
  #include "misc.h"
  #include "mfb.h"
***************
*** 69,75 ****
--- 71,82 ----
      int dashOffset;
      int dashRemaining;
      int	rop;
+ #ifdef BANKED_MFB
+     unsigned char Oflag, Uflag;
+ #endif
  
+     BANK_FLAG(addrl);
+ 
      dashOffset = *pdashOffset;
      dashIndex = *pdashIndex;
      dashRemaining = pDash[dashIndex] - dashOffset;
***************
*** 81,87 ****
--- 88,99 ----
  
      /* point to longword containing first point */
      addrb = (unsigned char *)(addrl + (y1 * nlwidth) + (x1 >> 5));
+     SETRW(addrb);
      yinc = signdy * nlwidth * 4;                /* 4 == sizeof(int) */
+ #ifdef BANKED_MFB
+     Oflag = vgaWriteFlag && (yinc > 0);
+     Uflag = vgaWriteFlag && (yinc < 0);
+ #endif
      e = e-e1;			/* to make looping easier */
      bit = mask[x1 & 31];
      if (axis == X_AXIS)
***************
*** 91,109 ****
  	    while(len--)
  	    { 
  		if (rop == RROP_BLACK)
! 		    *(unsigned long *)addrb &= ~bit;
  		else if (rop == RROP_WHITE)
! 		    *(unsigned long *)addrb |= bit;
  		else if (rop == RROP_INVERT)
! 		    *(unsigned long *)addrb ^= bit;
  		e += e1;
  		if (e >= 0)
  		{
! 		    addrb += yinc;
  		    e += e3;
  		}
  		bit = SCRRIGHT(bit,1);
! 		if (!bit) { bit = leftbit;addrb += 4; }
  		StepDash
  	    }
  	}
--- 103,121 ----
  	    while(len--)
  	    { 
  		if (rop == RROP_BLACK)
! 		    *MAPRW(addrb) &= ~bit;
  		else if (rop == RROP_WHITE)
! 		    *MAPRW(addrb) |= bit;
  		else if (rop == RROP_INVERT)
! 		    *MAPRW(addrb) ^= bit;
  		e += e1;
  		if (e >= 0)
  		{
! 		    addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  		    e += e3;
  		}
  		bit = SCRRIGHT(bit,1);
! 		if (!bit) { bit = leftbit;addrb += 4; CHECKRWO(addrb); }
  		StepDash
  	    }
  	}
***************
*** 112,130 ****
  	    while(len--)
  	    { 
  		if (rop == RROP_BLACK)
! 		    *(unsigned long *)addrb &= ~bit;
  		else if (rop == RROP_WHITE)
! 		    *(unsigned long *)addrb |= bit;
  		else if (rop == RROP_INVERT)
! 		    *(unsigned long *)addrb ^= bit;
  		e += e1;
  		if (e >= 0)
  		{
! 		    addrb += yinc;
  		    e += e3;
  		}
  		bit = SCRLEFT(bit,1);
! 		if (!bit) { bit = rightbit;addrb -= 4; }
  		StepDash
  	    }
  	}
--- 124,142 ----
  	    while(len--)
  	    { 
  		if (rop == RROP_BLACK)
! 		    *MAPRW(addrb) &= ~bit;
  		else if (rop == RROP_WHITE)
! 		    *MAPRW(addrb) |= bit;
  		else if (rop == RROP_INVERT)
! 		    *MAPRW(addrb) ^= bit;
  		e += e1;
  		if (e >= 0)
  		{
! 		    addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  		    e += e3;
  		}
  		bit = SCRLEFT(bit,1);
! 		if (!bit) { bit = rightbit;addrb -= 4; CHECKRWU(addrb); }
  		StepDash
  	    }
  	}
***************
*** 136,154 ****
  	    while(len--)
  	    {
  		if (rop == RROP_BLACK)
! 		    *(unsigned long *)addrb &= ~bit;
  		else if (rop == RROP_WHITE)
! 		    *(unsigned long *)addrb |= bit;
  		else if (rop == RROP_INVERT)
! 		    *(unsigned long *)addrb ^= bit;
  		e += e1;
  		if (e >= 0)
  		{
  		    bit = SCRRIGHT(bit,1);
! 		    if (!bit) { bit = leftbit;addrb += 4; }
  		    e += e3;
  		}
! 		addrb += yinc;
  		StepDash
  	    }
  	}
--- 148,166 ----
  	    while(len--)
  	    {
  		if (rop == RROP_BLACK)
! 		    *MAPRW(addrb) &= ~bit;
  		else if (rop == RROP_WHITE)
! 		    *MAPRW(addrb) |= bit;
  		else if (rop == RROP_INVERT)
! 		    *MAPRW(addrb) ^= bit;
  		e += e1;
  		if (e >= 0)
  		{
  		    bit = SCRRIGHT(bit,1);
! 		    if (!bit) { bit = leftbit;addrb += 4; CHECKRWO(addrb); }
  		    e += e3;
  		}
! 		addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  		StepDash
  	    }
  	}
***************
*** 157,175 ****
  	    while(len--)
  	    {
  		if (rop == RROP_BLACK)
! 		    *(unsigned long *)addrb &= ~bit;
  		else if (rop == RROP_WHITE)
! 		    *(unsigned long *)addrb |= bit;
  		else if (rop == RROP_INVERT)
! 		    *(unsigned long *)addrb ^= bit;
  		e += e1;
  		if (e >= 0)
  		{
  		    bit = SCRLEFT(bit,1);
! 		    if (!bit) { bit = rightbit;addrb -= 4; }
  		    e += e3;
  		}
! 		addrb += yinc;
  		StepDash
  	    }
  	}
--- 169,187 ----
  	    while(len--)
  	    {
  		if (rop == RROP_BLACK)
! 		    *MAPRW(addrb) &= ~bit;
  		else if (rop == RROP_WHITE)
! 		    *MAPRW(addrb) |= bit;
  		else if (rop == RROP_INVERT)
! 		    *MAPRW(addrb) ^= bit;
  		e += e1;
  		if (e >= 0)
  		{
  		    bit = SCRLEFT(bit,1);
! 		    if (!bit) { bit = rightbit;addrb -= 4; CHECKRWU(addrb); }
  		    e += e3;
  		}
! 		addrb += yinc; CHECKRWD(Oflag, Uflag, addrb);
  		StepDash
  	    }
  	}
diff -c mit/server/ddx/mfb/mfbclip.c:1.1.1.1 mit/server/ddx/mfb/mfbclip.c:1.3
*** mit/server/ddx/mfb/mfbclip.c:1.1.1.1	Sat Mar 12 00:35:46 1994
--- mit/server/ddx/mfb/mfbclip.c	Sat Mar 12 00:35:46 1994
***************
*** 21,28 ****
--- 21,30 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbclip.c,v 1.3 1993/03/27 09:00:40 dawes Exp $ */
  /* $XConsortium: mfbclip.c,v 5.2 89/11/30 14:21:50 keith Exp $ */
  #include "X.h"
+ #include "mfb.h"
  #include "miscstruct.h"
  #include "pixmapstr.h"
  #include "scrnintstr.h"
diff -c mit/server/ddx/mfb/mfbcmap.c:1.1.1.1 mit/server/ddx/mfb/mfbcmap.c:1.2
*** mit/server/ddx/mfb/mfbcmap.c:1.1.1.1	Sat Mar 12 00:35:46 1994
--- mit/server/ddx/mfb/mfbcmap.c	Sat Mar 12 00:35:46 1994
***************
*** 23,28 ****
--- 23,29 ----
  ******************************************************************/
  /* $XConsortium: mfbcmap.c,v 5.3 89/07/19 15:48:00 rws Exp $ */
  #include "X.h"
+ #include "mfb.h"
  #include "scrnintstr.h"
  #include "colormapst.h"
  #include "resource.h"
diff -c /dev/null mit/server/ddx/mfb/mfbcustom.h:1.5
*** /dev/null	Sat Mar 12 00:35:46 1994
--- mit/server/ddx/mfb/mfbcustom.h	Sat Mar 12 00:35:46 1994
***************
*** 0 ****
--- 1,38 ----
+ /* $XFree86: mit/server/ddx/mfb/mfbcustom.h,v 1.5 1993/03/27 09:00:41 dawes Exp $ */
+ 
+ /*
+  * This file customizes the monochrome frame bufer library.
+  * This will be the same old mfb as we know from mit distribution.
+  */
+ 
+ #define MAPRW(p) ((unsigned int*)(p))
+ #define MAPR(p)  MAPRW(p)
+ #define MAPW(p)  MAPRW(p)
+ 
+ /* Some dummy defines for bank-related stuff */
+ #define CHECKSCREEN(x)		FALSE
+ #define SETRWF(f,x)		/**/
+ #define CHECKRWOF(f,x)		/**/
+ #define CHECKRWUF(f,x)		/**/
+ #define BANK_FLAG(a)		/**/
+ #define BANK_FLAG_BOTH(a,b)	/**/
+ #define SETR(a)			/**/
+ #define SETW(a)			/**/
+ #define SETRW(a)		/**/
+ #define CHECKRO(a)		/**/
+ #define CHECKWO(a)		/**/
+ #define CHECKRWO(a)		/**/
+ #define CHECKRU(a)		/**/
+ #define CHECKWU(a)		/**/
+ #define CHECKRWU(a)		/**/
+ #define NEXTR(a)		/**/
+ #define NEXTW(a)		/**/
+ #define PREVR(a)		/**/
+ #define PREVW(a)		/**/
+ #define SAVE_BANK()		/**/
+ #define RESTORE_BANK()		/**/
+ #define PUSHR()			/**/
+ #define POPR()			/**/
+ #define CHECKRWONEXT(a)		/**/
+ #define CHECKRWD(a,b,c)		/**/
+ 
diff -c mit/server/ddx/mfb/mfbfillarc.c:1.1.1.1 mit/server/ddx/mfb/mfbfillarc.c:1.4
*** mit/server/ddx/mfb/mfbfillarc.c:1.1.1.1	Sat Mar 12 00:35:47 1994
--- mit/server/ddx/mfb/mfbfillarc.c	Sat Mar 12 00:35:47 1994
***************
*** 15,22 ****
--- 15,24 ----
  
  ********************************************************/
  
+ /* $XFree86: mit/server/ddx/mfb/mfbfillarc.c,v 1.4 1993/03/27 09:00:43 dawes Exp $ */
  /* $XConsortium: mfbfillarc.c,v 5.7 90/10/06 13:58:08 rws Exp $ */
  
+ #define BANKING_MODS
  #include "X.h"
  #include "Xprotostr.h"
  #include "miscstruct.h"
***************
*** 58,63 ****
--- 60,68 ----
  	addrlt = (int *)(((PixmapPtr)pDraw)->devPrivate.ptr);
  	nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
      }
+ 
+     BANK_FLAG(addrlt)
+ 
      miFillArcSetup(arc, &info);
      MIFILLARCSETUP();
      xorg += pDraw->x;
***************
*** 74,97 ****
  	    continue;
  	xpos = xorg - x;
  	addrl = addrlt + (xpos >> 5);
  	if (((xpos & 0x1f) + slw) < 32)
  	{
  	    maskpartialbits(xpos, slw, startmask);
  	    if (rop == RROP_BLACK)
! 		*addrl &= ~startmask;
  	    else if (rop == RROP_WHITE)
! 		*addrl |= startmask;
  	    else
! 		*addrl ^= startmask;
  	    if (miFillArcLower(slw))
  	    {
  		addrl = addrlb + (xpos >> 5);
  		if (rop == RROP_BLACK)
! 		    *addrl &= ~startmask;
  		else if (rop == RROP_WHITE)
! 		    *addrl |= startmask;
  		else
! 		    *addrl ^= startmask;
  	    }
  	    continue;
  	}
--- 79,104 ----
  	    continue;
  	xpos = xorg - x;
  	addrl = addrlt + (xpos >> 5);
+ 	SETRW(addrl);
  	if (((xpos & 0x1f) + slw) < 32)
  	{
  	    maskpartialbits(xpos, slw, startmask);
  	    if (rop == RROP_BLACK)
! 		*MAPRW(addrl) &= ~startmask;
  	    else if (rop == RROP_WHITE)
! 		*MAPRW(addrl) |= startmask;
  	    else
! 		*MAPRW(addrl) ^= startmask;
  	    if (miFillArcLower(slw))
  	    {
  		addrl = addrlb + (xpos >> 5);
+ 		SETRW(addrl);
  		if (rop == RROP_BLACK)
! 		    *MAPRW(addrl) &= ~startmask;
  		else if (rop == RROP_WHITE)
! 		    *MAPRW(addrl) |= startmask;
  		else
! 		    *MAPRW(addrl) ^= startmask;
  	    }
  	    continue;
  	}
***************
*** 98,159 ****
  	maskbits(xpos, slw, startmask, endmask, nlmiddle);
  	if (startmask)
  	{
! 	    if (rop == RROP_BLACK)
! 		*addrl++ &= ~startmask;
! 	    else if (rop == RROP_WHITE)
! 		*addrl++ |= startmask;
! 	    else
! 		*addrl++ ^= startmask;
  	}
  	n = nlmiddle;
  	if (rop == RROP_BLACK)
! 	    while (n--)
! 		*addrl++ = 0;
  	else if (rop == RROP_WHITE)
! 	    while (n--)
! 		*addrl++ = ~0;
  	else
! 	    while (n--)
! 		*addrl++ ^= ~0;
  	if (endmask)
  	{
  	    if (rop == RROP_BLACK)
! 		*addrl &= ~endmask;
  	    else if (rop == RROP_WHITE)
! 		*addrl |= endmask;
  	    else
! 		*addrl ^= endmask;
  	}
  	if (!miFillArcLower(slw))
  	    continue;
  	addrl = addrlb + (xpos >> 5);
  	if (startmask)
  	{
! 	    if (rop == RROP_BLACK)
! 		*addrl++ &= ~startmask;
! 	    else if (rop == RROP_WHITE)
! 		*addrl++ |= startmask;
! 	    else
! 		*addrl++ ^= startmask;
  	}
  	n = nlmiddle;
  	if (rop == RROP_BLACK)
! 	    while (n--)
! 		*addrl++ = 0;
  	else if (rop == RROP_WHITE)
! 	    while (n--)
! 		*addrl++ = ~0;
  	else
! 	    while (n--)
! 		*addrl++ ^= ~0;
  	if (endmask)
  	{
  	    if (rop == RROP_BLACK)
! 		*addrl &= ~endmask;
  	    else if (rop == RROP_WHITE)
! 		*addrl |= endmask;
  	    else
! 		*addrl ^= endmask;
  	}
      }
  }
--- 105,175 ----
  	maskbits(xpos, slw, startmask, endmask, nlmiddle);
  	if (startmask)
  	{
! 	    if (rop == RROP_BLACK) {
! 		*MAPRW(addrl) &= ~startmask; addrl++; CHECKRWO(addrl);
! 	    } else if (rop == RROP_WHITE) {
! 		*MAPRW(addrl) |= startmask; addrl++; CHECKRWO(addrl);
! 	    } else {
! 		*MAPRW(addrl) ^= startmask; addrl++; CHECKRWO(addrl);
! 	    }
  	}
  	n = nlmiddle;
  	if (rop == RROP_BLACK)
! 	    while (n--) {
! 		*MAPW(addrl) = 0; addrl++; CHECKRWO(addrl);
! 	    }
  	else if (rop == RROP_WHITE)
! 	    while (n--) {
! 		*MAPW(addrl) = ~0; addrl++; CHECKRWO(addrl);
! 	    }
  	else
! 	    while (n--) {
! 		*MAPRW(addrl) ^= ~0; addrl++; CHECKRWO(addrl);
! 	    }
  	if (endmask)
  	{
  	    if (rop == RROP_BLACK)
! 		*MAPRW(addrl) &= ~endmask;
  	    else if (rop == RROP_WHITE)
! 		*MAPRW(addrl) |= endmask;
  	    else
! 		*MAPRW(addrl) ^= endmask;
  	}
  	if (!miFillArcLower(slw))
  	    continue;
  	addrl = addrlb + (xpos >> 5);
+ 	SETRW(addrl);
  	if (startmask)
  	{
! 	    if (rop == RROP_BLACK) {
! 		*MAPRW(addrl) &= ~startmask; addrl++; CHECKRWO(addrl);
! 	    } else if (rop == RROP_WHITE) {
! 		*MAPRW(addrl) |= startmask; addrl++; CHECKRWO(addrl);
! 	    } else {
! 		*MAPRW(addrl) ^= startmask; addrl++; CHECKRWO(addrl);
! 	    }
  	}
  	n = nlmiddle;
  	if (rop == RROP_BLACK)
! 	    while (n--) {
! 		*MAPW(addrl) = 0; addrl++; CHECKRWO(addrl);
! 	    }
  	else if (rop == RROP_WHITE)
! 	    while (n--) {
! 		*MAPW(addrl) = ~0; addrl++; CHECKRWO(addrl);
! 	    }
  	else
! 	    while (n--) {
! 		*MAPRW(addrl) ^= ~0; addrl++; CHECKRWO(addrl);
! 	    }
  	if (endmask)
  	{
  	    if (rop == RROP_BLACK)
! 		*MAPRW(addrl) &= ~endmask;
  	    else if (rop == RROP_WHITE)
! 		*MAPRW(addrl) |= endmask;
  	    else
! 		*MAPRW(addrl) ^= endmask;
  	}
      }
  }
***************
*** 163,177 ****
      { \
  	width = xr - xl + 1; \
  	addrl = addr + (xl >> 5); \
  	if (((xl & 0x1f) + width) < 32) \
  	{ \
  	    maskpartialbits(xl, width, startmask); \
  	    if (rop == RROP_BLACK) \
! 		*addrl &= ~startmask; \
  	    else if (rop == RROP_WHITE) \
! 		*addrl |= startmask; \
  	    else \
! 		*addrl ^= startmask; \
  	} \
  	else \
  	{ \
--- 179,194 ----
      { \
  	width = xr - xl + 1; \
  	addrl = addr + (xl >> 5); \
+ 	SETRW(addrl); \
  	if (((xl & 0x1f) + width) < 32) \
  	{ \
  	    maskpartialbits(xl, width, startmask); \
  	    if (rop == RROP_BLACK) \
! 		*MAPRW(addrl) &= ~startmask; \
  	    else if (rop == RROP_WHITE) \
! 		*MAPRW(addrl) |= startmask; \
  	    else \
! 		*MAPRW(addrl) ^= startmask; \
  	} \
  	else \
  	{ \
***************
*** 178,208 ****
  	    maskbits(xl, width, startmask, endmask, nlmiddle); \
  	    if (startmask) \
  	    { \
! 		if (rop == RROP_BLACK) \
! 		    *addrl++ &= ~startmask; \
! 		else if (rop == RROP_WHITE) \
! 		    *addrl++ |= startmask; \
! 		else \
! 		    *addrl++ ^= startmask; \
  	    } \
  	    n = nlmiddle; \
  	    if (rop == RROP_BLACK) \
! 		while (n--) \
! 		    *addrl++ = 0; \
  	    else if (rop == RROP_WHITE) \
! 		while (n--) \
! 		    *addrl++ = ~0; \
  	    else \
! 		while (n--) \
! 		    *addrl++ ^= ~0; \
  	    if (endmask) \
  	    { \
  		if (rop == RROP_BLACK) \
! 		    *addrl &= ~endmask; \
  		else if (rop == RROP_WHITE) \
! 		    *addrl |= endmask; \
  		else \
! 		    *addrl ^= endmask; \
  	    } \
  	} \
      }
--- 195,229 ----
  	    maskbits(xl, width, startmask, endmask, nlmiddle); \
  	    if (startmask) \
  	    { \
! 		if (rop == RROP_BLACK) { \
! 		    *MAPRW(addrl) &= ~startmask; addrl++; CHECKRWO(addrl);\
! 		} else if (rop == RROP_WHITE) { \
! 		    *MAPRW(addrl) |= startmask; addrl++; CHECKRWO(addrl);\
! 		} else { \
! 		    *MAPRW(addrl) ^= startmask; addrl++; CHECKRWO(addrl);\
! 		} \
  	    } \
  	    n = nlmiddle; \
  	    if (rop == RROP_BLACK) \
! 		while (n--) { \
! 		    *MAPW(addrl) = 0; addrl++; CHECKRWO(addrl);\
! 		    } \
  	    else if (rop == RROP_WHITE) \
! 		while (n--) { \
! 		    *MAPW(addrl) = ~0; addrl++; CHECKRWO(addrl);\
! 		    } \
  	    else \
! 		while (n--) { \
! 		    *MAPRW(addrl) ^= ~0; addrl++; CHECKRWO(addrl);\
! 		    } \
  	    if (endmask) \
  	    { \
  		if (rop == RROP_BLACK) \
! 		    *MAPRW(addrl) &= ~endmask; \
  		else if (rop == RROP_WHITE) \
! 		    *MAPRW(addrl) |= endmask; \
  		else \
! 		    *MAPRW(addrl) ^= endmask; \
  	    } \
  	} \
      }
***************
*** 251,256 ****
--- 272,280 ----
  	addrlt = (int *)(((PixmapPtr)pDraw)->devPrivate.ptr);
  	nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
      }
+ 
+     BANK_FLAG(addrlt)
+ 
      miFillArcSetup(arc, &info);
      miFillArcSliceSetup(arc, &slice, pGC);
      MIFILLARCSETUP();
diff -c mit/server/ddx/mfb/mfbfillsp.c:1.1.1.1 mit/server/ddx/mfb/mfbfillsp.c:1.6
*** mit/server/ddx/mfb/mfbfillsp.c:1.1.1.1	Sat Mar 12 00:35:48 1994
--- mit/server/ddx/mfb/mfbfillsp.c	Sat Mar 12 00:35:48 1994
***************
*** 22,28 ****
--- 22,30 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbfillsp.c,v 1.6 1993/03/27 09:00:45 dawes Exp $ */
  /* $XConsortium: mfbfillsp.c,v 5.7 90/05/15 18:38:15 keith Exp $ */
+ #define BANKING_MODS
  #include "X.h"
  #include "Xmd.h"
  #include "gcstruct.h"
***************
*** 37,42 ****
--- 39,49 ----
  
  #include "servermd.h"
  
+ #if (BITMAP_SCANLINE_UNIT < 32)
+ #undef BITMAP_SCANLINE_UNIT
+ #define BITMAP_SCANLINE_UNIT 32
+ #endif
+ 
  /* scanline filling for monochrome frame buffer
     written by drewry, oct 1986
  
***************
*** 109,117 ****
--- 116,127 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrlBase)
+ 
      while (n--)
      {
          addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
+         SETRW(addrl);
  
  	if (*pwidth)
  	{
***************
*** 119,134 ****
  	    {
  		/* all bits inside same longword */
  		maskpartialbits(ppt->x, *pwidth, startmask);
! 		    *addrl &= ~startmask;
  	    }
  	    else
  	    {
  		maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 		if (startmask)
! 		    *addrl++ &= ~startmask;
! 		Duff (nlmiddle, *addrl++ = 0x0);
  		if (endmask)
! 		    *addrl &= ~endmask;
  	    }
  	}
  	pwidth++;
--- 129,145 ----
  	    {
  		/* all bits inside same longword */
  		maskpartialbits(ppt->x, *pwidth, startmask);
! 		    *MAPRW(addrl) &= ~startmask;
  	    }
  	    else
  	    {
  		maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 		if (startmask) {
! 		    *MAPRW(addrl) &= ~startmask; addrl++; CHECKRWO(addrl);
! 		  }
! 		Duff (nlmiddle, *MAPW(addrl) = 0x0; addrl++; CHECKRWO(addrl));
  		if (endmask)
! 		    *MAPRW(addrl) &= ~endmask;
  	    }
  	}
  	pwidth++;
***************
*** 192,200 ****
--- 203,214 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrlBase)
+ 
      while (n--)
      {
          addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
+         SETRW(addrl);
  
  	if (*pwidth)
  	{
***************
*** 202,217 ****
  	    {
  		/* all bits inside same longword */
  		maskpartialbits(ppt->x, *pwidth, startmask);
! 		*addrl |= startmask;
  	    }
  	    else
  	    {
  		maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 		if (startmask)
! 		    *addrl++ |= startmask;
! 		Duff (nlmiddle, *addrl++ = 0xffffffff);
  		if (endmask)
! 		    *addrl |= endmask;
  	    }
  	}
  	pwidth++;
--- 216,233 ----
  	    {
  		/* all bits inside same longword */
  		maskpartialbits(ppt->x, *pwidth, startmask);
! 		*MAPRW(addrl) |= startmask;
  	    }
  	    else
  	    {
  		maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 		if (startmask) {
! 		    *MAPRW(addrl) |= startmask; addrl++; CHECKRWO(addrl);
! 		  }
! 		Duff (nlmiddle,
!                       *MAPW(addrl) = 0xffffffff; addrl++;CHECKRWO(addrl));
  		if (endmask)
! 		    *MAPRW(addrl) |= endmask;
  	    }
  	}
  	pwidth++;
***************
*** 275,283 ****
--- 291,302 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrlBase)
+ 
      while (n--)
      {
          addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
+         SETRW(addrl);
  
  	if (*pwidth)
  	{
***************
*** 285,300 ****
  	    {
  		/* all bits inside same longword */
  		maskpartialbits(ppt->x, *pwidth, startmask);
! 		*addrl ^= startmask;
  	    }
  	    else
  	    {
  		maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 		if (startmask)
! 		    *addrl++ ^= startmask;
! 		Duff (nlmiddle, *addrl++ ^= 0xffffffff);
  		if (endmask)
! 		    *addrl ^= endmask;
  	    }
  	}
  	pwidth++;
--- 304,321 ----
  	    {
  		/* all bits inside same longword */
  		maskpartialbits(ppt->x, *pwidth, startmask);
! 		*MAPRW(addrl) ^= startmask;
  	    }
  	    else
  	    {
  		maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 		if (startmask) {
! 		    *MAPRW(addrl) ^= startmask; addrl++; CHECKRWO(addrl);
! 		}
! 		Duff (nlmiddle,
!                       *MAPRW(addrl) ^= 0xffffffff; addrl++; CHECKRWO(addrl));
  		if (endmask)
! 		    *MAPRW(addrl) ^= endmask;
  	    }
  	}
  	pwidth++;
***************
*** 362,367 ****
--- 383,390 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrlBase)
+ 
      pStipple = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pRotatedPixmap;
      tileHeight = pStipple->drawable.height;
      psrc = (int *)(pStipple->devPrivate.ptr);
***************
*** 369,374 ****
--- 392,398 ----
      while (n--)
      {
          addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
+         SETRW(addrl);
  	src = psrc[ppt->y % tileHeight];
  
          /* all bits inside same longword */
***************
*** 375,390 ****
          if ( ((ppt->x & 0x1f) + *pwidth) < 32)
          {
  	    maskpartialbits(ppt->x, *pwidth, startmask);
! 	    *addrl |= (src & startmask);
          }
          else
          {
  	    maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 	    if (startmask)
! 		*addrl++ |= (src & startmask);
! 	    Duff (nlmiddle, *addrl++ |= src);
  	    if (endmask)
! 		*addrl |= (src & endmask);
          }
  	pwidth++;
  	ppt++;
--- 399,415 ----
          if ( ((ppt->x & 0x1f) + *pwidth) < 32)
          {
  	    maskpartialbits(ppt->x, *pwidth, startmask);
! 	    *MAPRW(addrl) |= (src & startmask);
          }
          else
          {
  	    maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 	    if (startmask) {
! 		*MAPRW(addrl) |= (src & startmask); addrl++; CHECKRWO(addrl);
! 	      }
! 	    Duff (nlmiddle, *MAPRW(addrl) |= src; addrl++; CHECKRWO(addrl));
  	    if (endmask)
! 		*MAPRW(addrl) |= (src & endmask);
          }
  	pwidth++;
  	ppt++;
***************
*** 451,456 ****
--- 476,483 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrlBase)
+ 
      pStipple = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pRotatedPixmap;
      tileHeight = pStipple->drawable.height;
      psrc = (int *)(pStipple->devPrivate.ptr);
***************
*** 458,463 ****
--- 485,491 ----
      while (n--)
      {
          addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
+         SETRW(addrl);
  	src = psrc[ppt->y % tileHeight];
  
          /* all bits inside same longword */
***************
*** 464,479 ****
          if ( ((ppt->x & 0x1f) + *pwidth) < 32)
          {
  	    maskpartialbits(ppt->x, *pwidth, startmask);
! 	    *addrl &= ~(src & startmask);
          }
          else
          {
  	    maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 	    if (startmask)
! 		*addrl++ &= ~(src & startmask);
! 	    Duff (nlmiddle, *addrl++ &= ~src);
  	    if (endmask)
! 		*addrl &= ~(src & endmask);
          }
  	pwidth++;
  	ppt++;
--- 492,508 ----
          if ( ((ppt->x & 0x1f) + *pwidth) < 32)
          {
  	    maskpartialbits(ppt->x, *pwidth, startmask);
! 	    *MAPRW(addrl) &= ~(src & startmask);
          }
          else
          {
  	    maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 	    if (startmask) {
! 		*MAPRW(addrl) &= ~(src & startmask); addrl++; CHECKRWO(addrl);
! 	      }
! 	    Duff (nlmiddle, *MAPRW(addrl) &= ~src; addrl++; CHECKRWO(addrl));
  	    if (endmask)
! 		*MAPRW(addrl) &= ~(src & endmask);
          }
  	pwidth++;
  	ppt++;
***************
*** 540,545 ****
--- 569,576 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrlBase)
+ 
      pStipple = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pRotatedPixmap;
      tileHeight = pStipple->drawable.height;
      psrc = (int *)(pStipple->devPrivate.ptr);
***************
*** 547,552 ****
--- 578,584 ----
      while (n--)
      {
          addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
+         SETRW(addrl);
  	src = psrc[ppt->y % tileHeight];
  
          /* all bits inside same longword */
***************
*** 553,568 ****
          if ( ((ppt->x & 0x1f) + *pwidth) < 32)
          {
  	    maskpartialbits(ppt->x, *pwidth, startmask);
! 	    *addrl ^= (src & startmask);
          }
          else
          {
  	    maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 	    if (startmask)
! 		*addrl++ ^= (src & startmask);
! 	    Duff(nlmiddle, *addrl++ ^= src);
  	    if (endmask)
! 		*addrl ^= (src & endmask);
          }
  	pwidth++;
  	ppt++;
--- 585,601 ----
          if ( ((ppt->x & 0x1f) + *pwidth) < 32)
          {
  	    maskpartialbits(ppt->x, *pwidth, startmask);
! 	    *MAPRW(addrl) ^= (src & startmask);
          }
          else
          {
  	    maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
! 	    if (startmask) {
! 		*MAPRW(addrl) ^= (src & startmask); addrl++; CHECKRWO(addrl);
! 	      }
! 	    Duff(nlmiddle, *MAPRW(addrl) ^= src; addrl++; CHECKRWO(addrl));
  	    if (endmask)
! 		*MAPRW(addrl) ^= (src & endmask);
          }
  	pwidth++;
  	ppt++;
***************
*** 579,590 ****
  	if (*pwidth) \
  	{ \
              addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5); \
  	    src = psrc[ppt->y % tileHeight]; \
              if ( ((ppt->x & 0x1f) + *pwidth) < 32) \
              { \
  	        maskpartialbits(ppt->x, *pwidth, startmask); \
! 	        *addrl = (*addrl & ~startmask) | \
! 		         (ROP(src, *addrl) & startmask); \
              } \
              else \
              { \
--- 612,624 ----
  	if (*pwidth) \
  	{ \
              addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5); \
+             SETRW(addrl); \
  	    src = psrc[ppt->y % tileHeight]; \
              if ( ((ppt->x & 0x1f) + *pwidth) < 32) \
              { \
  	        maskpartialbits(ppt->x, *pwidth, startmask); \
! 	        *MAPW(addrl) = (*MAPR(addrl) & ~startmask) | \
! 		         (ROP(src, *MAPR(addrl)) & startmask); \
              } \
              else \
              { \
***************
*** 591,608 ****
  	        maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); \
  	        if (startmask) \
  	        { \
! 	            *addrl = (*addrl & ~startmask) | \
! 			     (ROP(src, *addrl) & startmask); \
! 		    addrl++; \
  	        } \
  	        while (nlmiddle--) \
  	        { \
! 		    *addrl = ROP(src, *addrl); \
! 		    addrl++; \
  	        } \
  	        if (endmask) \
! 	            *addrl = (*addrl & ~endmask) | \
! 			     (ROP(src, *addrl) & endmask); \
              } \
  	} \
  	pwidth++; \
--- 625,642 ----
  	        maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); \
  	        if (startmask) \
  	        { \
! 	            *MAPW(addrl) = (*MAPR(addrl) & ~startmask) | \
! 			     (ROP(src, *MAPR(addrl)) & startmask); \
! 		    addrl++; CHECKRWO(addrl); \
  	        } \
  	        while (nlmiddle--) \
  	        { \
! 		    *MAPW(addrl) = ROP(src, *MAPR(addrl)); \
! 		    addrl++; CHECKRWO(addrl); \
  	        } \
  	        if (endmask) \
! 	            *MAPW(addrl) = (*MAPR(addrl) & ~endmask) | \
! 			     (ROP(src, *MAPR(addrl)) & endmask); \
              } \
  	} \
  	pwidth++; \
***************
*** 670,675 ****
--- 704,711 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrlBase)
+ 
      pTile = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pRotatedPixmap;
      tileHeight = pTile->drawable.height;
      psrc = (int *)(pTile->devPrivate.ptr);
***************
*** 693,703 ****
  	    	if (*pwidth)
  	    	{
              	    addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
  	    	    src = psrc[ppt->y % tileHeight] ^ flip;
              	    if ( ((ppt->x & 0x1f) + *pwidth) < 32)
              	    {
  	            	maskpartialbits(ppt->x, *pwidth, startmask);
! 			*addrl = DoMaskCopyRop (src, *addrl, startmask);
              	    }
              	    else
              	    {
--- 729,740 ----
  	    	if (*pwidth)
  	    	{
              	    addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
+                     SETRW(addrl);
  	    	    src = psrc[ppt->y % tileHeight] ^ flip;
              	    if ( ((ppt->x & 0x1f) + *pwidth) < 32)
              	    {
  	            	maskpartialbits(ppt->x, *pwidth, startmask);
! 			*MAPW(addrl) = DoMaskCopyRop (src, *MAPR(addrl), startmask);
              	    }
              	    else
              	    {
***************
*** 704,719 ****
  	            	maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
  	            	if (startmask)
  	            	{
! 			    *addrl = DoMaskCopyRop (src, *addrl, startmask);
! 		    	    addrl++;
  	            	}
  	            	while (nlmiddle--)
  	            	{
! 			    *addrl = src;
! 		    	    addrl++;
  	            	}
  	            	if (endmask)
! 			    *addrl = DoMaskCopyRop (src, *addrl, endmask);
              	    }
  	    	}
  	    	pwidth++;
--- 741,756 ----
  	            	maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
  	            	if (startmask)
  	            	{
! 			    *MAPW(addrl) = DoMaskCopyRop (src, *MAPR(addrl), startmask);
! 		    	    addrl++; CHECKRWO(addrl);
  	            	}
  	            	while (nlmiddle--)
  	            	{
! 			    *MAPW(addrl) = src;
! 		    	    addrl++; CHECKRWO(addrl);
  	            	}
  	            	if (endmask)
! 			    *MAPW(addrl) = DoMaskCopyRop (src, *MAPR(addrl), endmask);
              	    }
  	    	}
  	    	pwidth++;
***************
*** 731,741 ****
  	    	if (*pwidth)
  	    	{
              	    addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
  	    	    src = psrc[ppt->y % tileHeight];
              	    if ( ((ppt->x & 0x1f) + *pwidth) < 32)
              	    {
  	            	maskpartialbits(ppt->x, *pwidth, startmask);
! 			*addrl = DoMaskMergeRop (src, *addrl, startmask);
              	    }
              	    else
              	    {
--- 768,779 ----
  	    	if (*pwidth)
  	    	{
              	    addrl = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
+                     SETRW(addrl);
  	    	    src = psrc[ppt->y % tileHeight];
              	    if ( ((ppt->x & 0x1f) + *pwidth) < 32)
              	    {
  	            	maskpartialbits(ppt->x, *pwidth, startmask);
! 			*MAPW(addrl) = DoMaskMergeRop (src, *MAPR(addrl), startmask);
              	    }
              	    else
              	    {
***************
*** 742,757 ****
  	            	maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
  	            	if (startmask)
  	            	{
! 			    *addrl = DoMaskMergeRop (src, *addrl, startmask);
! 		    	    addrl++;
  	            	}
  	            	while (nlmiddle--)
  	            	{
! 			    *addrl = DoMergeRop (src, *addrl);
! 		    	    addrl++;
  	            	}
  	            	if (endmask)
! 			    *addrl = DoMaskMergeRop (src, *addrl, endmask);
              	    }
  	    	}
  	    	pwidth++;
--- 780,795 ----
  	            	maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
  	            	if (startmask)
  	            	{
! 			    *MAPW(addrl) = DoMaskMergeRop (src, *MAPR(addrl), startmask);
! 		    	    addrl++; CHECKRWO(addrl);
  	            	}
  	            	while (nlmiddle--)
  	            	{
! 			    *MAPW(addrl) = DoMergeRop (src, *MAPR(addrl));
! 		    	    addrl++; CHECKRWO(addrl);
  	            	}
  	            	if (endmask)
! 			    *MAPW(addrl) = DoMaskMergeRop (src, *MAPR(addrl), endmask);
              	    }
  	    	}
  	    	pwidth++;
***************
*** 841,846 ****
--- 879,886 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrlBase)
+ 
      tileWidth = pTile->drawable.width;
      tileHeight = pTile->drawable.height;
  
***************
*** 856,861 ****
--- 896,902 ----
      {
  	iline = (ppt->y - ySrc) % tileHeight;
          pdst = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
+         SETRW(pdst);
          psrcT = (unsigned int *) pTile->devPrivate.ptr + (iline * tlwidth);
  	x = ppt->x;
  
***************
*** 878,884 ****
  		    endinc = rem / BITMAP_SCANLINE_UNIT;
  		    getandputrop((psrc+endinc), (rem&0x1f), (x & 0x1f), w, pdst, rop);
  		    if((x & 0x1f) + w >= 0x20)
! 			pdst++;
  		}
  		else if(((x & 0x1f) + w) < 32)
  		{
--- 919,925 ----
  		    endinc = rem / BITMAP_SCANLINE_UNIT;
  		    getandputrop((psrc+endinc), (rem&0x1f), (x & 0x1f), w, pdst, rop);
  		    if((x & 0x1f) + w >= 0x20)
! 			pdst++; CHECKRWO(pdst);
  		}
  		else if(((x & 0x1f) + w) < 32)
  		{
***************
*** 906,912 ****
  		    if(startmask)
  		    {
  			putbitsrop(*psrc, (x & 0x1f), nstart, pdst, rop);
! 			pdst++;
  			if(srcStartOver)
  			    psrc++;
  		    }
--- 947,953 ----
  		    if(startmask)
  		    {
  			putbitsrop(*psrc, (x & 0x1f), nstart, pdst, rop);
! 			pdst++; CHECKRWO(pdst);
  			if(srcStartOver)
  			    psrc++;
  		    }
***************
*** 914,920 ****
  		    while(nlMiddle--)
  		    {
  			    getandputrop0(psrc, nstart, 32, pdst, rop);
! 			    pdst++;
  			    psrc++;
  		    }
  		    if(endmask)
--- 955,961 ----
  		    while(nlMiddle--)
  		    {
  			    getandputrop0(psrc, nstart, 32, pdst, rop);
! 			    pdst++; CHECKRWO(pdst);
  			    psrc++;
  		    }
  		    if(endmask)
***************
*** 999,1004 ****
--- 1040,1047 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrlBase)
+ 
      tileWidth = pTile->drawable.width;
      tileHeight = pTile->drawable.height;
  
***************
*** 1013,1018 ****
--- 1056,1062 ----
      {
  	iline = (ppt->y - ySrc) % tileHeight;
          pdst = addrlBase + (ppt->y * nlwidth) + (ppt->x >> 5);
+         SETRW(pdst);
          psrcT = (int *) pTile->devPrivate.ptr + (iline * tlwidth);
  	x = ppt->x;
  
***************
*** 1036,1042 ****
  		    getandputrrop((psrc + endinc), (rem & 0x1f), (x & 0x1f),
  				 w, pdst, rop)
  		    if((x & 0x1f) + w >= 0x20)
! 			pdst++;
  		}
  
  		else if(((x & 0x1f) + w) < 32)
--- 1080,1086 ----
  		    getandputrrop((psrc + endinc), (rem & 0x1f), (x & 0x1f),
  				 w, pdst, rop)
  		    if((x & 0x1f) + w >= 0x20)
! 			pdst++; CHECKRWO(pdst);
  		}
  
  		else if(((x & 0x1f) + w) < 32)
***************
*** 1065,1071 ****
  		    if(startmask)
  		    {
  			putbitsrrop(*psrc, (x & 0x1f), nstart, pdst, rop);
! 			pdst++;
  			if(srcStartOver)
  			    psrc++;
  		    }
--- 1109,1115 ----
  		    if(startmask)
  		    {
  			putbitsrrop(*psrc, (x & 0x1f), nstart, pdst, rop);
! 			pdst++; CHECKRWO(pdst);
  			if(srcStartOver)
  			    psrc++;
  		    }
***************
*** 1073,1079 ****
  		    while(nlMiddle--)
  		    {
  			    getandputrrop0(psrc, nstart, 32, pdst, rop);
! 			    pdst++;
  			    psrc++;
  		    }
  		    if(endmask)
--- 1117,1123 ----
  		    while(nlMiddle--)
  		    {
  			    getandputrrop0(psrc, nstart, 32, pdst, rop);
! 			    pdst++; CHECKRWO(pdst);
  			    psrc++;
  		    }
  		    if(endmask)
diff -c mit/server/ddx/mfb/mfbgc.c:1.1.1.1 mit/server/ddx/mfb/mfbgc.c:2.0
*** mit/server/ddx/mfb/mfbgc.c:1.1.1.1	Sat Mar 12 00:35:49 1994
--- mit/server/ddx/mfb/mfbgc.c	Sat Mar 12 00:35:49 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbgc.c,v 2.0 1993/07/24 07:13:39 dawes Exp $ */
  /* $XConsortium: mfbgc.c,v 5.25 91/05/26 09:22:58 rws Exp $ */
  #include "X.h"
  #include "Xmd.h"
***************
*** 35,40 ****
--- 36,42 ----
  #include "region.h"
  
  #include "mistruct.h"
+ #include "micache.h"
  
  #include "maskbits.h"
  
***************
*** 496,501 ****
--- 498,505 ----
      int new_rotate, new_rrop,  new_line, new_text, new_fill;
      DDXPointRec	oldOrg;		/* origin of thing GC was last used with */
  
+     if (pDrawable->type == DRAWABLE_PIXMAP)
+ 	(*miCacheFreeSlot)(pDrawable);
      oldOrg = pGC->lastWinOrg;
  
      pGC->lastWinOrg.x = pDrawable->x;
diff -c mit/server/ddx/mfb/mfbgetsp.c:1.1.1.1 mit/server/ddx/mfb/mfbgetsp.c:1.4
*** mit/server/ddx/mfb/mfbgetsp.c:1.1.1.1	Sat Mar 12 00:35:49 1994
--- mit/server/ddx/mfb/mfbgetsp.c	Sat Mar 12 00:35:49 1994
***************
*** 22,28 ****
--- 22,30 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbgetsp.c,v 1.4 1993/03/27 09:00:47 dawes Exp $ */
  /* $XConsortium: mfbgetsp.c,v 5.5 89/09/14 16:26:46 rws Exp $ */
+ #define BANKING_MODS
  #include "X.h"
  #include "Xmd.h"
  
***************
*** 82,92 ****
--- 84,97 ----
      }
      pdst = pdstStart;
  
+     BANK_FLAG(psrcBase);
+ 
      while(ppt < pptLast)
      {
  	xEnd = min(ppt->x + *pwidth, widthSrc << 3);
  	pwidth++;
  	psrc = psrcBase + (ppt->y * (widthSrc >> 2)) + (ppt->x >> 5); 
+         SETRW(psrc);
  	w = xEnd - ppt->x;
  	srcBit = ppt->x & 0x1f;
  
***************
*** 110,132 ****
  	    { 
  		getandputbits0(psrc, srcBit, nstart, pdst);
  		if(srcStartOver)
! 		    psrc++;
  	    } 
  	    nl = nlMiddle; 
  #ifdef FASTPUTBITS
! 	    Duff(nl, putbits(*psrc, nstart, 32, pdst); psrc++; pdst++;);
  #else
  	    while (nl--) 
  	    { 
! 		tmpSrc = *psrc;
  		putbits(tmpSrc, nstart, 32, pdst);
! 		psrc++;
  		pdst++;
  	    } 
  #endif
  	    if (endmask) 
  	    { 
! 		putbits(*psrc, nstart, nend, pdst);
  		if(nstart + nend > 32)
  		    pdst++;
  	    } 
--- 115,139 ----
  	    { 
  		getandputbits0(psrc, srcBit, nstart, pdst);
  		if(srcStartOver)
!                 {
! 		    psrc++; CHECKRWO(psrc);
!                 }
  	    } 
  	    nl = nlMiddle; 
  #ifdef FASTPUTBITS
! 	    Duff(nl, putbits(*MAPR(psrc), nstart, 32, pdst); psrc++; CHECKRWO(psrc); pdst++;);
  #else
  	    while (nl--) 
  	    { 
! 		tmpSrc = *MAPR(psrc);
  		putbits(tmpSrc, nstart, 32, pdst);
! 		psrc++; CHECKRWO(psrc);
  		pdst++;
  	    } 
  #endif
  	    if (endmask) 
  	    { 
! 		putbits(*MAPR(psrc), nstart, nend, pdst);
  		if(nstart + nend > 32)
  		    pdst++;
  	    } 
diff -c mit/server/ddx/mfb/mfbhrzvert.c:1.1.1.1 mit/server/ddx/mfb/mfbhrzvert.c:1.4
*** mit/server/ddx/mfb/mfbhrzvert.c:1.1.1.1	Sat Mar 12 00:35:50 1994
--- mit/server/ddx/mfb/mfbhrzvert.c	Sat Mar 12 00:35:50 1994
***************
*** 22,28 ****
--- 22,30 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbhrzvert.c,v 1.4 1993/03/27 09:00:48 dawes Exp $ */
  /* $XConsortium: mfbhrzvert.c,v 1.11 89/09/13 18:58:09 rws Exp $ */
+ #define BANKING_MODS
  #include "X.h"
  
  #include "gc.h"
***************
*** 59,65 ****
--- 61,70 ----
  	len = -len;
      }
  
+     BANK_FLAG(addrl)
+ 
      addrl = addrl + (y1 * nlwidth) + (x1 >> 5);
+     SETRW(addrl);
  
      /* all bits inside same longword */
      if ( ((x1 & 0x1f) + len) < 32)
***************
*** 67,81 ****
  	maskpartialbits(x1, len, startmask);
          if (rop == RROP_BLACK)
          {
! 	    *addrl &= ~startmask;
          }
          else if (rop == RROP_WHITE)
          {
! 	    *addrl |= startmask;
          }
          else if (rop == RROP_INVERT)
          {
! 	    *addrl ^= startmask;
          }
      }
      else
--- 72,86 ----
  	maskpartialbits(x1, len, startmask);
          if (rop == RROP_BLACK)
          {
! 	    *MAPRW(addrl) &= ~startmask;
          }
          else if (rop == RROP_WHITE)
          {
! 	    *MAPRW(addrl) |= startmask;
          }
          else if (rop == RROP_INVERT)
          {
! 	    *MAPRW(addrl) ^= startmask;
          }
      }
      else
***************
*** 83,109 ****
  	maskbits(x1, len, startmask, endmask, nlmiddle);
          if (rop == RROP_BLACK)
          {
! 	    if (startmask)
! 		*addrl++ &= ~startmask;
! 	    Duff (nlmiddle, *addrl++ = 0x0);
  	    if (endmask)
! 		*addrl &= ~endmask;
          }
          else if (rop == RROP_WHITE)
          {
! 	    if (startmask)
! 		*addrl++ |= startmask;
! 	    Duff (nlmiddle, *addrl++ = 0xffffffff);
  	    if (endmask)
! 		*addrl |= endmask;
          }
          else if (rop == RROP_INVERT)
          {
! 	    if (startmask)
! 		*addrl++ ^= startmask;
! 	    Duff (nlmiddle, *addrl++ ^= 0xffffffff);
  	    if (endmask)
! 		*addrl ^= endmask;
          }
      }
  }
--- 88,119 ----
  	maskbits(x1, len, startmask, endmask, nlmiddle);
          if (rop == RROP_BLACK)
          {
! 	    if (startmask) {
! 		*MAPRW(addrl) &= ~startmask; addrl++; CHECKRWO(addrl);
! 	      }
! 	    Duff (nlmiddle, *MAPW(addrl) = 0x0; addrl++; CHECKRWO(addrl));
  	    if (endmask)
! 		*MAPRW(addrl) &= ~endmask;
          }
          else if (rop == RROP_WHITE)
          {
! 	    if (startmask) {
! 		*MAPRW(addrl) |= startmask; addrl++; CHECKRWO(addrl);
! 	      }
! 	    Duff (nlmiddle, *MAPW(addrl) = 0xffffffff;
!                   addrl++; CHECKRWO(addrl));
  	    if (endmask)
! 		*MAPRW(addrl) |= endmask;
          }
          else if (rop == RROP_INVERT)
          {
! 	    if (startmask) {
! 		*MAPRW(addrl) ^= startmask; addrl++; CHECKRWO(addrl);
! 	      }
! 	    Duff (nlmiddle, *MAPRW(addrl) ^= 0xffffffff;
!                   addrl++; CHECKRWO(addrl));
  	    if (endmask)
! 		*MAPRW(addrl) ^= endmask;
          }
      }
  }
***************
*** 123,129 ****
--- 133,142 ----
  {
      register int bitmask;
  
+     BANK_FLAG(addrl)
+ 
      addrl = addrl + (y1 * nlwidth) + (x1 >> 5);
+     SETRW(addrl);
  
      if (len < 0)
      {
***************
*** 134,150 ****
      if (rop == RROP_BLACK)
      {
  	bitmask = rmask[x1&0x1f];
!         Duff(len, *addrl &= bitmask; addrl += nlwidth );
      }
      else if (rop == RROP_WHITE)
      {
  	bitmask = mask[x1&0x1f];
!         Duff(len, *addrl |= bitmask; addrl += nlwidth );
      }
      else if (rop == RROP_INVERT)
      {
  	bitmask = mask[x1&0x1f];
!         Duff(len, *addrl ^= bitmask; addrl += nlwidth );
      }
  }
  
--- 147,163 ----
      if (rop == RROP_BLACK)
      {
  	bitmask = rmask[x1&0x1f];
!         Duff(len, *MAPRW(addrl) &= bitmask; addrl += nlwidth; CHECKRWO(addrl) );
      }
      else if (rop == RROP_WHITE)
      {
  	bitmask = mask[x1&0x1f];
!         Duff(len, *MAPRW(addrl) |= bitmask; addrl += nlwidth; CHECKRWO(addrl) );
      }
      else if (rop == RROP_INVERT)
      {
  	bitmask = mask[x1&0x1f];
!         Duff(len, *MAPRW(addrl) ^= bitmask; addrl += nlwidth; CHECKRWO(addrl) );
      }
  }
  
diff -c mit/server/ddx/mfb/mfbimage.c:1.1.1.1 mit/server/ddx/mfb/mfbimage.c:1.3
*** mit/server/ddx/mfb/mfbimage.c:1.1.1.1	Sat Mar 12 00:35:50 1994
--- mit/server/ddx/mfb/mfbimage.c	Sat Mar 12 00:35:50 1994
***************
*** 21,27 ****
--- 21,29 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbimage.c,v 1.3 1993/03/27 09:00:50 dawes Exp $ */
  /* $XConsortium: mfbimage.c,v 5.3 89/09/14 16:26:42 rws Exp $ */
+ 
  
  #include "X.h"
  
diff -c mit/server/ddx/mfb/mfbimggblt.c:1.1.1.1 mit/server/ddx/mfb/mfbimggblt.c:1.4
*** mit/server/ddx/mfb/mfbimggblt.c:1.1.1.1	Sat Mar 12 00:35:51 1994
--- mit/server/ddx/mfb/mfbimggblt.c	Sat Mar 12 00:35:51 1994
***************
*** 22,28 ****
--- 22,30 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbimggblt.c,v 1.4 1993/03/27 09:00:52 dawes Exp $ */
  /* $XConsortium: mfbimggblt.c,v 5.6 91/05/26 09:21:19 rws Exp $ */
+ #define BANKING_MODS
  #include	"X.h"
  #include	"Xmd.h"
  #include	"Xproto.h"
***************
*** 139,144 ****
--- 141,148 ----
  	widthDst = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(pdstBase)
+ 
      QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
  
      backrect.x = x;
***************
*** 220,225 ****
--- 224,230 ----
  	        xoff += 32;
  	        pdst--;
  	    }
+             SETRW(pdst);
  
  	    if ((xoff + w) <= 32)
  	    {
***************
*** 228,236 ****
  	        while (h--)
  	        {
  		    getleftbits(pglyph, w, tmpSrc);
! 		    *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
  		    pglyph += widthGlyph;
! 		    pdst += widthDst;
  	        }
  	    }
  	    else
--- 233,241 ----
  	        while (h--)
  	        {
  		    getleftbits(pglyph, w, tmpSrc);
! 		    *MAPRW(pdst) OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
  		    pglyph += widthGlyph;
! 		    pdst += widthDst; CHECKRWO(pdst);
  	        }
  	    }
  	    else
***************
*** 241,250 ****
  	        while (h--)
  	        {
  		    getleftbits(pglyph, w, tmpSrc);
! 		    *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
! 		    *(pdst+1) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
  		    pglyph += widthGlyph;
! 		    pdst += widthDst;
  	        }
  	    } /* glyph crosses longwords boundary */
  
--- 246,256 ----
  	        while (h--)
  	        {
  		    getleftbits(pglyph, w, tmpSrc);
! 		    *MAPRW(pdst) OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
!                     CHECKRWONEXT(pdst);
! 		    *MAPRW(&(pdst[1])) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
  		    pglyph += widthGlyph;
! 		    pdst += widthDst; CHECKRWO(pdst);
  	        }
  	    } /* glyph crosses longwords boundary */
  
***************
*** 390,395 ****
--- 396,402 ----
  		    xoff += 32;
  		    pdst--;
  		}
+                 SETRW(pdst);
  
  		if ((xoff + w) <= 32)
  		{
***************
*** 397,405 ****
  		    while (h--)
  		    {
  			getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
! 			*pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
  			pglyph += widthGlyph;
! 			pdst += widthDst;
  		    }
  		}
  		else
--- 404,412 ----
  		    while (h--)
  		    {
  			getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
! 			*MAPRW(pdst) OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
  			pglyph += widthGlyph;
! 			pdst += widthDst; CHECKRWO(pdst);
  		    }
  		}
  		else
***************
*** 409,418 ****
  		    while (h--)
  		    {
  			getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
! 			*pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
! 			*(pdst+1) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
  			pglyph += widthGlyph;
! 			pdst += widthDst;
  		    }
  		}
  	    } /* for each glyph */
--- 416,426 ----
  		    while (h--)
  		    {
  			getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
! 			*MAPRW(pdst) OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
!                         CHECKRWONEXT(pdst);
! 			*MAPRW(&(pdst[1])) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
  			pglyph += widthGlyph;
! 			pdst += widthDst; CHECKRWO(pdst);
  		    }
  		}
  	    } /* for each glyph */
diff -c mit/server/ddx/mfb/mfbline.c:1.1.1.1 mit/server/ddx/mfb/mfbline.c:1.4
*** mit/server/ddx/mfb/mfbline.c:1.1.1.1	Sat Mar 12 00:35:51 1994
--- mit/server/ddx/mfb/mfbline.c	Sat Mar 12 00:35:51 1994
***************
*** 21,27 ****
--- 21,29 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbline.c,v 1.4 1993/03/27 09:00:54 dawes Exp $ */
  /* $XConsortium: mfbline.c,v 5.12 91/08/13 18:49:01 keith Exp $ */
+ #define BANKING_MODS
  #include "X.h"
  
  #include "gcstruct.h"
***************
*** 164,169 ****
--- 166,173 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrl)
+ 
      xorg = pDrawable->x;
      yorg = pDrawable->y;
  #ifdef POLYSEGMENT
***************
*** 478,494 ****
  		(x2 <  pbox->x2) &&
  		(y2 <  pbox->y2))
  	    {
! 		addrl += _incr;
  		switch(alu)
  		{
  		    case RROP_BLACK:
! 		        *addrl &= _mask;
  			break;
  		    case RROP_WHITE:
! 		        *addrl |= _mask;
  			break;
  		    case RROP_INVERT:
! 		        *addrl ^= _mask;
  			break;
  		}
  		break;
--- 482,499 ----
  		(x2 <  pbox->x2) &&
  		(y2 <  pbox->y2))
  	    {
! 		int *addrtmp = (addrl += _incr);
!                 SETRW(addrtmp);
  		switch(alu)
  		{
  		    case RROP_BLACK:
! 		        *MAPRW(addrtmp) &= _mask;
  			break;
  		    case RROP_WHITE:
! 		        *MAPRW(addrtmp) |= _mask;
  			break;
  		    case RROP_INVERT:
! 		        *MAPRW(addrtmp) ^= _mask;
  			break;
  		}
  		break;
***************
*** 574,579 ****
--- 579,586 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrl)
+ 
      /* compute initial dash values */
       
      pDash = (unsigned char *) pGC->dash;
***************
*** 797,802 ****
--- 804,810 ----
  	    {
  		unsigned long _mask;
  		int rop;
+                 int *tmpaddr;
  
  		rop = fgrop;
  		if (dashIndex & 1)
***************
*** 806,817 ****
  		else
  		    _mask = mask[x2 & 0x1f];
  		addrl += (y2 * nlwidth) + (x2 >> 5);
  		if (rop == RROP_BLACK)
! 		    *addrl &= _mask;
  		else if (rop == RROP_WHITE)
! 		    *addrl |= _mask;
  		else
! 		    *addrl ^= _mask;
  		break;
  	    }
  	    else
--- 814,827 ----
  		else
  		    _mask = mask[x2 & 0x1f];
  		addrl += (y2 * nlwidth) + (x2 >> 5);
+                 tmpaddr = addrl;
+ 		SETRW(tmpaddr);
  		if (rop == RROP_BLACK)
! 		    *MAPRW(tmpaddr) &= _mask;
  		else if (rop == RROP_WHITE)
! 		    *MAPRW(tmpaddr) |= _mask;
  		else
! 		    *MAPRW(tmpaddr) ^= _mask;
  		break;
  	    }
  	    else
diff -c /dev/null mit/server/ddx/mfb/mfbmap.h:2.0
*** /dev/null	Sat Mar 12 00:35:52 1994
--- mit/server/ddx/mfb/mfbmap.h	Sat Mar 12 00:35:52 1994
***************
*** 0 ****
--- 1,116 ----
+ /* $XFree86: mit/server/ddx/mfb/mfbmap.h,v 2.0 1993/12/10 14:34:08 dawes Exp $ */
+ 
+ #if (__STDC__ && !defined(UNIXCPP)) || (defined (SOLX86) && defined (__STDC__) && !defined (__GNUC__))
+ #define CATNAME(prefix,subname) prefix##subname
+ #else
+ #define CATNAME(prefix,subname) prefix/**/subname
+ #endif
+ 
+ #ifdef CUSTOMNAME
+ 
+ #define InverseAlu CUSTOMNAME(_InverseAlu)
+ #define starttab CUSTOMNAME(_starttab)
+ #define endtab CUSTOMNAME(_endtab)
+ #define partmasks CUSTOMNAME(_partmasks)
+ #define mask CUSTOMNAME(_mask)
+ #define rmask CUSTOMNAME(_rmask)
+ #define mergeRopBits CUSTOMNAME(_mergeRopBits)
+ #define mfbBSFuncRec CUSTOMNAME(_mfbBSFuncRec)
+ #define mfbWindowPrivateIndex CUSTOMNAME(_mfbWindowPrivateIndex)
+ #define mfbGCPrivateIndex CUSTOMNAME(_mfbGCPrivateIndex)
+ #define mfbValidateGC CUSTOMNAME(_mfbValidateGC)
+ #define mfbChangeGC CUSTOMNAME(_mfbChangeGC)
+ #define mfbCopyGC CUSTOMNAME(_mfbCopyGC)
+ #define mfbDestroyGC CUSTOMNAME(_mfbDestroyGC)
+ #define mfbChangeClip CUSTOMNAME(_mfbChangeClip)
+ #define mfbDestroyClip CUSTOMNAME(_mfbDestroyClip)
+ #define mfbCopyClip CUSTOMNAME(_mfbCopyClip)
+ #define mfbCreateGC CUSTOMNAME(_mfbCreateGC)
+ #define mfbReduceRop CUSTOMNAME(_mfbReduceRop)
+ #define mfbCreateWindow CUSTOMNAME(_mfbCreateWindow)
+ #define mfbDestroyWindow CUSTOMNAME(_mfbDestroyWindow)
+ #define mfbMapWindow CUSTOMNAME(_mfbMapWindow)
+ #define mfbPositionWindow CUSTOMNAME(_mfbPositionWindow)
+ #define mfbUnmapWindow CUSTOMNAME(_mfbUnmapWindow)
+ #define mfbCopyWindow CUSTOMNAME(_mfbCopyWindow)
+ #define mfbChangeWindowAttributes CUSTOMNAME(_mfbChangeWindowAttributes)
+ #define mfbRealizeFont CUSTOMNAME(_mfbRealizeFont)
+ #define mfbUnrealizeFont CUSTOMNAME(_mfbUnrealizeFont)
+ #define mfbPolyFillRect CUSTOMNAME(_mfbPolyFillRect)
+ #define mfbPaintWindow CUSTOMNAME(_mfbPaintWindow)
+ #define mfbCreatePixmap CUSTOMNAME(_mfbCreatePixmap)
+ #define mfbDestroyPixmap CUSTOMNAME(_mfbDestroyPixmap)
+ #define mfbCopyPixmap CUSTOMNAME(_mfbCopyPixmap)
+ #define mfbPadPixmap CUSTOMNAME(_mfbPadPixmap)
+ #define mfbXRotatePixmap CUSTOMNAME(_mfbXRotatePixmap)
+ #define mfbYRotatePixmap CUSTOMNAME(_mfbYRotatePixmap)
+ #define mfbCopyRotatePixmap CUSTOMNAME(_mfbCopyRotatePixmap)
+ #define mfbPutImage CUSTOMNAME(_mfbPutImage)
+ #define mfbGetImage CUSTOMNAME(_mfbGetImage)
+ #define mfbLineSS CUSTOMNAME(_mfbLineSS)
+ #define mfbClipLine CUSTOMNAME(_mfbClipLine)
+ #define mfbLineSD CUSTOMNAME(_mfbLineSD)
+ #define mfbBresS CUSTOMNAME(_mfbBresS)
+ #define mfbHorzS CUSTOMNAME(_mfbHorzS)
+ #define mfbVertS CUSTOMNAME(_mfbVertS)
+ #define mfbBresD CUSTOMNAME(_mfbBresD)
+ #define mfbSegmentSS CUSTOMNAME(_mfbSegmentSS)
+ #define mfbSegmentSD CUSTOMNAME(_mfbSegmentSD)
+ #define mfbSolidPP CUSTOMNAME(_mfbSolidPP)
+ #define mfbPushPixels CUSTOMNAME(_mfbPushPixels)
+ #define mfbZeroPolyArcSS CUSTOMNAME(_mfbZeroPolyArcSS)
+ #define mfbPolyFillArcSolid CUSTOMNAME(_mfbPolyFillArcSolid)
+ #define mfbBlackSolidFS CUSTOMNAME(_mfbBlackSolidFS)
+ #define mfbWhiteSolidFS CUSTOMNAME(_mfbWhiteSolidFS)
+ #define mfbInvertSolidFS CUSTOMNAME(_mfbInvertSolidFS)
+ #define mfbWhiteStippleFS CUSTOMNAME(_mfbWhiteStippleFS)
+ #define mfbBlackStippleFS CUSTOMNAME(_mfbBlackStippleFS)
+ #define mfbInvertStippleFS CUSTOMNAME(_mfbInvertStippleFS)
+ #define mfbTileFS CUSTOMNAME(_mfbTileFS)
+ #define mfbUnnaturalTileFS CUSTOMNAME(_mfbUnnaturalTileFS)
+ #define mfbUnnaturalStippleFS CUSTOMNAME(_mfbUnnaturalStippleFS)
+ #define mfbSetScanline CUSTOMNAME(_mfbSetScanline)
+ #define mfbSetSpans CUSTOMNAME(_mfbSetSpans)
+ #define mfbAllocatePrivates CUSTOMNAME(_mfbAllocatePrivates)
+ #define mfbScreenInit CUSTOMNAME(_mfbScreenInit)
+ #define mfbCloseScreen CUSTOMNAME(_mfbCloseScreen)
+ #define mfbPixmapToRegion CUSTOMNAME(_mfbPixmapToRegion)
+ #define mfbDoBitblt CUSTOMNAME(_mfbDoBitblt)
+ #define mfbCopyArea CUSTOMNAME(_mfbCopyArea)
+ #define mfbRegisterCopyPlaneProc CUSTOMNAME(_mfbRegisterCopyPlaneProc)
+ #define mfbCopyPlane CUSTOMNAME(_mfbCopyPlane)
+ #define mfbGetSpans CUSTOMNAME(_mfbGetSpans)
+ #define mfbPolyPoint CUSTOMNAME(_mfbPolyPoint)
+ #define mfbDoBitbltCopy CUSTOMNAME(_mfbDoBitbltCopy)
+ #define mfbDoBitbltXor CUSTOMNAME(_mfbDoBitbltXor)
+ #define mfbDoBitbltCopyInverted CUSTOMNAME(_mfbDoBitbltCopyInverted)
+ #define mfbDoBitbltOr CUSTOMNAME(_mfbDoBitbltOr)
+ #define mfbDoBitbltGeneral CUSTOMNAME(_mfbDoBitbltGeneral)
+ #define mfbPolyGlyphBltWhite CUSTOMNAME(_mfbPolyGlyphBltWhite)
+ #define mfbPolyGlyphBltBlack CUSTOMNAME(_mfbPolyGlyphBltBlack)
+ #define mfbPolyGlyphBltInvert CUSTOMNAME(_mfbPolyGlyphBltInvert)
+ #define mfbImageGlyphBltWhite CUSTOMNAME(_mfbImageGlyphBltWhite)
+ #define mfbImageGlyphBltBlack CUSTOMNAME(_mfbImageGlyphBltBlack)
+ #define mfbListInstalledColormaps CUSTOMNAME(_mfbListInstalledColormaps)
+ #define mfbInstallColormap CUSTOMNAME(_mfbInstallColormap)
+ #define mfbUninstallColormap CUSTOMNAME(_mfbUninstallColormap)
+ #define mfbResolveColor CUSTOMNAME(_mfbResolveColor)
+ #define mfbCreateColormap CUSTOMNAME(_mfbCreateColormap)
+ #define mfbDestroyColormap CUSTOMNAME(_mfbDestroyColormap)
+ #define mfbCreateDefColormap CUSTOMNAME(_mfbCreateDefColormap)
+ #define mfbSolidWhiteArea CUSTOMNAME(_mfbSolidWhiteArea)
+ #define mfbStippleWhiteArea CUSTOMNAME(_mfbStippleWhiteArea)
+ #define mfbSolidBlackArea CUSTOMNAME(_mfbSolidBlackArea)
+ #define mfbStippleBlackArea CUSTOMNAME(_mfbStippleBlackArea)
+ #define mfbSolidInvertArea CUSTOMNAME(_mfbSolidInvertArea)
+ #define mfbStippleInvertArea CUSTOMNAME(_mfbStippleInvertArea)
+ #define mfbTileArea32Copy CUSTOMNAME(_mfbTileArea32Copy)
+ #define mfbTileArea32General CUSTOMNAME(_mfbTileArea32General)
+ #define mfbTileArea32 CUSTOMNAME(_mfbTileArea32)
+ #define mfbTEGlyphBltWhite CUSTOMNAME(_mfbTEGlyphBltWhite)
+ #define mfbTEGlyphBltBlack CUSTOMNAME(_mfbTEGlyphBltBlack)
+ #define mfbQueryBestSize CUSTOMNAME(_mfbQueryBestSize)
+ #define mfbSaveAreas CUSTOMNAME(_mfbSaveAreas)
+ #define mfbRestoreAreas CUSTOMNAME(_mfbRestoreAreas)
+ 
+ #endif
diff -c mit/server/ddx/mfb/mfbpixmap.c:1.1.1.1 mit/server/ddx/mfb/mfbpixmap.c:2.0
*** mit/server/ddx/mfb/mfbpixmap.c:1.1.1.1	Sat Mar 12 00:35:52 1994
--- mit/server/ddx/mfb/mfbpixmap.c	Sat Mar 12 00:35:52 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbpixmap.c,v 2.0 1993/07/24 07:13:42 dawes Exp $ */
  /* $XConsortium: mfbpixmap.c,v 5.5 89/07/28 11:59:59 rws Exp $ */
  
  /* pixmap management
***************
*** 30,41 ****
  */
  
  #include "Xmd.h"
- #include "pixmapstr.h"
- #include "maskbits.h"
- 
  #include "mfb.h"
  #include "mi.h"
  
  #include "servermd.h"
  
  PixmapPtr
--- 31,42 ----
  */
  
  #include "Xmd.h"
  #include "mfb.h"
  #include "mi.h"
  
+ #include "pixmapstr.h"
+ #include "maskbits.h"
+ 
  #include "servermd.h"
  
  PixmapPtr
***************
*** 66,71 ****
--- 67,74 ----
      pPixmap->drawable.y = 0;
      pPixmap->drawable.width = width;
      pPixmap->drawable.height = height;
+     pPixmap->slot = -1;
+     pPixmap->cacheId = 0;
      pPixmap->devKind = size;
      pPixmap->refcnt = 1;
      pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
***************
*** 97,102 ****
--- 100,107 ----
      pDst->drawable = pSrc->drawable;
      pDst->drawable.id = 0;
      pDst->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+     pDst->slot = -1;
+     pDst->cacheId = 0;
      pDst->devKind = pSrc->devKind;
      pDst->refcnt = 1;
      pDst->devPrivate.ptr = (pointer)(pDst + 1);
***************
*** 245,250 ****
--- 250,257 ----
  	      psrcPix->drawable.height * psrcPix->devKind);
  	pdstPix->drawable.width = psrcPix->drawable.width;
  	pdstPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ 	pdstPix->slot = -1;
+ 	pdstPix->cacheId = 0;
      }
      else
      {
diff -c mit/server/ddx/mfb/mfbplygblt.c:1.1.1.1 mit/server/ddx/mfb/mfbplygblt.c:1.4
*** mit/server/ddx/mfb/mfbplygblt.c:1.1.1.1	Sat Mar 12 00:35:53 1994
--- mit/server/ddx/mfb/mfbplygblt.c	Sat Mar 12 00:35:53 1994
***************
*** 21,28 ****
--- 21,30 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbplygblt.c,v 1.4 1993/03/27 09:00:56 dawes Exp $ */
  /* $XConsortium: mfbplygblt.c,v 5.4 91/01/27 13:02:11 keith Exp $ */
  
+ #define BANKING_MODS
  #include "X.h"
  #include "Xmd.h"
  #include "Xproto.h"
***************
*** 135,140 ****
--- 137,144 ----
  	widthDst = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(pdstBase)
+ 
      x += xorg;
      y += yorg;
  
***************
*** 178,183 ****
--- 182,188 ----
  	        xoff += 32;
  	        pdst--;
  	    }
+             SETRW(pdst);
  
  	    if ((xoff + w) <= 32)
  	    {
***************
*** 186,194 ****
  	        while (h--)
  	        {
  		    getleftbits(pglyph, w, tmpSrc);
! 		    *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
  		    pglyph += widthGlyph;
! 		    pdst += widthDst;
  	        }
  	    }
  	    else
--- 191,199 ----
  	        while (h--)
  	        {
  		    getleftbits(pglyph, w, tmpSrc);
! 		    *MAPRW(pdst) OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
  		    pglyph += widthGlyph;
! 		    pdst += widthDst; CHECKRWO(pdst);
  	        }
  	    }
  	    else
***************
*** 199,208 ****
  	        while (h--)
  	        {
  		    getleftbits(pglyph, w, tmpSrc);
! 		    *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
! 		    *(pdst+1) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
  		    pglyph += widthGlyph;
! 		    pdst += widthDst;
  	        }
  	    } /* glyph crosses longwords boundary */
  
--- 204,214 ----
  	        while (h--)
  	        {
  		    getleftbits(pglyph, w, tmpSrc);
! 		    *MAPRW(pdst) OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
!                     CHECKRWONEXT(pdst);
! 		    *MAPRW(&(pdst[1])) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
  		    pglyph += widthGlyph;
! 		    pdst += widthDst; CHECKRWO(pdst);
  	        }
  	    } /* glyph crosses longwords boundary */
  
***************
*** 341,346 ****
--- 347,353 ----
  		    xoff += 32;
  		    pdst--;
  		}
+                 SETRW(pdst);
  
  		if ((xoff + w) <= 32)
  		{
***************
*** 348,356 ****
  		    while (h--)
  		    {
  			getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
! 			*pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
  			pglyph += widthGlyph;
! 			pdst += widthDst;
  		    }
  		}
  		else
--- 355,363 ----
  		    while (h--)
  		    {
  			getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
! 			*MAPRW(pdst) OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
  			pglyph += widthGlyph;
! 			pdst += widthDst; CHECKRWO(pdst);
  		    }
  		}
  		else
***************
*** 360,369 ****
  		    while (h--)
  		    {
  			getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
! 			*pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
! 			*(pdst+1) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
  			pglyph += widthGlyph;
! 			pdst += widthDst;
  		    }
  		}
  	    } /* for each glyph */
--- 367,377 ----
  		    while (h--)
  		    {
  			getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
! 			*MAPRW(pdst) OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
!                         CHECKRWONEXT(pdst);
! 			*MAPRW(&(pdst[1])) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
  			pglyph += widthGlyph;
! 			pdst += widthDst; CHECKRWO(pdst);
  		    }
  		}
  	    } /* for each glyph */
diff -c mit/server/ddx/mfb/mfbpntarea.c:1.1.1.1 mit/server/ddx/mfb/mfbpntarea.c:1.5
*** mit/server/ddx/mfb/mfbpntarea.c:1.1.1.1	Sat Mar 12 00:35:53 1994
--- mit/server/ddx/mfb/mfbpntarea.c	Sat Mar 12 00:35:53 1994
***************
*** 22,28 ****
--- 22,32 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbpntarea.c,v 1.5 1993/03/27 09:00:58 dawes Exp $ */
  /* $XConsortium: mfbpntarea.c,v 5.2 89/11/24 18:06:43 rws Exp $ */
+ 
+ #define BANKING_MODS
+ 
  #include "X.h"
  
  #include "windowstr.h"
***************
*** 90,95 ****
--- 94,100 ----
  	nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
      }
  
+     BANK_FLAG(pbits)
  
      while (nbox--)
      {
***************
*** 97,107 ****
  	h = pbox->y2 - pbox->y1;
  	p = pbits + (pbox->y1 * nlwidth) + (pbox->x1 >> 5);
  
  	if ( ((pbox->x1 & 0x1f) + w) < 32)
  	{
  	    maskpartialbits(pbox->x1, w, startmask);
  	    nlwExtra = nlwidth;
! 	    Duff(h, *p OPEQ startmask; p += nlwExtra);
  	}
  	else
  	{
--- 102,113 ----
  	h = pbox->y2 - pbox->y1;
  	p = pbits + (pbox->y1 * nlwidth) + (pbox->x1 >> 5);
  
+         SETRW(p);
  	if ( ((pbox->x1 & 0x1f) + w) < 32)
  	{
  	    maskpartialbits(pbox->x1, w, startmask);
  	    nlwExtra = nlwidth;
! 	    Duff(h, *MAPRW(p) OPEQ startmask; p += nlwExtra; CHECKRWO(p));
  	}
  	else
  	{
***************
*** 114,124 ****
  		while (h--)
  		{
  		    nlw = nlwMiddle;
! 		    *p OPEQ startmask;
! 		    p++;
! 		    Duff(nlw, *p++ EQWHOLEWORD);
! 		    *p OPEQ endmask;
! 		    p += nlwExtra;
  		}
  	    }
  	    else if (startmask && !endmask)
--- 120,130 ----
  		while (h--)
  		{
  		    nlw = nlwMiddle;
! 		    *MAPRW(p) OPEQ startmask;
! 		    p++; CHECKRWO(p);
! 		    Duff(nlw, *MAPRW(p) EQWHOLEWORD; p++; CHECKRWO(p));
! 		    *MAPRW(p) OPEQ endmask;
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	    else if (startmask && !endmask)
***************
*** 127,136 ****
  		while (h--)
  		{
  		    nlw = nlwMiddle;
! 		    *p OPEQ startmask;
! 		    p++;
! 		    Duff(nlw, *p++ EQWHOLEWORD);
! 		    p += nlwExtra;
  		}
  	    }
  	    else if (!startmask && endmask)
--- 133,142 ----
  		while (h--)
  		{
  		    nlw = nlwMiddle;
! 		    *MAPRW(p) OPEQ startmask;
! 		    p++; CHECKRWO(p);
! 		    Duff(nlw, *MAPRW(p) EQWHOLEWORD; p++; CHECKRWO(p));
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	    else if (!startmask && endmask)
***************
*** 138,146 ****
  		while (h--)
  		{
  		    nlw = nlwMiddle;
! 		    Duff(nlw, *p++ EQWHOLEWORD);
! 		    *p OPEQ endmask;
! 		    p += nlwExtra;
  		}
  	    }
  	    else /* no ragged bits at either end */
--- 144,152 ----
  		while (h--)
  		{
  		    nlw = nlwMiddle;
! 		    Duff(nlw, *MAPRW(p) EQWHOLEWORD; p++; CHECKRWO(p));
! 		    *MAPRW(p) OPEQ endmask;
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	    else /* no ragged bits at either end */
***************
*** 148,155 ****
  		while (h--)
  		{
  		    nlw = nlwMiddle;
! 		    Duff(nlw, *p++ EQWHOLEWORD);
! 		    p += nlwExtra;
  		}
  	    }
  	}
--- 154,161 ----
  		while (h--)
  		{
  		    nlw = nlwMiddle;
! 		    Duff(nlw, *MAPRW(p) EQWHOLEWORD; p++; CHECKRWO(p));
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	}
***************
*** 214,219 ****
--- 220,227 ----
  	nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
      }
  
+     BANK_FLAG(pbits)
+ 
      tileHeight = pstipple->drawable.height;
      psrc = (unsigned int *)(pstipple->devPrivate.ptr);
  
***************
*** 224,229 ****
--- 232,238 ----
  	iy = pbox->y1 % tileHeight;
  	p = pbits + (pbox->y1 * nlwidth) + (pbox->x1 >> 5);
  
+         SETRW(p);
  	if ( ((pbox->x1 & 0x1f) + w) < 32)
  	{
  	    maskpartialbits(pbox->x1, w, startmask);
***************
*** 232,239 ****
  	    {
  		srcpix = psrc[iy];
  		iy = ++iy < tileHeight ? iy : 0;
! 		*p OPEQ (srcpix & startmask);
! 		p += nlwExtra;
  	    }
  	}
  	else
--- 241,248 ----
  	    {
  		srcpix = psrc[iy];
  		iy = ++iy < tileHeight ? iy : 0;
! 		*MAPRW(p) OPEQ (srcpix & startmask);
! 		p += nlwExtra; CHECKRWO(p);
  	    }
  	}
  	else
***************
*** 249,259 ****
  		    srcpix = psrc[iy];
  		    iy = ++iy < tileHeight ? iy : 0;
  		    nlw = nlwMiddle;
! 		    *p OPEQ (srcpix & startmask);
! 		    p++;
! 		    Duff (nlw, *p++ OPEQ srcpix);
! 		    *p OPEQ (srcpix & endmask);
! 		    p += nlwExtra;
  		}
  	    }
  	    else if (startmask && !endmask)
--- 258,268 ----
  		    srcpix = psrc[iy];
  		    iy = ++iy < tileHeight ? iy : 0;
  		    nlw = nlwMiddle;
! 		    *MAPRW(p) OPEQ (srcpix & startmask);
! 		    p++; CHECKRWO(p);
! 		    Duff (nlw, *MAPRW(p) OPEQ srcpix; p++; CHECKRWO(p));
! 		    *MAPRW(p) OPEQ (srcpix & endmask);
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	    else if (startmask && !endmask)
***************
*** 264,273 ****
  		    srcpix = psrc[iy];
  		    iy = ++iy < tileHeight ? iy : 0;
  		    nlw = nlwMiddle;
! 		    *p OPEQ (srcpix & startmask);
! 		    p++;
! 		    Duff(nlw, *p++ OPEQ srcpix);
! 		    p += nlwExtra;
  		}
  	    }
  	    else if (!startmask && endmask)
--- 273,282 ----
  		    srcpix = psrc[iy];
  		    iy = ++iy < tileHeight ? iy : 0;
  		    nlw = nlwMiddle;
! 		    *MAPRW(p) OPEQ (srcpix & startmask);
! 		    p++; CHECKRWO(p);
! 		    Duff(nlw, *MAPRW(p) OPEQ srcpix; p++; CHECKRWO(p));
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	    else if (!startmask && endmask)
***************
*** 277,285 ****
  		    srcpix = psrc[iy];
  		    iy = ++iy < tileHeight ? iy : 0;
  		    nlw = nlwMiddle;
! 		    Duff(nlw, *p++ OPEQ srcpix);
! 		    *p OPEQ (srcpix & endmask);
! 		    p += nlwExtra;
  		}
  	    }
  	    else /* no ragged bits at either end */
--- 286,294 ----
  		    srcpix = psrc[iy];
  		    iy = ++iy < tileHeight ? iy : 0;
  		    nlw = nlwMiddle;
! 		    Duff(nlw, *MAPRW(p) OPEQ srcpix; p++; CHECKRWO(p));
! 		    *MAPRW(p) OPEQ (srcpix & endmask);
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	    else /* no ragged bits at either end */
***************
*** 289,296 ****
  		    srcpix = psrc[iy];
  		    iy = ++iy < tileHeight ? iy : 0;
  		    nlw = nlwMiddle;
! 		    Duff(nlw, *p++ OPEQ srcpix);
! 		    p += nlwExtra;
  		}
  	    }
  	}
--- 298,305 ----
  		    srcpix = psrc[iy];
  		    iy = ++iy < tileHeight ? iy : 0;
  		    nlw = nlwMiddle;
! 		    Duff(nlw, *MAPRW(p) OPEQ srcpix; p++; CHECKRWO(p));
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	}
diff -c mit/server/ddx/mfb/mfbpolypnt.c:1.1.1.1 mit/server/ddx/mfb/mfbpolypnt.c:1.4
*** mit/server/ddx/mfb/mfbpolypnt.c:1.1.1.1	Sat Mar 12 00:35:54 1994
--- mit/server/ddx/mfb/mfbpolypnt.c	Sat Mar 12 00:35:54 1994
***************
*** 22,29 ****
--- 22,31 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbpolypnt.c,v 1.4 1993/03/27 09:01:00 dawes Exp $ */
  /* $XConsortium: mfbpolypnt.c,v 5.3 89/09/11 10:12:05 rws Exp $ */
  
+ #define BANKING_MODS
  #include "X.h"
  #include "Xprotostr.h"
  #include "pixmapstr.h"
***************
*** 78,83 ****
--- 80,87 ----
  	nlwidth = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(addrl)
+ 
      if ((mode == CoordModePrevious) && (npt > 1))
      {
  	for (ppt = pptInit + 1, nptTmp = npt - 1; --nptTmp >= 0; ppt++)
***************
*** 91,96 ****
--- 95,101 ----
      pbox = REGION_RECTS(pGCPriv->pCompositeClip);
      for (; --nbox >= 0; pbox++)
      {
+         int *tmpaddr;
  	if (rop == RROP_BLACK)
  	{
  	    for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++)
***************
*** 99,105 ****
  		y = ppt->y + pDrawable->y;
  		if ((x >= pbox->x1) && (x < pbox->x2) &&
  		    (y >= pbox->y1) && (y < pbox->y2))
! 		    *(addrl + (y * nlwidth) + (x >> 5)) &= rmask[x & 0x1f];
  	    }
  	}
  	else if (rop == RROP_WHITE)
--- 104,114 ----
  		y = ppt->y + pDrawable->y;
  		if ((x >= pbox->x1) && (x < pbox->x2) &&
  		    (y >= pbox->y1) && (y < pbox->y2))
!                 {
!                     tmpaddr = addrl + (y * nlwidth) + (x >> 5);
!                     SETRW(tmpaddr);
! 		    *MAPRW(tmpaddr) &= rmask[x & 0x1f];
!                 }
  	    }
  	}
  	else if (rop == RROP_WHITE)
***************
*** 110,116 ****
  		y = ppt->y + pDrawable->y;
  		if ((x >= pbox->x1) && (x < pbox->x2) &&
  		    (y >= pbox->y1) && (y < pbox->y2))
! 		    *(addrl + (y * nlwidth) + (x >> 5)) |= mask[x & 0x1f];
  	    }
  	}
  	else if (rop == RROP_INVERT)
--- 119,129 ----
  		y = ppt->y + pDrawable->y;
  		if ((x >= pbox->x1) && (x < pbox->x2) &&
  		    (y >= pbox->y1) && (y < pbox->y2))
!                 {
! 		    tmpaddr = addrl + (y * nlwidth) + (x >> 5);
!                     SETRW(tmpaddr);
! 		    *MAPRW(tmpaddr) |= mask[x & 0x1f];
!                 }
  	    }
  	}
  	else if (rop == RROP_INVERT)
***************
*** 121,127 ****
  		y = ppt->y + pDrawable->y;
  		if ((x >= pbox->x1) && (x < pbox->x2) &&
  		    (y >= pbox->y1) && (y < pbox->y2))
! 		    *(addrl + (y * nlwidth) + (x >> 5)) ^= mask[x & 0x1f];
  	    }
  	}
      }
--- 134,144 ----
  		y = ppt->y + pDrawable->y;
  		if ((x >= pbox->x1) && (x < pbox->x2) &&
  		    (y >= pbox->y1) && (y < pbox->y2))
!                 {
! 		    tmpaddr = addrl + (y * nlwidth) + (x >> 5);
!                     SETRW(tmpaddr);
! 		    *MAPRW(tmpaddr) ^= mask[x & 0x1f];
!                 }
  	    }
  	}
      }
diff -c mit/server/ddx/mfb/mfbpushpxl.c:1.1.1.1 mit/server/ddx/mfb/mfbpushpxl.c:1.2
*** mit/server/ddx/mfb/mfbpushpxl.c:1.1.1.1	Sat Mar 12 00:35:54 1994
--- mit/server/ddx/mfb/mfbpushpxl.c	Sat Mar 12 00:35:54 1994
***************
*** 24,29 ****
--- 24,30 ----
  /* $XConsortium: mfbpushpxl.c,v 5.2 89/09/14 16:26:57 rws Exp $ */
  
  #include "X.h"
+ #include "mfb.h"
  #include "gcstruct.h"
  #include "scrnintstr.h"
  #include "pixmapstr.h"
***************
*** 30,36 ****
  #include "miscstruct.h"
  #include "maskbits.h"
  #include "regionstr.h"
- #include "mfb.h"
  
  /*  mfbSolidPP is courtesy of xhacks@csri.toronto.edu
  
--- 31,36 ----
diff -c mit/server/ddx/mfb/mfbscrclse.c:1.1.1.1 mit/server/ddx/mfb/mfbscrclse.c:1.3
*** mit/server/ddx/mfb/mfbscrclse.c:1.1.1.1	Sat Mar 12 00:35:55 1994
--- mit/server/ddx/mfb/mfbscrclse.c	Sat Mar 12 00:35:55 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/server/ddx/mfb/mfbscrclse.c,v 1.3 1993/03/27 09:01:01 dawes Exp $ */
  /* $XConsortium: mfbscrclse.c,v 1.7 89/07/18 20:05:04 rws Exp $ */
  /***********************************************************
  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
***************
*** 24,29 ****
--- 25,31 ----
  ******************************************************************/
  
  #include "scrnintstr.h"
+ #include "mfb.h"
  
  /*ARGSUSED*/
  Bool
diff -c mit/server/ddx/mfb/mfbsetsp.c:1.1.1.1 mit/server/ddx/mfb/mfbsetsp.c:2.0
*** mit/server/ddx/mfb/mfbsetsp.c:1.1.1.1	Sat Mar 12 00:35:55 1994
--- mit/server/ddx/mfb/mfbsetsp.c	Sat Mar 12 00:35:55 1994
***************
*** 22,29 ****
--- 22,31 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbsetsp.c,v 2.0 1993/09/09 05:59:54 dawes Exp $ */
  /* $XConsortium: mfbsetsp.c,v 5.3 89/09/13 18:58:28 rws Exp $ */
  
+ #define BANKING_MODS
  #include "X.h"
  #include "Xmd.h"
  
***************
*** 66,72 ****
--- 68,77 ----
      int		offSrc;
      int		startmask, endmask, nlMiddle, nl;
  
+     BANK_FLAG(pdstBase)
+ 
      pdst = pdstBase + (y * widthDst) + (xStart >> 5); 
+     SETRW(pdst);
      psrc += (xStart - xOrigin) >> 5;
      offSrc = (xStart - xOrigin) & 0x1f;
      w = xEnd - xStart;
***************
*** 91,97 ****
  	if (startmask) 
  	{ 
  	    getandputrop(psrc, offSrc, dstBit, nstart, pdst, alu)
! 	    pdst++; 
  	    offSrc += nstart;
  	    if (offSrc > 31)
  	    {
--- 96,102 ----
  	if (startmask) 
  	{ 
  	    getandputrop(psrc, offSrc, dstBit, nstart, pdst, alu)
! 	    pdst++; CHECKRWO(pdst); 
  	    offSrc += nstart;
  	    if (offSrc > 31)
  	    {
***************
*** 103,110 ****
  	while (nl--) 
  	{ 
  	    getbits(psrc, offSrc, 32, tmpSrc);
! 	    DoRop(*pdst, alu, tmpSrc, *pdst); 
! 	    pdst++; 
  	    psrc++; 
  	} 
  	if (endmask) 
--- 108,115 ----
  	while (nl--) 
  	{ 
  	    getbits(psrc, offSrc, 32, tmpSrc);
! 	    DoRop(*MAPR(pdst), alu, tmpSrc, *MAPR(pdst)); 
! 	    pdst++; CHECKRWO(pdst); 
  	    psrc++; 
  	} 
  	if (endmask) 
***************
*** 142,148 ****
      int			xStart, xEnd;
      int			yMax;
  
!     alu = pGC->alu;
      prgnDst = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
  
      pptLast = ppt + nspans;
--- 147,153 ----
      int			xStart, xEnd;
      int			yMax;
  
!     alu = pGC->planemask & 0x00000001 ? pGC->alu : GXclear;
      prgnDst = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
  
      pptLast = ppt + nspans;
diff -c mit/server/ddx/mfb/mfbtegblt.c:1.1.1.1 mit/server/ddx/mfb/mfbtegblt.c:1.6
*** mit/server/ddx/mfb/mfbtegblt.c:1.1.1.1	Sat Mar 12 00:35:56 1994
--- mit/server/ddx/mfb/mfbtegblt.c	Sat Mar 12 00:35:56 1994
***************
*** 1,4 ****
--- 1,5 ----
  /* $XConsortium: mfbtegblt.c,v 5.7 91/05/26 09:02:16 rws Exp $ */
+ /* $XFree86: mit/server/ddx/mfb/mfbtegblt.c,v 1.6 1993/03/27 09:01:05 dawes Exp $ */
  /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
  /***********************************************************
  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
***************
*** 23,28 ****
--- 24,30 ----
  SOFTWARE.
  
  ******************************************************************/
+ #define BANKING_MODS
  #include	"X.h"
  #include	"Xmd.h"
  #include	"Xproto.h"
***************
*** 81,90 ****
--- 83,105 ----
  			SCRRIGHT (*char3++ << ShiftAmnt, xoff3) | \
  			SCRRIGHT (*char4++ << ShiftAmnt, xoff4);
  #else
+ /*
+  * Note that SCRRIGHT evaluates its first argument 4 times when
+  * BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER
+  * DHD 10/92
+  */
+ #if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
  #define GetBits4    c = *char1++ | \
  			SCRRIGHT (*char2++, xoff2) | \
  			SCRRIGHT (*char3++, xoff3) | \
  			SCRRIGHT (*char4++, xoff4);
+ #else
+ #define GetBits4    c = *char1++ | \
+ 			SCRRIGHT (*char2, xoff2) | \
+ 			SCRRIGHT (*char3, xoff3) | \
+ 			SCRRIGHT (*char4, xoff4); \
+ 			char2++; char3++; char4++;
+ #endif
  #endif
  
  
***************
*** 161,166 ****
--- 176,183 ----
  	widthDst = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
      }
  
+     BANK_FLAG(pdstBase)
+ 
      xpos = x + pDrawable->x;
      ypos = y + pDrawable->y;
  
***************
*** 227,232 ****
--- 244,250 ----
  
  	    hTmp = h;
  	    dst = pdstBase + (xpos >> 5);
+             SETRW(dst);
  
  #ifndef FASTCHARS
  	    if (xoff1 + widthGlyphs <= 32)
***************
*** 242,250 ****
  # endif
  		    FASTPUTBITS(OP(c), xoff1, widthGlyphs, dst);
  #else
! 		    *(dst) = (*dst) & ~startmask | OP(SCRRIGHT(c, xoff1)) & startmask;
  #endif
! 		    dst += widthDst;
  		}
  #ifndef FASTCHARS
  	    }
--- 260,268 ----
  # endif
  		    FASTPUTBITS(OP(c), xoff1, widthGlyphs, dst);
  #else
! 		    *MAPW(dst) = (*MAPR(dst)) & ~startmask | OP(SCRRIGHT(c, xoff1)) & startmask;
  #endif
! 		    dst += widthDst; CHECKRWO(dst);
  		}
  #ifndef FASTCHARS
  	    }
***************
*** 255,265 ****
  		while (hTmp--)
  		{
  		    GetBits4
! 		    dst[0] = dst[0] & ~startmask |
  			     OP(SCRRIGHT(c,xoff1)) & startmask;
! 		    dst[1] = dst[1] & ~endmask |
  			     OP(SCRLEFT(c,nfirst)) & endmask;
! 		    dst += widthDst;
  		}
  	    }
  #endif
--- 273,284 ----
  		while (hTmp--)
  		{
  		    GetBits4
! 		    *MAPW(&(dst[0])) = (*MAPR(&(dst[0]))) & ~startmask |
  			     OP(SCRRIGHT(c,xoff1)) & startmask;
!                     CHECKRWONEXT(dst);
! 		    *MAPW(&(dst[1])) = (*MAPR(&(dst[1]))) & ~endmask |
  			     OP(SCRLEFT(c,nfirst)) & endmask;
! 		    dst += widthDst; CHECKRWO(dst);
  		}
  	    }
  #endif
***************
*** 273,278 ****
--- 292,298 ----
  	char1 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
  	hTmp = h;
  	dst = pdstBase + (xpos >> 5);
+         SETRW(dst);
  
  #ifndef FASTCHARS
  	if (xoff1 + widthGlyph <= 32)
***************
*** 294,302 ****
  		FASTPUTBITS (OP(c),xoff1,widthGlyph,dst);
  #else
  		GetBits1
! 		(*dst) = (*dst) & ~startmask | OP(SCRRIGHT(c, xoff1)) & startmask;
  #endif
! 		dst += widthDst;
  	    }
  #ifndef FASTCHARS
  	}
--- 314,322 ----
  		FASTPUTBITS (OP(c),xoff1,widthGlyph,dst);
  #else
  		GetBits1
! 		*MAPW(dst) = (*MAPR(dst)) & ~startmask | OP(SCRRIGHT(c, xoff1)) & startmask;
  #endif
! 		dst += widthDst; CHECKRWO(dst);
  	    }
  #ifndef FASTCHARS
  	}
***************
*** 307,317 ****
  	    while (hTmp--)
  	    {
  		GetBits1
! 		dst[0] = dst[0] & ~startmask |
  			 OP(SCRRIGHT(c,xoff1)) & startmask;
! 		dst[1] = dst[1] & ~endmask |
  			 OP(SCRLEFT(c,nfirst)) & endmask;
! 		dst += widthDst;
  	    }
  	}
  #endif
--- 327,338 ----
  	    while (hTmp--)
  	    {
  		GetBits1
! 		*MAPW(&(dst[0])) = (*MAPR(&(dst[0]))) & ~startmask |
  			 OP(SCRRIGHT(c,xoff1)) & startmask;
!                 CHECKRWONEXT(dst);
! 		*MAPW(&(dst[1])) = (*MAPR(&(dst[1]))) & ~endmask |
  			 OP(SCRLEFT(c,nfirst)) & endmask;
! 		dst += widthDst; CHECKRWO(dst);
  	    }
  	}
  #endif
diff -c mit/server/ddx/mfb/mfbtile.c:1.1.1.1 mit/server/ddx/mfb/mfbtile.c:1.4
*** mit/server/ddx/mfb/mfbtile.c:1.1.1.1	Sat Mar 12 00:35:56 1994
--- mit/server/ddx/mfb/mfbtile.c	Sat Mar 12 00:35:56 1994
***************
*** 22,28 ****
--- 22,30 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mfb/mfbtile.c,v 1.4 1993/03/27 09:01:06 dawes Exp $ */
  /* $XConsortium: mfbtile.c,v 5.3 90/05/15 18:38:21 keith Exp $ */
+ #define BANKING_MODS
  #include "X.h"
  
  #include "windowstr.h"
***************
*** 88,93 ****
--- 90,97 ----
  	nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
      }
  
+     BANK_FLAG(pbits)
+ 
      MROP_INITIALIZE(alu,~0)
  
      tileHeight = ptile->drawable.height;
***************
*** 99,104 ****
--- 103,109 ----
  	h = pbox->y2 - pbox->y1;
  	iy = pbox->y1 % tileHeight;
  	p = pbits + (pbox->y1 * nlwidth) + (pbox->x1 >> 5);
+         SETRW(p);
  
  	if ( ((pbox->x1 & 0x1f) + w) < 32)
  	{
***************
*** 110,117 ****
  		iy++;
  		if (iy == tileHeight)
  		    iy = 0;
! 		*p = MROP_MASK(srcpix,*p,startmask);
! 		p += nlwExtra;
  	    }
  	}
  	else
--- 115,122 ----
  		iy++;
  		if (iy == tileHeight)
  		    iy = 0;
! 		*MAPW(p) = MROP_MASK(srcpix,*MAPR(p),startmask);
! 		p += nlwExtra; CHECKRWO(p);
  	    }
  	}
  	else
***************
*** 129,144 ****
  		    if (iy == tileHeight)
  			iy = 0;
  		    nlw = nlwMiddle;
! 		    *p = MROP_MASK (srcpix,*p,startmask);
! 		    p++;
  		    while (nlw--)
  		    {
! 			*p = MROP_SOLID(srcpix,*p);
! 			p++;
  		    }
  
! 		    *p = MROP_MASK(srcpix,*p,endmask);
! 		    p += nlwExtra;
  		}
  	    }
  	    else if (startmask && !endmask)
--- 134,149 ----
  		    if (iy == tileHeight)
  			iy = 0;
  		    nlw = nlwMiddle;
! 		    *MAPW(p) = MROP_MASK (srcpix,*MAPR(p),startmask);
! 		    p++; CHECKRWO(p);
  		    while (nlw--)
  		    {
! 			*MAPW(p) = MROP_SOLID(srcpix,*MAPR(p));
! 			p++; CHECKRWO(p);
  		    }
  
! 		    *MAPW(p) = MROP_MASK(srcpix,*MAPR(p),endmask);
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	    else if (startmask && !endmask)
***************
*** 151,164 ****
  		    if (iy == tileHeight)
  			iy = 0;
  		    nlw = nlwMiddle;
! 		    *p = MROP_MASK(srcpix,*p,startmask);
! 		    p++;
  		    while (nlw--)
  		    {
! 			*p = MROP_SOLID(srcpix,*p);
! 			p++;
  		    }
! 		    p += nlwExtra;
  		}
  	    }
  	    else if (!startmask && endmask)
--- 156,169 ----
  		    if (iy == tileHeight)
  			iy = 0;
  		    nlw = nlwMiddle;
! 		    *MAPW(p) = MROP_MASK(srcpix,*MAPR(p),startmask);
! 		    p++; CHECKRWO(p);
  		    while (nlw--)
  		    {
! 			*MAPW(p) = MROP_SOLID(srcpix,*MAPR(p));
! 			p++; CHECKRWO(p);
  		    }
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	    else if (!startmask && endmask)
***************
*** 172,183 ****
  		    nlw = nlwMiddle;
  		    while (nlw--)
  		    {
! 			*p = MROP_SOLID(srcpix,*p);
! 			p++;
  		    }
  
! 		    *p = MROP_MASK(srcpix,*p,endmask);
! 		    p += nlwExtra;
  		}
  	    }
  	    else /* no ragged bits at either end */
--- 177,188 ----
  		    nlw = nlwMiddle;
  		    while (nlw--)
  		    {
! 			*MAPW(p) = MROP_SOLID(srcpix,*MAPR(p));
! 			p++; CHECKRWO(p);
  		    }
  
! 		    *MAPW(p) = MROP_MASK(srcpix,*MAPR(p),endmask);
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	    else /* no ragged bits at either end */
***************
*** 191,200 ****
  		    nlw = nlwMiddle;
  		    while (nlw--)
  		    {
! 			*p = MROP_SOLID (srcpix,*p);
! 			p++;
  		    }
! 		    p += nlwExtra;
  		}
  	    }
  	}
--- 196,205 ----
  		    nlw = nlwMiddle;
  		    while (nlw--)
  		    {
! 			*MAPW(p) = MROP_SOLID (srcpix,*MAPR(p));
! 			p++; CHECKRWO(p);
  		    }
! 		    p += nlwExtra; CHECKRWO(p);
  		}
  	    }
  	}
diff -c mit/server/ddx/mfb/mfbzerarc.c:1.1.1.1 mit/server/ddx/mfb/mfbzerarc.c:1.6
*** mit/server/ddx/mfb/mfbzerarc.c:1.1.1.1	Sat Mar 12 00:35:57 1994
--- mit/server/ddx/mfb/mfbzerarc.c	Sat Mar 12 00:35:57 1994
***************
*** 15,20 ****
--- 15,21 ----
  
  ********************************************************/
  
+ /* $XFree86: mit/server/ddx/mfb/mfbzerarc.c,v 1.6 1993/03/27 09:01:09 dawes Exp $ */
  /* $XConsortium: mfbzerarc.c,v 5.10 89/09/20 18:55:33 rws Exp $ */
  
  /* Derived from:
***************
*** 23,28 ****
--- 24,30 ----
   * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289
   */
  
+ #define BANKING_MODS
  #include "X.h"
  #include "Xprotostr.h"
  #include "miscstruct.h"
***************
*** 34,56 ****
  #include "mizerarc.h"
  
  extern void miPolyArc(), miZeroPolyArc();
  
  #if (BITMAP_BIT_ORDER == MSBFirst)
  #define LEFTMOST	((unsigned int) 0x80000000)
  #else
  #define LEFTMOST	((unsigned int) 1)
  #endif
  
  #define PixelateWhite(addr,off) \
!     (addr)[(off)>>5] |= SCRRIGHT (LEFTMOST, ((off) & 0x1f))
  #define PixelateBlack(addr,off) \
!     (addr)[(off)>>5] &= ~(SCRRIGHT (LEFTMOST, ((off) & 0x1f)))
  
  #define Pixelate(base,off) \
  { \
      paddr = base + ((off)>>5); \
      pmask = SCRRIGHT(LEFTMOST, (off) & 0x1f); \
!     *paddr = (*paddr & ~pmask) | (pixel & pmask); \
  }
  
  #define DoPix(bit,base,off) if (mask & bit) Pixelate(base,off);
--- 36,88 ----
  #include "mizerarc.h"
  
  extern void miPolyArc(), miZeroPolyArc();
+ /*
+  * Note, LEFTMOST must be the bit leftmost in the actual screen
+  * representation.  This depends on both BITMAP_BIT_ORDER and
+  * IMAGE_BYTE_ORDER
+  * DHD 10/92
+  */
  
  #if (BITMAP_BIT_ORDER == MSBFirst)
+ #if (IMAGE_BYTE_ORDER == MSBFirst)
  #define LEFTMOST	((unsigned int) 0x80000000)
  #else
+ #define LEFTMOST	((unsigned int) 0x80)
+ #endif
+ #else
+ #if (IMAGE_BYTE_ORDER == LSBFirst)
  #define LEFTMOST	((unsigned int) 1)
+ #else
+ #define LEFTMOST	((unsigned int) 0x1000000)
  #endif
+ #endif
  
+ #ifdef BANKED_MFB
+ #define PixelateWhite(addr,off) \
+ { \
+     register int *tmpaddr = &((addr)[(off)>>5]); \
+     SETRW(tmpaddr); \
+     *MAPRW(tmpaddr) |= SCRRIGHT (LEFTMOST, ((off) & 0x1f)); \
+ }
+ #define PixelateBlack(addr,off) \
+ { \
+     register int *tmpaddr = &((addr)[(off)>>5]); \
+     SETRW(tmpaddr); \
+     *MAPRW(tmpaddr) &= ~(SCRRIGHT (LEFTMOST, ((off) & 0x1f))); \
+ }
+ #else
  #define PixelateWhite(addr,off) \
!     *MAPRW(&((addr)[(off)>>5])) |= SCRRIGHT (LEFTMOST, ((off) & 0x1f))
  #define PixelateBlack(addr,off) \
!     *MAPRW(&((addr)[(off)>>5])) &= ~(SCRRIGHT (LEFTMOST, ((off) & 0x1f)))
! #endif
  
  #define Pixelate(base,off) \
  { \
      paddr = base + ((off)>>5); \
      pmask = SCRRIGHT(LEFTMOST, (off) & 0x1f); \
!     SETRW(paddr); \
!     *MAPW(paddr) = (*MAPR(paddr) & ~pmask) | (pixel & pmask); \
  }
  
  #define DoPix(bit,base,off) if (mask & bit) Pixelate(base,off);
***************
*** 90,95 ****
--- 122,130 ----
  	addrl = (int *)(((PixmapPtr)pDraw)->devPrivate.ptr);
  	nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
      }
+ 
+     BANK_FLAG(addrl)
+ 
      do360 = miZeroArcSetup(arc, &info, TRUE);
      yorgl = addrl + ((info.yorg + pDraw->y) * nlwidth);
      yorgol = addrl + ((info.yorgo + pDraw->y) * nlwidth);
diff -c mit/server/ddx/mi/Imakefile:1.1.1.1 mit/server/ddx/mi/Imakefile:2.2
*** mit/server/ddx/mi/Imakefile:1.1.1.1	Sat Mar 12 00:36:01 1994
--- mit/server/ddx/mi/Imakefile	Sat Mar 12 00:36:01 1994
***************
*** 1,6 ****
--- 1,11 ----
+ XCOMM $XFree86: mit/server/ddx/mi/Imakefile,v 2.2 1993/09/22 15:41:22 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.16 91/07/23 15:19:39 keith Exp $
  #include <Server.tmpl>
  
+ #ifdef XFree86Version
+ SRC2 = mibitblt_m.c
+ #endif
+ 
  SRCS =  mivaltree.c mipolyseg.c mipolyrect.c \
  	mipoly.c mipolycon.c mipolygen.c mipolyutil.c \
  	mifillrct.c miwideline.c mispans.c \
***************
*** 9,15 ****
  	mipolytext.c mibitblt.c mipolypnt.c mipushpxl.c\
  	miexpose.c miglblt.c mizerline.c mifpolycon.c \
  	midash.c mibstore.c miinitext.c mieq.c \
! 	mipointer.c misprite.c midispcur.c miscrinit.c miclipn.c
  
  OBJS =	mivaltree.o mipolyseg.o mipolyrect.o \
  	mipoly.o mipolycon.o mipolygen.o mipolyutil.o \
--- 14,27 ----
  	mipolytext.c mibitblt.c mipolypnt.c mipushpxl.c\
  	miexpose.c miglblt.c mizerline.c mifpolycon.c \
  	midash.c mibstore.c miinitext.c mieq.c \
! 	mipointer.c misprite.c midispcur.c miscrinit.c miclipn.c $(SRC2)
! 
! #ifndef XFree86Version
! OBJ2 = mibitblt.o
! #else
! OBJ3 = mibitblt.o
! OBJ4 = mibitblt_m.o
! #endif
  
  OBJS =	mivaltree.o mipolyseg.o mipolyrect.o \
  	mipoly.o mipolycon.o mipolygen.o mipolyutil.o \
***************
*** 16,25 ****
  	mifillrct.o miwideline.o mispans.o \
  	miarc.o mizerarc.o mifillarc.o \
  	miwindow.o micursor.o miregion.o \
! 	mipolytext.o mibitblt.o mipolypnt.o mipushpxl.o\
  	miexpose.o miglblt.o mizerline.o mifpolycon.o \
  	midash.o mibstore.o miinitext.o mieq.o \
! 	mipointer.o misprite.o midispcur.o miscrinit.o miclipn.o
  
  INCLUDES = -I. -I../../include -I$(INCLUDESRC) -I$(FONTSRC)/include
  LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln
--- 28,38 ----
  	mifillrct.o miwideline.o mispans.o \
  	miarc.o mizerarc.o mifillarc.o \
  	miwindow.o micursor.o miregion.o \
! 	mipolytext.o mipolypnt.o mipushpxl.o\
  	miexpose.o miglblt.o mizerline.o mifpolycon.o \
  	midash.o mibstore.o miinitext.o mieq.o \
! 	mipointer.o misprite.o midispcur.o miscrinit.o miclipn.o $(OBJ2)
! 
  
  INCLUDES = -I. -I../../include -I$(INCLUDESRC) -I$(FONTSRC)/include
  LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln
***************
*** 29,37 ****
  LintLibraryTarget(mi,$(SRCS))
  NormalLintTarget($(SRCS))
  
! all:: cbrt.o
  
! SpecialObjectRule(miinitext.o, $(ICONFIGFILES), NullParameter)
  
  #if HasSaberC
  saber_src:
--- 42,63 ----
  LintLibraryTarget(mi,$(SRCS))
  NormalLintTarget($(SRCS))
  
! all:: cbrt.o $(OBJ3) $(OBJ4)
  
! #ifdef XFree86Version
! ObjectFromSpecialSource(mibitblt_m,mibitblt,MonoDefines)
! #endif
! 
! SpecialObjectRule(miinitext.o, miinitext.c $(ICONFIGFILES), NullParameter)
! 
! InstallLinkKitLibrary(mi,$(LINKKITDIR)/lib)
! InstallLinkKitNonExecFile(mibitblt.o,$(LINKKITDIR)/lib)
! InstallLinkKitNonExecFile(mibitblt_m.o,$(LINKKITDIR)/lib)
! InstallLinkKitNonExecFile(mibstore.h,$(LINKKITDIR)/include)
! 
! #if defined(i386SVR3Architecture) || defined(LinuxArchitecture) || Amoeba || Minix
! InstallLinkKitNonExecFile(cbrt.o,$(LINKKITDIR)/lib)
! #endif
  
  #if HasSaberC
  saber_src:
diff -c mit/server/ddx/mi/cbrt.c:1.1.1.1 mit/server/ddx/mi/cbrt.c:2.0
*** mit/server/ddx/mi/cbrt.c:1.1.1.1	Sat Mar 12 00:36:01 1994
--- mit/server/ddx/mi/cbrt.c	Sat Mar 12 00:36:01 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/server/ddx/mi/cbrt.c,v 2.0 1994/03/06 06:42:53 dawes Exp $ */
  /* $XConsortium: cbrt.c,v 1.0 90/09/29 10:24:02 rws Exp $ */
  
  /* simple cbrt, in case your math library doesn't have a good one */
***************
*** 8,12 ****
  cbrt(x)
      double x;
  {
!     return pow(x, 1.0/3.0);
  }
--- 9,16 ----
  cbrt(x)
      double x;
  {
!     if (x > 0.0)
! 	return pow(x, 1.0/3.0);
!     else
! 	return -pow(-x, 1.0/3.0);
  }
diff -c mit/server/ddx/mi/miarc.c:1.1.1.2 mit/server/ddx/mi/miarc.c:2.0
*** mit/server/ddx/mi/miarc.c:1.1.1.2	Sat Mar 12 00:36:02 1994
--- mit/server/ddx/mi/miarc.c	Sat Mar 12 00:36:02 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mi/miarc.c,v 2.0 1993/07/26 14:35:21 dawes Exp $ */
  /* $XConsortium: miarc.c,v 5.41 92/05/17 10:50:34 rws Exp $ */
  /* Author: Keith Packard */
  
***************
*** 37,44 ****
  #include "mifillarc.h"
  #include "Xfuncproto.h"
  
! #if defined(SVR4) && __STDC__
! extern double hypot(double, double);
  #endif
  static double miDsin(), miDcos(), miDasin(), miDatan2();
  double	cbrt(
--- 38,49 ----
  #include "mifillarc.h"
  #include "Xfuncproto.h"
  
! #if (defined(SVR4) && __STDC__) || defined(AMOEBA) || defined(_MINIX)
! extern double hypot(
! #if NeedFunctionPrototypes
! 	double, double
! #endif
! );
  #endif
  static double miDsin(), miDcos(), miDasin(), miDatan2();
  double	cbrt(
***************
*** 145,152 ****
  #undef max
  #undef min
  
! #if defined (__GNUC__) && defined (__STDC__) && !defined (__STRICT_ANSI__)
  #define USE_INLINE
  #endif
  
  #ifdef USE_INLINE
--- 150,160 ----
  #undef max
  #undef min
  
! #if defined (__GNUC__) && defined (__STDC__)
  #define USE_INLINE
+ #if defined(__STRICT_ANSI__)
+ # define inline __inline__
+ #endif
  #endif
  
  #ifdef USE_INLINE
diff -c mit/server/ddx/mi/mibitblt.c:1.1.1.1 mit/server/ddx/mi/mibitblt.c:2.0
*** mit/server/ddx/mi/mibitblt.c:1.1.1.1	Sat Mar 12 00:36:03 1994
--- mit/server/ddx/mi/mibitblt.c	Sat Mar 12 00:36:03 1994
***************
*** 21,26 ****
--- 21,27 ----
  SOFTWARE.
  
  ******************************************************************/
+ /* $XFree86: mit/server/ddx/mi/mibitblt.c,v 2.0 1993/09/09 06:00:28 dawes Exp $ */
  /* $XConsortium: mibitblt.c,v 5.14 91/04/07 17:09:36 keith Exp $ */
  /* Author: Todd Newman  (aided and abetted by Mr. Drewry) */
  
***************
*** 610,615 ****
--- 611,620 ----
      depth = pDraw->depth;
      if(format == ZPixmap)
      {
+         linelength = PixmapBytePad(w, depth);
+ 	srcx = sx + pDraw->x;
+ 	srcy = sy + pDraw->y;
+ 
  	if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
  	{
  	    pGC = GetScratchGC(depth, pDraw->pScreen);
***************
*** 616,627 ****
  	    if (!pGC)
  		return;
              pPixmap = (*pDraw->pScreen->CreatePixmap)
! 			       (pDraw->pScreen, w, h, depth);
  	    if (!pPixmap)
  	    {
  		FreeScratchGC(pGC);
  		return;
  	    }
  	    gcv[0] = GXcopy;
  	    gcv[1] = planeMask;
  	    DoChangeGC(pGC, GCPlaneMask | GCFunction, gcv, 0);
--- 621,633 ----
  	    if (!pGC)
  		return;
              pPixmap = (*pDraw->pScreen->CreatePixmap)
! 			       (pDraw->pScreen, w, 1, depth);
  	    if (!pPixmap)
  	    {
  		FreeScratchGC(pGC);
  		return;
  	    }
+ 	    bzero((char *)(pPixmap->devPrivate.ptr), linelength);
  	    gcv[0] = GXcopy;
  	    gcv[1] = planeMask;
  	    DoChangeGC(pGC, GCPlaneMask | GCFunction, gcv, 0);
***************
*** 628,636 ****
  	    ValidateGC((DrawablePtr)pPixmap, pGC);
  	}
  
-         linelength = PixmapBytePad(w, depth);
- 	srcx = sx + pDraw->x;
- 	srcy = sy + pDraw->y;
  	for(i = 0; i < h; i++)
  	{
  	    pt.x = srcx;
--- 634,639 ----
diff -c mit/server/ddx/mi/mibstore.c:1.1.1.1 mit/server/ddx/mi/mibstore.c:2.0
*** mit/server/ddx/mi/mibstore.c:1.1.1.1	Sat Mar 12 00:36:04 1994
--- mit/server/ddx/mi/mibstore.c	Sat Mar 12 00:36:05 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/server/ddx/mi/mibstore.c,v 2.0 1993/09/21 15:17:25 dawes Exp $ */
  /* $XConsortium: mibstore.c,v 5.50 91/07/10 19:06:50 keith Exp $ */
  /***********************************************************
  Copyright 1987 by the Regents of the University of California
***************
*** 3754,3757 ****
--- 3755,3759 ----
  	}
  	break;
      }
+     (* pGC->pScreen->RegionDestroy)(tempRgn); /* hasty */
  }
diff -c /dev/null mit/server/ddx/mi/micache.h:2.0
*** /dev/null	Sat Mar 12 00:36:06 1994
--- mit/server/ddx/mi/micache.h	Sat Mar 12 00:36:06 1994
***************
*** 0 ****
--- 1,18 ----
+ /*-
+  * micache.h --
+  * 	Header file for users of the MI Pixmap cache scheme
+  *
+  */
+ 
+ /* $XFree86: mit/server/ddx/mi/micache.h,v 2.0 1993/07/24 07:13:58 dawes Exp $ */
+ 
+ #ifndef _MICACHE_H
+ #define _MICACHE_H
+ 
+ /*
+  * Functionpointer for the Pixmap cache of the accelerated servers
+  */
+ 
+ extern void (* miCacheFreeSlot)();
+ 
+ #endif /* _MICACHE_H */
diff -c mit/server/ddx/mi/miscrinit.c:1.1.1.1 mit/server/ddx/mi/miscrinit.c:2.0
*** mit/server/ddx/mi/miscrinit.c:1.1.1.1	Sat Mar 12 00:36:06 1994
--- mit/server/ddx/mi/miscrinit.c	Sat Mar 12 00:36:06 1994
***************
*** 14,19 ****
--- 14,20 ----
  
  */
  
+ /* $XFree86: mit/server/ddx/mi/miscrinit.c,v 2.0 1993/07/24 07:13:59 dawes Exp $ */
  /* $XConsortium: miscrinit.c,v 5.2 91/05/14 11:17:40 rws Exp $ */
  
  #include "X.h"
***************
*** 24,29 ****
--- 25,36 ----
  #include "pixmapstr.h"
  #include "mibstore.h"
  #include "dix.h"
+ 
+ /*
+  * Functionpointer for the Pixmap cache of the accelerated servers
+  */
+ 
+ void (* miCacheFreeSlot)() = NoopDDA;
  
  /*ARGSUSED*/
  static Bool
diff -c mit/server/ddx/mi/miwidearc.c:1.1.1.1 mit/server/ddx/mi/miwidearc.c:1.2
*** mit/server/ddx/mi/miwidearc.c:1.1.1.1	Sat Mar 12 00:36:07 1994
--- mit/server/ddx/mi/miwidearc.c	Sat Mar 12 00:36:07 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/server/ddx/mi/miwidearc.c,v 1.2 1993/03/20 03:49:23 dawes Exp $
   * $XConsortium: miwidearc.c,v 1.6 91/08/23 12:14:41 gildea Exp $
   *
   * Copyright 1990 Massachusetts Institute of Technology
***************
*** 35,43 ****
  #include "mifillarc.h"
  #include "miwideline.h"
  
! #if (defined(SVR4) || defined(SYSV) && defined(SYSV386)) && __STDC__
! extern double hypot(double, double);
  #endif
  
  typedef struct _dpoint {
      double	x, y;
--- 36,49 ----
  #include "mifillarc.h"
  #include "miwideline.h"
  
! #if ((defined(SVR4) || defined(SYSV) && defined(SYSV386)) && __STDC__) || defined(AMOEBA) || defined(_MINIX)
! extern double hypot(
! #if NeedFunctionPrototypes
!         double, double
  #endif
+ );
+ #endif
+ 
  
  typedef struct _dpoint {
      double	x, y;
diff -c mit/server/ddx/mi/miwideline.c:1.1.1.3 mit/server/ddx/mi/miwideline.c:1.2
*** mit/server/ddx/mi/miwideline.c:1.1.1.3	Sat Mar 12 00:36:08 1994
--- mit/server/ddx/mi/miwideline.c	Sat Mar 12 00:36:08 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/server/ddx/mi/miwideline.c,v 1.2 1993/03/20 03:49:26 dawes Exp $
   * $XConsortium: miwideline.c,v 1.45 91/11/20 15:33:19 keith Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 29,36 ****
  #include "miscstruct.h"
  #include "miwideline.h"
  
! #if (defined(SVR4) || defined(SYSV) && defined(SYSV386)) && __STDC__
! extern double hypot(double, double);
  #endif
  
  #ifdef ICEILTEMPDECL
--- 30,41 ----
  #include "miscstruct.h"
  #include "miwideline.h"
  
! #if ((defined(SVR4) || defined(SYSV) && defined(SYSV386)) && __STDC__) || defined(AMOEBA) || defined(_MINIX)
! extern double hypot(
! #if NeedFunctionPrototypes
!         double, double
! #endif
! );
  #endif
  
  #ifdef ICEILTEMPDECL
diff -c mit/Imakefile:1.1.1.1 mit/Imakefile:2.0
*** mit/Imakefile:1.1.1.1	Sat Mar 12 00:36:09 1994
--- mit/Imakefile	Sat Mar 12 00:36:09 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/Imakefile,v 2.0 1993/12/17 10:56:22 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.105 91/07/27 14:13:23 rws Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags
***************
*** 9,17 ****
  #if BuildServer
  SERVERDIRSTOMAKE = server rgb
  #endif
          SUBDIRS = config include lib extensions fonts $(SERVERDIRSTOMAKE) \
! 			clients demos util man
    LNINSTALLDIRS = $(LIBSRC) $(EXTENSIONSRC)
  
  MakeSubdirs($(SUBDIRS))
  
--- 10,26 ----
  #if BuildServer
  SERVERDIRSTOMAKE = server rgb
  #endif
+ 
+ #if !BuildServersOnly
+      CLIENTDIRS = clients
+        DEMODIRS = demos
+         MANDIRS = man
+ #endif
+ 
          SUBDIRS = config include lib extensions fonts $(SERVERDIRSTOMAKE) \
! 			$(CLIENTDIRS) $(DEMODIRS) util $(MANDIRS)
    LNINSTALLDIRS = $(LIBSRC) $(EXTENSIONSRC)
+ 
  
  MakeSubdirs($(SUBDIRS))
  
diff -c /dev/null mit/config/Cross.rules:1.2
*** /dev/null	Sat Mar 12 00:36:14 1994
--- mit/config/Cross.rules	Sat Mar 12 00:36:14 1994
***************
*** 0 ****
--- 1,321 ----
+ XCOMM -------------------------------------------------------------------------
+ XCOMM Cross.rules:  override a number default defines from Imake.rules
+ XCOMM to make it possible to cross compile the X11 tree.
+ XCOMM $XFree86: mit/config/Cross.rules,v 1.2 1993/03/25 14:16:59 dawes Exp $
+ 
+ #ifndef NormalProgramTarget
+ #define	NormalProgramTarget(program,objects,deplibs,locallibs,syslibs)	@@\
+ program: objects deplibs						@@\
+ 	RemoveTargetProgram($@)						@@\
+ 	$(LD) $(ALDFLAGS) $(HEAD) -o $@ objects $(LDOPTIONS) locallibs $(LDLIBS) syslibs $(EXTRA_LOAD_FLAGS) @@\
+ 									@@\
+ clean::									@@\
+ 	$(RM) program
+ #endif /* NormalProgramTarget */
+ 
+ 
+ #ifndef ComplexProgramTarget
+ #define	ComplexProgramTarget(program)					@@\
+         PROGRAM = program						@@\
+ 									@@\
+ AllTarget(program)							@@\
+ 									@@\
+ program: $(OBJS) $(DEPLIBS)						@@\
+ 	RemoveTargetProgram($@)						@@\
+ 	$(LD) $(ALDFLAGS) $(HEAD) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
+ 									@@\
+ SaberProgramTarget(program,$(SRCS),$(OBJS),$(LOCAL_LIBRARIES),NullParameter) @@\
+ 									@@\
+ InstallProgram(program,$(BINDIR))					@@\
+ InstallManPage(program,$(MANDIR))					@@\
+ DependTarget()								@@\
+ LintTarget()								@@\
+ 									@@\
+ clean::									@@\
+ 	$(RM) $(PROGRAM)
+ #endif /* ComplexProgramTarget */
+ 
+ /* ComplexCrossProgramTarget - generate rules for compiling and linking the 
+  * program specified by $(OBJS) and $(SRCS), installing the program and its
+  * man page, and generating dependencies.  It should only be used in 
+  * Imakefiles that describe a single program.
+  */
+ #ifndef ComplexCrossProgramTarget
+ #define	ComplexCrossProgramTarget(program)				@@\
+ STD_INCLUDES=								@@\
+ EXTRA_LOAD_FLAGS=							@@\
+         PROGRAM = program						@@\
+ 									@@\
+ AllTarget(program)							@@\
+ 									@@\
+ program: $(OBJS) $(DEPLIBS)						@@\
+ 	RemoveTargetProgram($@)						@@\
+ 	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
+ 									@@\
+ SaberProgramTarget(program,$(SRCS),$(OBJS),$(LOCAL_LIBRARIES), /**/)	@@\
+ 									@@\
+ DependTarget()								@@\
+ LintTarget()								@@\
+ 									@@\
+ clean::									@@\
+ 	$(RM) $(PROGRAM)
+ #endif /* ComplexProgramTarget */
+ 
+ 
+ #ifndef ComplexProgramTarget_1
+ #define	ComplexProgramTarget_1(program,locallib,syslib)			@@\
+             OBJS = $(OBJS1) $(OBJS2) $(OBJS3)				@@\
+             SRCS = $(SRCS1) $(SRCS2) $(SRCS3)				@@\
+ 									@@\
+ AllTarget($(PROGRAMS))							@@\
+ 									@@\
+ program: $(OBJS1) $(DEPLIBS1)						@@\
+ 	RemoveTargetProgram($@)						@@\
+ 	$(LD) $(ALDFLAGS) $(HEAD) -o $@ $(LDOPTIONS) $(OBJS1) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
+ 									@@\
+ InstallProgram(program,$(BINDIR))					@@\
+ InstallManPage(program,$(MANDIR))					@@\
+ 									@@\
+ SaberProgramTarget(program,$(SRCS1),$(OBJS1),locallib,syslib)		@@\
+ 									@@\
+ DependTarget()								@@\
+ LintTarget()								@@\
+ 									@@\
+ clean::									@@\
+ 	$(RM) $(PROGRAMS)
+ #endif /* ComplexProgramTarget_1 */
+ 
+ 
+ #ifndef ComplexProgramTarget_2
+ #define	ComplexProgramTarget_2(program,locallib,syslib)			@@\
+ program: $(OBJS2) $(DEPLIBS2)						@@\
+ 	RemoveTargetProgram($@)						@@\
+ 	$(LD) $(ALDFLAGS) $(HEAD) -o $@ $(LDOPTIONS) $(OBJS2) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
+ 									@@\
+ SaberProgramTarget(program,$(SRCS2),$(OBJS2),locallib,syslib)		@@\
+ 									@@\
+ InstallProgram(program,$(BINDIR))					@@\
+ InstallManPage(program,$(MANDIR))
+ #endif /* ComplexProgramTarget_2 */
+ 
+ 
+ #ifndef ComplexProgramTarget_3
+ #define	ComplexProgramTarget_3(program,locallib,syslib)			@@\
+ program: $(OBJS3) $(DEPLIBS3)						@@\
+ 	RemoveTargetProgram($@)						@@\
+ 	$(LD) $(ALDFLAGS) $(HEAD) -o $@ $(LDOPTIONS) $(OBJS3) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
+ 									@@\
+ SaberProgramTarget(program,$(SRCS3),$(OBJS3),locallib,syslib)		@@\
+ 									@@\
+ InstallProgram(program,$(BINDIR))					@@\
+ InstallManPage(program,$(MANDIR))
+ #endif /* ComplexProgramTarget_3 */
+ 
+ 
+ /* ServerTarget - generate rules to compile, link, and relink an X server
+  * for Amoeba or Minix
+  */
+ #if !defined(ServerTarget) && (defined(Amoeba) || defined(Minix))
+ #define	ServerTarget(server,subdirs,objects,libs,syslibs)		@@\
+ server: subdirs objects libs						@@\
+ 	-@if [ -f server ]; then echo "	$(MV) server server.bak"; \	@@\
+ 		$(MV) server server.bak; else exit 0; fi		@@\
+ 	$(LD) $(ALDFLAGS) $(HEAD) -o server objects libs $(EXTRA_LIBRARIES) syslibs $(OS_LIBRARIES) $(EXTRA_LOAD_FLAGS) @@\
+ 									@@\
+ Concat(load,server):							@@\
+ 	-@if [ -f server ]; then echo "	$(MV) server server.bak"; \	@@\
+ 		$(MV) server server.bak; else exit 0; fi		@@\
+ 	$(LD) $(ALDFLAGS) $(HEAD) -o server objects libs $(EXTRA_LIBRARIES) syslibs $(OS_LIBRARIES) $(EXTRA_LOAD_FLAGS)
+ #endif /* ServerTarget */
+ 
+ /*
+  * A few dummy Installation rules.
+  */
+ 
+ #ifndef InstallLibrary
+ #define	InstallLibrary(libname,dest)					@@\
+ install:: Concat(lib,libname.a)						@@\
+ 	@echo '** Cannot Install Library ' Concat(lib,libname.a)
+ #endif /* InstallLibrary */
+ 
+ #ifndef MergeIntoInstalledLibrary
+ #define MergeIntoInstalledLibrary(tolib,fromlib)			@@\
+ install::  fromlib							@@\
+ 	@echo '** Cannot merge ' fromlib into tolib
+ #endif /* MergeIntoInstalledLibrary */
+ 
+ #ifndef InstallLibraryAlias
+ #define	InstallLibraryAlias(libname,alias,dest)				@@\
+ install::								@@\
+ 	@echo '** Install lib alias yourself' libname alias dest
+ #endif /* InstallLibraryAlias */
+ 
+ #ifndef InstallLintLibrary
+ #define	InstallLintLibrary(libname,dest)				@@\
+ install.ln:: Concat(llib-l,libname.ln)					@@\
+ 	@echo '** Please install lintlib yourself' Concat(llib-l,libname.ln)
+ #endif /* InstallLintLibrary */
+ 
+ #ifndef InstallManPageLong
+ #define	InstallManPageLong(file,destdir,dest)				@@\
+ install.man:: file.man							@@\
+ 	@echo '** Install man page yourself' file.man
+ #endif /* InstallManPageLong */
+ 
+ 
+ #if Amoeba
+ /* Rest of the files is Amoeba specific.  It overrides the installation rules
+  * to cross-install the Amoeba binaries.
+  */
+ 
+ #ifndef InstallManPageAliases
+ #define	InstallManPageAliases(file,destdir,aliases)			@@\
+ install.man::								@@\
+ 	@(TMP=/tmp/tmp.$$$$; \						@@\
+ 	$(RM) $${TMP}; \						@@\
+ 	echo .so `basename destdir`/file.$(MANSUFFIX) > $${TMP}; \	@@\
+ 	for i in aliases; do (set -x; \					@@\
+ 	$(TOB) $${TMP} $(DESTDIR)destdir/$$i.$(MANSUFFIX)); \ 		@@\
+ 	done; \								@@\
+ 	$(RM) $${TMP})
+ #endif /* InstallManPageAliases */
+ 
+ 
+ /*
+  * InstallNamedNonExec - generate rules to install a data file
+  */
+ #ifndef InstallNamedNonExec
+ #define	InstallNamedNonExec(srcname,dstname,dest)			@@\
+ install:: srcname							@@\
+ 	$(MKXDIRHIER) $(DESTDIR)dest					@@\
+ 	$(TOB) srcname $(DESTDIR)dest/dstname
+ #endif /* InstallNamedNonExec */
+ 
+ 
+ /*
+  * InstallNonExecFile - generate rules to install a data file
+  */
+ #ifndef InstallNonExecFile
+ #define	InstallNonExecFile(file,dest)					@@\
+ install:: file								@@\
+ 	$(MKXDIRHIER) dest						@@\
+ 	$(TOB) file dest/file
+ #endif /* InstallNonExecFile */
+ 
+ 
+ /*
+  * InstallNonExec - generate rules to install a data file, but does not
+  * try to create the destination directory (deprecated)
+  */
+ #ifndef InstallNonExec
+ #define	InstallNonExec(file,dest)					@@\
+ install:: file								@@\
+ 	$(TOB) file dest/file
+ #endif /* InstallNonExec */
+ 
+ 
+ /*
+  * InstallProgramWithFlags - generate rules to install an executable program
+  * using given install flags.
+  */
+ #ifndef InstallProgramWithFlags
+ #define InstallProgramWithFlags(program,dest,flags)			@@\
+ install:: program							@@\
+ 	$(MKXDIRHIER) dest/program					@@\
+ 	$(AINSTALL) $(AINSTALLFLAGS) program dest/program/pd.$(ARCH)
+ #endif /* InstallProgramWithFlags */
+ 
+ 
+ /*
+  * InstallScript - install a shell script.
+  */
+ #ifndef InstallScript
+ #define	InstallScript(program,dest)					@@\
+ install:: program.script						@@\
+ 	$(TOB) program.script dest/program
+ #endif /* InstallScript */
+ 
+ 
+ /*
+  * InstallNamedScript - install a named shell script.
+  */
+ #ifndef InstallNamedScript
+ #define	InstallNamedScript(srcname,dstname,dest)			@@\
+ install:: srcname							@@\
+ 	$(TOB) srcname dest/dstname
+ #endif /* InstallNamedScript */
+ 
+ 
+ /*
+  * InstallNamedProg - install a program with renaming and no stripping.
+  */
+ #ifndef InstallNamedProg
+ #define	InstallNamedProg(srcname,dstname,dest)				@@\
+ install:: srcname							@@\
+ 	$(MKXDIRHIER) $(DESTDIR)dest/dstname				@@\
+ 	$(AINSTALL) $(AINSTALLFLAGS) srcname $(DESTDIR)dest/dstname/pd.$(ARCH)
+ #endif /* InstallNamedProg */
+ 
+ /*
+  * InstallMultipleDestFlags - generate rules to install multiple files at
+  * once during a particular step in the build using a specific set of install 
+  * flags.
+  */
+ #ifndef InstallMultipleDestFlags
+ #define InstallMultipleDestFlags(step,list,dest,flags)			@@\
+ step:: list								@@\
+ 	$(MKXDIRHIER) $(DESTDIR)dest					@@\
+ 	@case '${MFLAGS}' in *[i]*) set +e;; esac; \			@@\
+ 	for i in list; do \						@@\
+ 		(set -x; $(TOB) $$i dest/$$i); \			@@\
+ 	done
+ #endif /* InstallMultipleDestFlags */
+ 
+ 
+ /*
+ ** InstallMultipleProg: same, but for prorgams.
+ */
+ #ifndef InstallMultipleProg
+ #define InstallMultipleProg(list,dest)					@@\
+ install:: list								@@\
+ 	@case '${MFLAGS}' in *[i]*) set +e;; esac; \			@@\
+ 	for i in list; do \						@@\
+ 	    (set -x; \ 							@@\
+ 	  	$(MKXDIRHIER) $(DESTDIR)dest/$$i; \			@@\
+ 		$(AINSTALL) $(AINSTALLFLAGS) $$i dest/$$i/pd.$(ARCH));\	@@\
+ 	done
+ #endif /* InstallMultipleProg */
+ 
+ 
+ /*
+  * InstallAppDefaults - generate rules to install appliation default files 
+  * if the InstallAppDefFiles configuration parameter is set.
+  */
+ #ifndef InstallAppDefaults
+ #if InstallAppDefFiles
+ #define	InstallAppDefaults(class)					@@\
+ install:: class.ad							@@\
+ 	$(MKXDIRHIER) $(XAPPLOADDIR)					@@\
+ 	$(TOB) class.ad $(DESTDIR)$(XAPPLOADDIR)/class
+ #else
+ #define	InstallAppDefaults(class)
+ #endif /* InstallAppDefFiles */
+ #endif /* InstallAppDefaults */
+ 
+ /*
+  * InstallAppDefaultsLong - generate rules to install appliation default files 
+  * if the InstallAppDefFiles configuration parameter is set.
+  */
+ #ifndef InstallAppDefaultsLong
+ #if InstallAppDefFiles
+ #define	InstallAppDefaultsLong(file,class)				@@\
+ install:: file.ad							@@\
+ 	$(MKXDIRHIER) $(DESTDIR)$(XAPPLOADDIR)				@@\
+ 	$(TOB) file.ad $(DESTDIR)$(XAPPLOADDIR)/class
+ #else
+ #define	InstallAppDefaultsLong(file,class)
+ #endif /* InstallAppDefFiles */
+ #endif /* InstallAppDefaultsLong */
+ 
+ #endif /* Amoeba */
+ 
diff -c mit/config/Imake.rules:1.1.1.2 mit/config/Imake.rules:2.1
*** mit/config/Imake.rules:1.1.1.2	Sat Mar 12 00:36:14 1994
--- mit/config/Imake.rules	Sat Mar 12 00:36:15 1994
***************
*** 1,5 ****
--- 1,6 ----
  XCOMM -------------------------------------------------------------------------
  XCOMM Imake rules for building libraries, programs, scripts, and data files
+ XCOMM $XFree86: mit/config/Imake.rules,v 2.1 1993/09/29 11:06:00 dawes Exp $
  XCOMM rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
  
  /*
***************
*** 139,144 ****
--- 140,149 ----
   * 
   */
  
+ #ifdef CrossCompiling
+ #include "Cross.rules"
+ #endif
+ 
  #define NullParameter
  
  /* if [ -d ] or [ ! -d ] causes make to fail, define this as - */
***************
*** 339,350 ****
  server: subdirs objects libs						@@\
  	-@if [ -f server ]; then set -x; \				@@\
  		$(MV) server server.bak; else exit 0; fi		@@\
! 	$(CC) $(CDEBUGFLAGS) $(CCOPTIONS) -o server objects libs $(EXTRA_LIBRARIES) syslibs $(EXTRA_LOAD_FLAGS) @@\
  									@@\
  Concat(load,server):							@@\
  	-@if [ -f server ]; then set -x; \				@@\
  		$(MV) server server.bak; else exit 0; fi		@@\
! 	$(CC) $(CDEBUGFLAGS) $(CCOPTIONS) -o server objects libs $(EXTRA_LIBRARIES) syslibs $(EXTRA_LOAD_FLAGS)
  #endif /* ServerTarget */
  
  
--- 344,355 ----
  server: subdirs objects libs						@@\
  	-@if [ -f server ]; then set -x; \				@@\
  		$(MV) server server.bak; else exit 0; fi		@@\
! 	$(CC) $(ANSICCOPTIONS) $(CDEBUGFLAGS) $(CCOPTIONS) -o server objects libs $(EXTRA_LIBRARIES) syslibs $(EXTRA_LOAD_FLAGS) @@\
  									@@\
  Concat(load,server):							@@\
  	-@if [ -f server ]; then set -x; \				@@\
  		$(MV) server server.bak; else exit 0; fi		@@\
! 	$(CC) $(ANSICCOPTIONS) $(CDEBUGFLAGS) $(CCOPTIONS) -o server objects libs $(EXTRA_LIBRARIES) syslibs $(EXTRA_LOAD_FLAGS)
  #endif /* ServerTarget */
  
  
***************
*** 439,444 ****
--- 444,485 ----
  
  
  /*
+  * InstallGenManPageLong - More general rules for installing manual pages --
+  * doesn't assume MANSUFFIX.
+  */
+ #ifndef InstallGenManPageLong
+ #define	InstallGenManPageLong(file,destdir,dest,suffix)			@@\
+ install.man:: file.man							@@\
+ 	MakeDir($(DESTDIR)destdir)					@@\
+ 	$(INSTALL) -c $(INSTMANFLAGS) file.man $(DESTDIR)destdir/dest.suffix
+ #endif /* InstallGenManPageLong */
+ 
+ 
+ /*
+  * InstallGenManPage - general equivalent of InstallManPage
+  */
+ #ifndef InstallGenManPage
+ #define	InstallGenManPage(file,destdir,suffix)				@@\
+ InstallGenManPageLong(file,destdir,file,suffix)
+ #endif /* InstallGenManPage */
+ 
+ 
+ /*
+  * InstallGenManPageAliases - general equivalent of InstallManPageAliases
+  */
+ #ifndef InstallGenManPageAliases
+ #define	InstallGenManPageAliases(file,destdir,suffix,aliases)		@@\
+ install.man::								@@\
+ 	@(TMP=/tmp/tmp.$$$$; \						@@\
+ 	$(RM) $${TMP}; \						@@\
+ 	echo .so `basename destdir`/file.suffix > $${TMP}; \		@@\
+ 	for i in aliases; do (set -x; \					@@\
+ 	$(INSTALL) -c $(INSTMANFLAGS) $${TMP} $(DESTDIR)destdir/$$i.suffix; \ @@\
+ 	done; \								@@\
+ 	$(RM) $${TMP})
+ #endif /* InstallGenManPageAliases */
+ 
+ /*
   * InstallNamedNonExec - generate rules to install a data file
   */
  #ifndef InstallNamedNonExec
***************
*** 780,787 ****
   * LibObjCompile - compile fragment for shared/profiled/debugged objects
   */
  #ifndef LibObjCompile
! #define LibObjCompile(dir,options) $(RM) $@ dir/$@			@@\
! 	$(CC) -c $(CCOPTIONS) $(ALLDEFINES) options $*.c		@@\
  	$(MV) $@ dir/$@
  #endif
  
--- 821,828 ----
   * LibObjCompile - compile fragment for shared/profiled/debugged objects
   */
  #ifndef LibObjCompile
! #define LibObjCompile(dir,options) $(RM) $@ dir/$@			   @@\
! 	$(CC) -c $(ANSICCOPTIONS) $(CCOPTIONS) $(ALLDEFINES) options $*.c  @@\
  	$(MV) $@ dir/$@
  #endif
  
***************
*** 1162,1167 ****
--- 1203,1269 ----
  
  
  /*
+  * InstallLinkKitLibrary - rule for installing link kit libraries (X386 only)
+  */
+ #ifndef InstallLinkKitLibrary
+ #define InstallLinkKitLibrary(lib,dir)
+ #endif /* InstallLinkKitLibrary */
+ 
+ 
+ /*
+  * InstallLinkKitNonExecFile - rule for installing link kit files (X386 only)
+  */
+ #ifndef InstallLinkKitNonExecFile
+ #define InstallLinkKitNonExecFile(file,dir)
+ #endif /* InstallLinkKitNonExecFile */
+ 
+ 
+ /*
+  * InstallLinkKitSubdirs - generate rules to recursively install server Link
+  *                         Kit (only used for X386)
+  */
+ #ifndef InstallLinkKitSubdirs
+ #define InstallLinkKitSubdirs(dirs)
+ #endif /* InstallLinkKitSubdirs */
+ 
+ /*
+  * ConfigTargetLong
+  */
+ #ifndef ConfigTargetLong
+ #define ConfigTargetLong(target,dep,script,args,extra)                  @@\
+ all:: Configure                                                         @@\
+                                                                         @@\
+ Configure:: target.o                                                    @@\
+                                                                         @@\
+ target.c: script dep                                                    @@\
+ 	$(MAKE) $(MFLAGS) extra Concat(Build,target)                    @@\
+                                                                         @@\
+ Concat(Build,target):                                                   @@\
+ 	$(RM) target.c                                                  @@\
+ 	$(SHELL) script args                                            @@\
+                                                                         @@\
+ clean::                                                                 @@\
+ 	$(RM) target.c
+ #endif
+ 
+ /*
+  * ConfigTarget - rule for generating a config file
+  */
+ #ifndef ConfigTarget
+ #define ConfigTarget(target,dep,script,args) ConfigTargetLong(target,dep,script,args,/**/)
+ #endif /* ConfigTarget */
+ 
+ 
+ /*
+  * InstallLinkKitSubdirs - generate rules to recursively install server Link
+  *                         Kit (only used for X386)
+  */
+ #ifndef InstallLinkKitSubdirs
+ #define InstallLinkKitSubdirs(dirs)
+ #endif /* InstallLinkKitSubdirs */
+ 
+ 
+ /*
   * IncludesSubdirs - generate rules to recursively put include files in build
   */
  #ifndef IncludesSubdirs
***************
*** 1366,1372 ****
  step::									@@\
  	@case '${MFLAGS}' in *[i]*) set +e;; esac;			@@\
  	DirFailPrefix@for i in dirs; do if [ -d $(DESTDIR)$$i ]; then \	@@\
! 		set +x; else (set -x; $(MKDIRHIER) $(DESTDIR)$$i); fi \	@@\
  	done
  #endif /* MakeDirectories */
  
--- 1468,1474 ----
  step::									@@\
  	@case '${MFLAGS}' in *[i]*) set +e;; esac;			@@\
  	DirFailPrefix@for i in dirs; do if [ -d $(DESTDIR)$$i ]; then \	@@\
! 		set +x; else (set -x; $(MKDIRHIER) $(DESTDIR)$$i); fi; \ @@\
  	done
  #endif /* MakeDirectories */
  
***************
*** 1409,1415 ****
  									@@\
  install::  fonts.dir							@@\
  	MakeDir($(DESTDIR)dest)						@@\
! 	$(INSTALL) -c $(INSTDATFLAGS) fonts.dir $(DESTDIR)dest
  #endif /* InstallFontObjs */
  
  
--- 1511,1518 ----
  									@@\
  install::  fonts.dir							@@\
  	MakeDir($(DESTDIR)dest)						@@\
! 	$(MKFONTDIR) $(DESTDIR)dest
! /*	$(INSTALL) -c $(INSTDATFLAGS) fonts.dir $(DESTDIR)dest */
  #endif /* InstallFontObjs */
  
  
***************
*** 1451,1457 ****
  #define InstallFontScale(dest)						@@\
  install::  fonts.scale							@@\
  	MakeDir($(DESTDIR)dest)						@@\
! 	$(INSTALL) -c $(INSTDATFLAGS) fonts.scale $(DESTDIR)dest
  #endif /* InstallFontScale */
  
  /*
--- 1554,1561 ----
  #define InstallFontScale(dest)						@@\
  install::  fonts.scale							@@\
  	MakeDir($(DESTDIR)dest)						@@\
! 	$(INSTALL) -c $(INSTDATFLAGS) fonts.scale $(DESTDIR)dest	@@\
! 	$(MKFONTDIR) $(DESTDIR)dest
  #endif /* InstallFontScale */
  
  /*
***************
*** 1467,1473 ****
  FontBaseObj(basename):  FontSrc(basename)				@@\
  	$(FONTC) $(FONTCFLAGS) $? -o $@
  #endif
! #endif /* CompressedFontTarget */
  
  /*
   * CompressedFontTarget
--- 1571,1577 ----
  FontBaseObj(basename):  FontSrc(basename)				@@\
  	$(FONTC) $(FONTCFLAGS) $? -o $@
  #endif
! #endif /* UnCompressedFontTarget */
  
  /*
   * CompressedFontTarget
***************
*** 1478,1484 ****
  	$(FONTC) $(FONTCFLAGS) $? | $(COMPRESS) > $@
  #endif /* CompressedFontTarget */
  
! #ifdef CompressAllFonts
  #define FontTarget(basename) CompressedFontTarget(basename)
  #define FontObj(basename) FontBaseObj(basename).Z
  #else
--- 1582,1588 ----
  	$(FONTC) $(FONTCFLAGS) $? | $(COMPRESS) > $@
  #endif /* CompressedFontTarget */
  
! #if CompressAllFonts
  #define FontTarget(basename) CompressedFontTarget(basename)
  #define FontObj(basename) FontBaseObj(basename).Z
  #else
diff -c mit/config/Imake.tmpl:1.1.1.2 mit/config/Imake.tmpl:2.10
*** mit/config/Imake.tmpl:1.1.1.2	Sat Mar 12 00:36:16 1994
--- mit/config/Imake.tmpl	Sat Mar 12 00:36:16 1994
***************
*** 7,12 ****
--- 7,13 ----
  #endif
  XCOMM -------------------------------------------------------------------------
  XCOMM Makefile generated from IMAKE_TEMPLATE and INCLUDE_IMAKEFILE
+ XCOMM $XFree86: mit/config/Imake.tmpl,v 2.10 1994/02/28 13:54:37 dawes Exp $
  XCOMM $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
  XCOMM
  XCOMM Platform-specific parameters may be set in the appropriate <vendor>.cf
***************
*** 41,46 ****
--- 42,57 ----
   *     4.  Create a .cf file with the name given by MacroFile.
   */
  
+ #ifndef INCLUDE_PLATFORM
+ #define INCLUDE_PLATFORM <noop.rules>
+ #endif
+ #include INCLUDE_PLATFORM
+ 
+ #ifndef MacroIncludeFile
+ /* If INCLUDE_PLATFORM was included, both MacroFile and MacroIncludeFile
+  * will already be defined.
+  */
+ 
  #ifdef ultrix
  #define MacroIncludeFile <ultrix.cf>
  #define MacroFile ultrix.cf
***************
*** 63,74 ****
  #define VaxArchitecture
  #endif
  
! #ifdef sun
  #define MacroIncludeFile <sun.cf>
  #define MacroFile sun.cf
  #undef sun
  #define SunArchitecture
! #endif /* sun */
  
  #ifdef hpux
  #define MacroIncludeFile <hp.cf>
--- 74,85 ----
  #define VaxArchitecture
  #endif
  
! #if defined(sun) && !defined(SOLX86) 
  #define MacroIncludeFile <sun.cf>
  #define MacroFile sun.cf
  #undef sun
  #define SunArchitecture
! #endif /* sun && !SOLX86 */
  
  #ifdef hpux
  #define MacroIncludeFile <hp.cf>
***************
*** 220,234 ****
  #endif /* MOTOROLA */
  
  #ifdef SYSV386
  # define MacroIncludeFile <x386.cf>
  # define MacroFile x386.cf
  # ifdef SVR4
  #  define i386SVR4Architecture
  # else
  #  define i386SVR3Architecture
! # endif
  #endif /* SYSV386 */
  
  #ifdef DGUX
  #define MacroIncludeFile <DGUX.cf>
  #define MacroFile DGUX.cf
--- 231,337 ----
  #endif /* MOTOROLA */
  
  #ifdef SYSV386
+ # ifdef SOLX86
+ #  undef SOLX86
+ #  define SVR4
+ #  define i386SVR4Architecture
+ #  undef i386SVR3Architecture
+ #  define i386SVR4Solarisx86 
+ # endif
  # define MacroIncludeFile <x386.cf>
  # define MacroFile x386.cf
+ # undef i386
  # ifdef SVR4
+ #  undef SVR4
  #  define i386SVR4Architecture
+ #  ifdef NCR
+ #   define i386Ncr
+ #   undef NCR
+ #  endif
  # else
  #  define i386SVR3Architecture
! #  ifdef SCO
! #   define i386Sco
! #   undef SCO
! #   ifdef SCO324
! #    define ScoVersion 324
! #    undef SCO324
! #   else
! #    define ScoVersion 322
! #   endif /* SCO324 */
! #  endif /* SCO */
! #  ifdef ISC
! #   define i386Isc
! #   undef ISC
! #   ifdef ISC202
! #    define IscVersion 202
! #    undef ISC202
! #   else
! #    ifdef ISC30
! #     define IscVersion 300
! #     undef ISC30
! #    else
! #     ifdef ISC40
! #      define IscVersion 400
! #      undef ISC40
! #     else
! #      define IscVersion 221
! #     endif /* ISC40 */
! #    endif /* ISC30 */
! #   endif /* ISC202 */
! #  endif /* ISC */
! #  ifdef ESIX
! #   define i386Esix
! #   undef ESIX
! #  endif /* ESIX */
! #  ifdef ATT
! #   define i386Att
! #   undef ATT
! #  endif /* ATT */
! # endif /* SVR4 */
  #endif /* SYSV386 */
  
+ #if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
+ # define MacroIncludeFile <x386.cf>
+ # define MacroFile x386.cf
+ # define i386BsdArchitecture
+ # ifdef __386BSD__
+ #  undef __386BSD__
+ # endif /* __386BSD__ */
+ # ifdef __NetBSD__
+ #  define i386NetBsd
+ #  undef __NetBSD__
+ # endif /* __NetBSD */
+ # ifdef NetBSD
+ #  undef NetBSD
+ # endif /* NetBSD */
+ # ifdef __FreeBSD__
+ #  define i386FreeBsd
+ #  undef __FreeBSD__
+ # endif /* __FreeBSD__ */
+ # ifdef FreeBSD
+ #  undef FreeBSD
+ # endif /* FreeBSD */
+ #endif /* __386BSD__ || __NetBSD__ || __FreeBSD__ */
+ 
+ #ifdef __bsdi__
+ # define MacroIncludeFile <x386.cf>
+ # define MacroFile x386.cf
+ # define i386BsdArchitecture
+ # define i386Bsdi
+ # undef __bsdi__
+ # ifdef bsdi
+ #  undef bsdi
+ # endif /* bsdi */
+ #endif /* __bsdi__ */
+ 
+ #if defined(__OSF__) || defined(OSF)
+ # define MacroIncludeFile <x386.cf>
+ # define MacroFile x386.cf
+ # define OsfArchitecture
+ # undef OSF
+ #endif
+ 
  #ifdef DGUX
  #define MacroIncludeFile <DGUX.cf>
  #define MacroFile DGUX.cf
***************
*** 245,250 ****
--- 348,373 ----
  # define ConvexArchitecture
  #endif
  
+ #ifdef linux
+ # define MacroIncludeFile <x386.cf>
+ # define MacroFile x386.cf
+ # undef linux
+ # define LinuxArchitecture
+ #endif /* linux */
+ 
+ #ifdef MACH
+ # ifdef i386
+ #  undef i386
+ #  define i386MachArchitecture
+ #  define i386Mach_BsdTree
+ #  define MacroIncludeFile <x386.cf>
+ #  define MacroFile x386.cf
+ # endif
+ # ifdef CMU
+ #  undef CMU
+ # endif
+ #endif
+ 
  #ifndef MacroIncludeFile
  XCOMM WARNING:  Imake.tmpl not configured; guessing at definitions!!!
  XCOMM This might mean that BOOTSTRAPCFLAGS was not set when building imake.
***************
*** 252,257 ****
--- 375,382 ----
  #define MacroFile generic.cf
  #endif
  
+ #endif /* MacroIncludeFile */
+ 
  /*****************************************************************************
   *                                                                           *
   *                       DO NOT MODIFY BELOW THIS LINE                       *
***************
*** 316,321 ****
--- 441,452 ----
  #ifndef SystemV4
  #define SystemV4		NO	/* SVR4 */
  #endif
+ #ifndef i386Bsd
+ #define i386Bsd			NO
+ #endif
+ #ifndef i386Mach
+ #define i386Mach		NO
+ #endif
  #ifndef OSMajorVersion
  #define OSMajorVersion          0
  #endif
***************
*** 461,466 ****
--- 592,600 ----
  #ifndef DefaultCCOptions
  #define DefaultCCOptions /* as nothing: this is for floating point, etc. */
  #endif
+ #ifndef AnsiCCOptions
+ #define AnsiCCOptions /* as nothing */
+ #endif
  #ifndef InstPgmFlags
  #define InstPgmFlags -s
  #endif
***************
*** 519,524 ****
--- 653,661 ----
  #ifndef AsCmd
  #define AsCmd as
  #endif
+ #ifndef YaccCmd
+ #define YaccCmd yacc
+ #endif
  #ifndef CompressCmd
  #define CompressCmd compress
  #endif
***************
*** 618,623 ****
--- 755,763 ----
  #define NdbmDefines /**/
  #endif
  #endif
+ #ifndef OSLibraries
+ #define OSLibraries /**/
+ #endif
  #ifndef ExtraLibraries
  #if SystemV4
  #if HasSockets
***************
*** 639,644 ****
--- 779,790 ----
  #define LdCombineFlags -X -r
  #endif
  #endif
+ #if defined(MakeLdRunPath) && AlternateUsrLibDir
+ #define LdRunPath MakeLdRunPath($(USRLIBDIR))
+ #define LdLinkPath MakeLdLinkPath($(USRLIBDIR))
+ #else
+ #define LdRunPath /* */
+ #endif
  #ifndef TagsCmd
  #define TagsCmd ctags
  #endif
***************
*** 660,665 ****
--- 806,826 ----
  #ifndef EqnCmd
  #define EqnCmd eqn
  #endif
+ #ifndef NroffCmd
+ #define NroffCmd nroff
+ #endif
+ #ifndef NeqnCmd
+ #define NeqnCmd neqn
+ #endif
+ #ifndef LexCmd
+ #define LexCmd lex
+ #endif
+ #ifndef LexLib
+ #define LexLib
+ #endif
+ #ifndef YaccCmd
+ #define YaccCmd yacc
+ #endif
  #ifndef ExpandManNames
  #if SystemV
  #define ExpandManNames NO
***************
*** 679,684 ****
--- 840,848 ----
  #ifndef FilesToClean
  #define FilesToClean *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut 
  #endif
+ #ifdef i386SVR3Architecture
+ .NOEXPORT:
+ #endif
  
              SHELL = BourneShell
  
***************
*** 689,694 ****
--- 853,861 ----
    BOOTSTRAPCFLAGS = BootstrapCFlags	/* set if cpp does not have uniq sym */
                 CC = CcCmd
                 AS = AsCmd
+               LEX = LexCmd
+            LEXLIB = LexLib
+              YACC = YaccCmd
  #if HasFortran
                 FC = FortranCmd
        FDEBUGFLAGS = FortranDebugFlags
***************
*** 715,725 ****
--- 882,895 ----
           MSMACROS = MsMacros
                TBL = TblCmd
                EQN = EqnCmd
+             NROFF = NroffCmd
+              NEQN = NeqnCmd
       STD_INCLUDES = StandardIncludes
    STD_CPP_DEFINES = StandardCppDefines
        STD_DEFINES = StandardDefines
   EXTRA_LOAD_FLAGS = ExtraLoadFlags
    EXTRA_LIBRARIES = ExtraLibraries
+      OS_LIBRARIES = OSLibraries
               TAGS = TagsCmd
  #if ConstructMFLAGS
             MFLAGS = -$(MAKEFLAGS)
***************
*** 797,802 ****
--- 967,976 ----
  #endif
        CDEBUGFLAGS = DefaultCDebugFlags
          CCOPTIONS = DefaultCCOptions	/* to distinguish from param flags */
+     ANSICCOPTIONS = AnsiCCOptions
+ 
+         LDRUNPATH = LdRunPath
+        LDLINKPATH = LdLinkPath
  /*
   * STD_INCLUDES contains system-specific includes
   * TOP_INCLUDES specifies how to get to /usr/include or its build substitute
***************
*** 806,822 ****
   */
        ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
         ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
!            CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
          LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  #if AlternateUsrLibDir && !defined(UseInstalled)
!            LDLIBS = -L$(USRLIBDIR) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  #else
!            LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  #endif
  #if AlternateUsrLibDir && defined(UseInstalled)
!         LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
  #else
!         LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS)
  #endif
     LDCOMBINEFLAGS = LdCombineFlags
        DEPENDFLAGS = DependFlags
--- 980,1004 ----
   */
        ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
         ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
!            CFLAGS = $(ANSICCOPTIONS) $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
          LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
+ #ifdef Amoeba
+            LDLIBS = $(SYS_LIBRARIES) $(OS_LIBRARIES) $(EXTRA_LIBRARIES)
+ #else
  #if AlternateUsrLibDir && !defined(UseInstalled)
!            LDLIBS = -L$(USRLIBDIR) $(OS_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  #else
!            LDLIBS = $(OS_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
! #endif
  #endif
+ #if !CrossCompiling
  #if AlternateUsrLibDir && defined(UseInstalled)
!         LDOPTIONS = $(ANSICCOPTIONS) $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR) $(LDRUNPATH)
! #else
!         LDOPTIONS = $(ANSICCOPTIONS) $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) $(LDRUNPATH)
! #endif
  #else
!         LDOPTIONS =
  #endif
     LDCOMBINEFLAGS = LdCombineFlags
        DEPENDFLAGS = DependFlags
***************
*** 848,853 ****
--- 1030,1047 ----
  XCOMM start of Imakefile
  #include INCLUDE_IMAKEFILE
  
+ #ifdef INoCrossCompilation
+ /* When we are crosscompiling, the programs that are to run on the local host
+  * (like makedepend, imake(!), ..)  should be compiled by the host's compiler.
+  * If this is the case, insert a define of INoCrossCompilation in the
+  * Imakefile. The following include will then take care of redefining
+  * parameters like CC.
+  */
+ #include "hostcc.def"
+      OS_LIBRARIES =
+ #endif
+ 
+ 
  XCOMM -------------------------------------------------------------------------
  XCOMM common rules for all Makefiles - do not edit
  /*
***************
*** 882,887 ****
--- 1076,1082 ----
  
  InstallSubdirs($(SUBDIRS))
  InstallManSubdirs($(SUBDIRS))
+ InstallLinkKitSubdirs($(SUBDIRS))
  CleanSubdirs($(SUBDIRS))
  TagSubdirs($(SUBDIRS))
  MakefileSubdirs($(SUBDIRS))
***************
*** 896,901 ****
--- 1091,1099 ----
  
  install.man::
  	@echo "install.man in $(CURRENT_DIR) done"
+ 
+ install.linkkit::
+ 	@echo "install.linkkit in $(CURRENT_DIR) done"
  
  Makefiles::
  
diff -c mit/config/Imakefile:1.1.1.2 mit/config/Imakefile:2.5
*** mit/config/Imakefile:1.1.1.2	Sat Mar 12 00:36:16 1994
--- mit/config/Imakefile	Sat Mar 12 00:36:16 1994
***************
*** 1,6 ****
  /*
-  * $XConsortium: Imakefile,v 1.14 91/12/02 11:24:14 rws Exp $
-  * 
   * This is used to recreate imake.  Makefile.ini is used to generate imake
   * the first time.
   */
--- 1,7 ----
+ XCOMM $XFree86: mit/config/Imakefile,v 2.5 1994/03/03 12:40:20 dawes Exp $
+ XCOMM $XConsortium: Imakefile,v 1.14 91/12/02 11:24:14 rws Exp $
+ 
  /*
   * This is used to recreate imake.  Makefile.ini is used to generate imake
   * the first time.
   */
***************
*** 7,15 ****
  
  DEPLIBS = 
  HEADERS = imakemdep.h 
! CFFILES = $(HEADERS) *.rules *.tmpl site.def *.bac *.cf
  CPP_PROGRAM = CppCmd
  INCLUDES = -I$(BUILDINCDIR)
  DEFINES = $(SIGNAL_DEFINES) $(BOOTSTRAPCFLAGS) -DCPP_PROGRAM=\"$(CPP_PROGRAM)\"
  
  #ifdef MacIIArchitecture
--- 8,19 ----
  
  DEPLIBS = 
  HEADERS = imakemdep.h 
! CFFILES = $(HEADERS) *.rules *.tmpl *.def *.bac *.cf
  CPP_PROGRAM = CppCmd
  INCLUDES = -I$(BUILDINCDIR)
+ #ifdef CrossCompiling
+ BOOTSTRAPCFLAGS = -DCROSS_COMPILE
+ #endif
  DEFINES = $(SIGNAL_DEFINES) $(BOOTSTRAPCFLAGS) -DCPP_PROGRAM=\"$(CPP_PROGRAM)\"
  
  #ifdef MacIIArchitecture
***************
*** 16,30 ****
--- 20,101 ----
  XBSDLIB = /**/
  #endif
  
+ #ifdef NeedBerklib
+ XBSDLIB = /**/
+ #endif
+ 
+ #if NeedInetEmulLib
+ XINETLIB = /**/
+ #endif
+ 
+ #ifdef XFree86Version
+ 
+ /*
+  * This is so we don't have to change the toplevel Imakefile
+  * We let make 'Makefiles' regenerate X386Conf.tmpl and the updated Makefile
+  */
+ 
+ IMAKE_CMD=$(IMAKE)
+ 
+ Makefiles::
+ 	$(RM) Makefile.x386
+ 	$(IMAKE) -DMakefileX386 -s Makefile.x386
+ 	$(MAKE) $(MFLAGS) -f Makefile.x386 X386Conf.tmpl
+ 	$(MAKE) $(MFLAGS) Makefile
+ 	$(RM) Makefile.x386
+ 
+ #ifdef MakefileX386
+ #if XF86MonoServer
+ #define X386Vga2Args VGA2DRIVER X386Vga2Drivers
+ #define X386Hga2Args HGA2DRIVER X386Hga2Drivers
+ #define X386Bdm2Args BDM2DRIVER X386Bdm2Drivers
+ #else
+ #define X386Vga2Args
+ #define X386Hga2Args
+ #define X386Bdm2Args
+ #endif
+ #if XF86VGA16Server
+ #define X386Vga16Args VGA16DRIVER X386Vga16Drivers
+ #else
+ #define X386Vga16Args
+ #endif
+ #if XF86SVGAServer
+ #define X386VgaArgs VGADRIVER X386Vga256Drivers
+ #else
+ #define X386VgaArgs
+ #endif
+ #if XF86S3Server
+ #define XF86S3Args S3DRIVER XF86S3Drivers
+ #else
+ #define XF86S3Args
+ #endif
+ X386Conf.tmpl::
+ 	$(RM) $@
+ 	$(SHELL) x386config.sh \
+ 	  X386VgaArgs X386Vga16Args X386Vga2Args X386Hga2Args X386Bdm2Args \
+ 	  XF86S3Args RENDERER FontRenderers
+ #endif
+ 
+ #endif
+ 
+ #ifdef CrossCompiling
+ #define INoCrossCompilation
  #undef ImakeDependency
  #define ImakeDependency(dummy) @@\
  Makefile::  imake
  
+ OBJS=imake.o
+ SRCS=imake.c
+ 
+ ComplexCrossProgramTarget(imake)
+ #else
  SimpleProgramTarget(imake)
+ #endif
  
  BuildIncludes($(HEADERS),config,..)
  
  InstallMultipleDestFlags(install,$(CFFILES),$(CONFIGDIR),$(INSTDATFLAGS))
+ InstallNonExecFile(README,$(CONFIGDIR))
  
  depend::
  
diff -c mit/config/Library.tmpl:1.1.1.2 mit/config/Library.tmpl:1.5
*** mit/config/Library.tmpl:1.1.1.2	Sat Mar 12 00:36:17 1994
--- mit/config/Library.tmpl	Sat Mar 12 00:36:17 1994
***************
*** 6,11 ****
--- 6,12 ----
   * DoNormalLib, DoSharedLib, DoDebugLib, DoProfileLib
   */
  
+ XCOMM $XFree86: mit/config/Library.tmpl,v 1.5 1993/03/27 08:55:03 dawes Exp $
  XCOMM $XConsortium: Library.tmpl,v 1.12 92/03/20 15:05:19 rws Exp $
  
  #ifndef LibraryCcCmd
***************
*** 22,27 ****
--- 23,31 ----
  #define LibraryCCOptions DefaultCCOptions
  #endif
  #endif
+ #ifndef LibraryAnsiCCOptions
+ #define LibraryAnsiCCOptions AnsiCCOptions
+ #endif
  #ifndef LibraryDefines
  #define LibraryDefines StandardDefines
  #endif
***************
*** 32,44 ****
  #define AvoidNullMakeCommand NO
  #endif
  #if AvoidNullMakeCommand
! _NULLCMD_ = @ echo -n
  #endif
  
!          CC = LibraryCcCmd
!   CCOPTIONS = LibraryCCOptions
! STD_DEFINES = LibraryDefines
! CDEBUGFLAGS = LibraryCDebugFlags
  
  #if DoDebugLib
  #define _DebuggedLibMkdir() LibMkdir(debugger)
--- 36,49 ----
  #define AvoidNullMakeCommand NO
  #endif
  #if AvoidNullMakeCommand
! _NULLCMD_ = @echo -n
  #endif
  
!            CC = LibraryCcCmd
!     CCOPTIONS = LibraryCCOptions
! ANSICCOPTIONS = LibraryAnsiCCOptions
!   STD_DEFINES = LibraryDefines
!   CDEBUGFLAGS = LibraryCDebugFlags
  
  #if DoDebugLib
  #define _DebuggedLibMkdir() LibMkdir(debugger)
***************
*** 74,79 ****
--- 79,98 ----
  #define _NormalObjCompile(options) NormalSharedLibObjCompile(options)
  #else
  #define _NormalObjCompile(options) NormalLibObjCompile(options)
+ #endif
+ 
+ #if defined(i386SVR3Architecture)
+ #if DoSharedLib
+ #define _SharedDatCompile(options) NormalSharedLibObjCompile(options)
+ #else
+ #define _SharedDatCompile(options) $(_NULLCMD_)
+ #endif
+ #ifndef SpecialLibDataRule
+ #define SpecialLibDataRule(objs,depends,options)                      @@\
+ objs: depends                                                         @@\
+       _SharedDatCompile(-DSVR3SHDAT options)                          @@\
+ 
+ #endif /* SpecialLibDataRule */
  #endif
  
  #ifndef LibraryObjectRule
diff -c mit/config/Makefile.ini:1.1.1.1 mit/config/Makefile.ini:2.0
*** mit/config/Makefile.ini:1.1.1.1	Sat Mar 12 00:36:17 1994
--- mit/config/Makefile.ini	Sat Mar 12 00:36:17 1994
***************
*** 1,3 ****
--- 1,4 ----
+ # $XFree86: mit/config/Makefile.ini,v 2.0 1993/09/21 15:14:14 dawes Exp $
  #
  #   WARNING    WARNING    WARNING    WARNING    WARNING    WARNING    WARNING
  #
***************
*** 20,25 ****
--- 21,28 ----
  
  imake::
  	@echo "making imake with BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS)"
+ 	@$(RM) X386Conf.tmpl
+ 	@touch X386Conf.tmpl
  
  imake:: imake.o
  	$(CC) -o imake imake.o
diff -c mit/config/Project.tmpl:1.1.1.3 mit/config/Project.tmpl:2.5
*** mit/config/Project.tmpl:1.1.1.3	Sat Mar 12 00:36:18 1994
--- mit/config/Project.tmpl	Sat Mar 12 00:36:18 1994
***************
*** 1,5 ****
--- 1,6 ----
  XCOMM -------------------------------------------------------------------------
  XCOMM X Window System Build Parameters
+ XCOMM $XFree86: mit/config/Project.tmpl,v 2.5 1994/02/27 11:25:48 dawes Exp $
  XCOMM $XConsortium: Project.tmpl,v 1.138.1.1 92/11/11 09:49:19 rws Exp $
  
  /*****************************************************************************
***************
*** 19,33 ****
--- 20,65 ----
  #ifndef BuildServer
  #define BuildServer		YES
  #endif
+ #ifndef BuildServersOnly
+ #define BuildServersOnly	NO
+ #endif
  #ifndef BuildFonts
  #define BuildFonts		BuildServer
  #endif
+ #ifndef Build75Dpi
+ #define Build75Dpi		BuildFonts
+ #endif
+ #ifndef Build100Dpi
+ #define Build100Dpi		BuildFonts
+ #endif
  #ifndef BuildFontServer
  #define BuildFontServer		BuildServer
  #endif
+ #ifndef BuildType1
+ #define BuildType1		NO
+ #endif
+ #ifndef BuildSpeedo
+ #define BuildSpeedo		YES
+ #endif
  #ifndef BuildPex
  #define BuildPex		YES
  #endif
+ #ifndef FontRenderers
+ #if BuildType1
+ #define Type1Renderer		Type1
+ #else
+ #define Type1Renderer		/**/
+ #endif
+ #if BuildSpeedo
+ #define SpeedoRenderer		Speedo
+ #else
+ #define SpeedoRenderer		/**/
+ #endif
+ #define FontRenderers		SpeedoRenderer Type1Renderer
+ #endif
+ #ifndef BuildLargeMiscFonts
+ #define BuildLargeMiscFonts	YES
+ #endif
  #ifndef BuildPexClients
  #define BuildPexClients		BuildPex
  #endif
***************
*** 44,49 ****
--- 76,87 ----
  #ifndef BuildXInputLib
  #define BuildXInputLib		YES
  #endif
+ #ifndef WantServerLocks
+ #define WantServerLocks		NO
+ #endif
+ #ifndef PartialNetDefault
+ #define PartialNetDefault	NO
+ #endif
  #ifndef InstallLibManPages
  #define InstallLibManPages	YES
  #endif
***************
*** 149,154 ****
--- 187,199 ----
  #ifndef LibManSuffix
  #define LibManSuffix	3		/* use just one tab or cpp will die */
  #endif
+ #ifndef FileManSuffix
+ #if SystemV || SystemV4
+ #define FileManSuffix	4		/* use just one tab or cpp will die */
+ #else
+ #define FileManSuffix	5		/* use just one tab or cpp will die */
+ #endif
+ #endif
  #ifndef HasXdmAuth
  #define HasXdmAuth		NO	/* if you can not use XDM-AUTH* */
  #endif
***************
*** 323,328 ****
--- 368,376 ----
  #ifndef LibmanDir
  #define LibmanDir $(MANSOURCEPATH)$(LIBMANSUFFIX)
  #endif
+ #ifndef FileManDir
+ #define FileManDir $(MANSOURCEPATH)$(FILEMANSUFFIX)
+ #endif
  #ifndef NlsDir
  #define NlsDir $(LIBDIR)/nls
  #endif
***************
*** 329,340 ****
  #ifndef PexApiDir
  #define PexApiDir $(LIBDIR)/PEX
  #endif
  #ifndef XFileSearchPathBase
! #define XFileSearchPathBase $(LIBDIR)/%L/%T/%N%C%S:$(LIBDIR)/%l/%T/%N%C%S:$(LIBDIR)/%T/%N%C%S:$(LIBDIR)/%L/%T/%N%S:$(LIBDIR)/%l/%T/%N%S:$(LIBDIR)/%T/%N%S
  #endif
  #ifndef XFileSearchPathDefault
  #ifdef XAppLoadDir
! #define XFileSearchPathDefault XAppLoadDir/%N%C%S:XAppLoadDir/%N%S:XFileSearchPathBase
  #else
  #define XFileSearchPathDefault XFileSearchPathBase
  #endif
--- 377,392 ----
  #ifndef PexApiDir
  #define PexApiDir $(LIBDIR)/PEX
  #endif
+ /* We need the following %C definition so that we can use sccs on this file.
+  * Without this def, the following %-sequences will be expanded by sccs.
+  */
+ _percentC_ = %C
  #ifndef XFileSearchPathBase
! #define XFileSearchPathBase $(LIBDIR)/%L/%T/%N$(_percentC_)%S:$(LIBDIR)/%l/%T/%N$(_percentC_)%S:$(LIBDIR)/%T/%N$(_percentC_)%S:$(LIBDIR)/%L/%T/%N%S:$(LIBDIR)/%l/%T/%N%S:$(LIBDIR)/%T/%N%S
  #endif
  #ifndef XFileSearchPathDefault
  #ifdef XAppLoadDir
! #define XFileSearchPathDefault XAppLoadDir/%N$(_percentC_)%S:XAppLoadDir/%N%S:XFileSearchPathBase
  #else
  #define XFileSearchPathDefault XFileSearchPathBase
  #endif
***************
*** 363,370 ****
  #ifndef UseCCMakeDepend			/* use slow cc -E script */
  #define UseCCMakeDepend NO
  #endif
  #ifndef DependDir
! #if UseCCMakeDepend
  #define DependDir $(SCRIPTSRC)
  #else
  #define DependDir $(UTILSRC)/makedepend
--- 415,425 ----
  #ifndef UseCCMakeDepend			/* use slow cc -E script */
  #define UseCCMakeDepend NO
  #endif
+ #ifndef UseGccMakeDepend		/* Slowish but correct gcc -M */
+ #define UseGccMakeDepend NO
+ #endif
  #ifndef DependDir
! #if UseCCMakeDepend || UseGccMakeDepend
  #define DependDir $(SCRIPTSRC)
  #else
  #define DependDir $(UTILSRC)/makedepend
***************
*** 374,381 ****
--- 429,440 ----
  #define ContribDir $(TOP)/../contrib	/* contrib is outside core tree */
  #endif
  #ifndef DependCmd
+ #if UseGccMakeDepend
+ #define DependCmd $(DEPENDSRC)/gccmakedep
+ #else
  #define DependCmd $(DEPENDSRC)/makedepend
  #endif
+ #endif
  #ifndef RemoveTargetProgramByMoving
  #define RemoveTargetProgramByMoving NO
  #endif
***************
*** 384,390 ****
  #endif
  
  #ifndef ForceNormalLib
! #define ForceNormalLib (HasSaberC | HasGcc)
  #endif
  #ifndef SharedLibX
  #define SharedLibX HasSharedLibraries
--- 443,449 ----
  #endif
  
  #ifndef ForceNormalLib
! #define ForceNormalLib (HasSaberC | (HasGcc & !HasGcc2))
  #endif
  #ifndef SharedLibX
  #define SharedLibX HasSharedLibraries
***************
*** 452,457 ****
--- 511,519 ----
  #ifndef NormalLibPhigs
  #define NormalLibPhigs (!SharedLibPhigs | ForceNormalLib)
  #endif
+ #ifndef NeedInetEmulLib
+ #define NeedInetEmulLib NO
+ #endif
  
  
  #ifndef DoInstallExtensionsIntoXlib
***************
*** 486,503 ****
--- 548,572 ----
      MANSOURCEPATH = ManSourcePath	/* prefix for man page sources */
          MANSUFFIX = ManSuffix		/* suffix for man pages */
       LIBMANSUFFIX = LibManSuffix	/* suffix for library man pages */
+     FILEMANSUFFIX = FileManSuffix	/* suffix for config file man pages */
             MANDIR = ManDir		/* man pages for commands */
          LIBMANDIR = LibmanDir		/* man pages for library routines */
+        FILEMANDIR = FileManDir		/* man pages for config files */
             NLSDIR = NlsDir		/* nls files */
          PEXAPIDIR = PexApiDir		/* PEX support files */
        XAPPLOADDIR = XAppLoadDir		/* application default resource dir */
         FONTCFLAGS = FontCompilerFlags
+        LINKKITDIR = LinkKitDir		/* Where to install Link Kit */
  
       INSTAPPFLAGS = $(INSTDATFLAGS)	/* XXX - this should go away - XXX */
  
  #ifdef UseInstalled
              IMAKE = imake		/* assume BINDIR in path */
+ #if UseGccMakeDepend
+            DEPEND = gccmakedep		/* assume BINDIR in path */
+ #else
             DEPEND = makedepend		/* assume BINDIR in path */
+ #endif
                RGB = rgb			/* assume BINDIR in path */
  #ifdef SnfFonts
              FONTC = bdftosnf		/* assume BINDIR in path */
***************
*** 519,524 ****
--- 588,603 ----
          MKDIRHIER = BourneShell $(SCRIPTSRC)/mkdirhier.sh
  #endif
  
+ #ifndef XFree86Version
+ #if BuildSpeedo
+         SPEEDOLIB = $(FONTSRC)/lib/font/Speedo/libSpeedo.a
+ #endif
+ #if BuildType1
+          TYPE1LIB = $(FONTSRC)/lib/font/Type1/libType1.a
+ #endif
+      RENDERERLIBS = $(SPEEDOLIB) $(TYPE1LIB)
+ #endif
+ 
          CONFIGSRC = $(TOP)/config
         DOCUTILSRC = $(TOP)/doc/util
          CLIENTSRC = $(TOP)/clients
***************
*** 644,649 ****
--- 723,732 ----
  #endif
         DEPXBSDLIB = _UseCat($(USRLIBDIR),$(LIBSRC)/Berk,/libXbsd.a)
            XBSDLIB = LoaderLibPrefix _Use(-lXbsd,$(DEPXBSDLIB))
+ #if NeedInetEmulLib
+       DEPXINETLIB = _UseCat($(USRLIBDIR),$(LIBSRC)/InetEmul,/libXinetem.a)
+          XINETLIB = LoaderLibPrefix _Use(-lXbsd,$(DEPXINETLIB))
+ #endif
  
   LINTEXTENSIONLIB = _UseCat($(LINTLIBDIR),$(EXTENSIONSRC)/lib,/llib-lXext.ln)
           LINTXLIB = _UseCat($(LINTLIBDIR),$(XLIBSRC),/llib-lX11.ln)
diff -c mit/config/Server.tmpl:1.1.1.1 mit/config/Server.tmpl:1.3
*** mit/config/Server.tmpl:1.1.1.1	Sat Mar 12 00:36:18 1994
--- mit/config/Server.tmpl	Sat Mar 12 00:36:18 1994
***************
*** 3,11 ****
   * that Imakefiles in the server subtree will need.
   */
  
  XCOMM $XConsortium: Server.tmpl,v 1.5 91/05/06 19:00:26 rws Exp $
  
! #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'CCOPTIONS=$(CCOPTIONS)'
  
  #ifndef ServerCcCmd
  #define ServerCcCmd CcCmd
--- 3,12 ----
   * that Imakefiles in the server subtree will need.
   */
  
+ XCOMM $XFree86: mit/config/Server.tmpl,v 1.3 1993/03/27 08:55:06 dawes Exp $
  XCOMM $XConsortium: Server.tmpl,v 1.5 91/05/06 19:00:26 rws Exp $
  
! #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'CCOPTIONS=$(CCOPTIONS)' 'ANSICCOPTIONS=$(ANSICCOPTIONS)'
  
  #ifndef ServerCcCmd
  #define ServerCcCmd CcCmd
diff -c /dev/null mit/config/ack_ux_i386.cf:1.1
*** /dev/null	Sat Mar 12 00:36:19 1994
--- mit/config/ack_ux_i386.cf	Sat Mar 12 00:36:19 1994
***************
*** 0 ****
--- 1,36 ----
+ XCOMM $XFree86: mit/config/ack_ux_i386.cf,v 1.1 1993/03/23 12:56:35 dawes Exp $
+ 
+ #include "x_am_i386.cf"
+ 
+ #define AckToolset		YES
+ #define CrossCompiling		YES
+ 
+ #define CcCmd			ack
+ #define ServerCcCmd		ack
+ #define LdCmd			ack
+ #define	YaccCmd			byacc
+ #define DefaultCCOptions	-mam_i80386
+ #define LibraryCCOptions	-mam_i80386
+ #define LdCombineFlags          -Rled-r -c.out
+ #define	ExtraLoadFlags		-fp
+ #define TermcapLibrary		/* in libajax */
+ 
+ #if HasLargeTmp
+ #define ArCmd aal crv		/* use /tmp for temp files */
+ #else
+ #define ArCmd aal clrv		/* use local dir for temp files */
+ #endif
+ #define RanlibCmd /bin/true
+ 
+ #define AsCmd			AmoebaConf/$(ARCH).$(TOOLSET)/toolset/do_as
+ #define AsIncl			-I$(ATOP)/src/h/machdep/arch/$(ARCH)
+ #define AsmDefines		-DACK_ASSEMBLER
+ 
+ #define AssembleObject(flags) $(RM) $@                                  @@\
+ 	AsCmd -mam_i80386 -o $*.o AsmDefines $(INCLUDES) AsIncl flags $*.s
+ 
+ ARCH		= i80386
+ TOOLSET		= ack
+ ALDFLAGS	= -mam_i80386 -.c -Rcv-s32
+ 
+ #include "x386.cf"
diff -c /dev/null mit/config/am_site.def:1.2
*** /dev/null	Sat Mar 12 00:36:19 1994
--- mit/config/am_site.def	Sat Mar 12 00:36:19 1994
***************
*** 0 ****
--- 1,72 ----
+ XCOMM $XFree86: mit/config/am_site.def,v 1.2 1993/03/23 12:58:50 dawes Exp $
+ 
+ /*
+  * Amoeba configuration defines that should require no change.
+  */
+ #ifdef BeforeVendorCF
+ 
+ #define ProjectRoot		AmoebaConf/$(ARCH).$(TOOLSET)/X11R5
+ 
+ #define CommonAmoebaDefines	-DAMOEBA -D$(ARCH)
+ #define StandardDefines		CommonAmoebaDefines
+ #define StandardCppDefines	StandardDefines
+ 
+ #endif /* BeforeVendorCF */
+ 
+ #ifdef AfterVendorCF
+ 
+ #define	InstallXdmConfig	NO
+ #define	InstallXinitConfig	NO
+ #define	InstallFSConfig		NO
+ 
+ #define UsrLibDir		$(DESTDIR)/public/module/x11/lib
+ #define	LibDir			$(DESTDIR)/public/module/x11/lib
+ #define ManDirectoryRoot	$(DESTDIR)/public/module/x11/man
+ #define	BinDir			$(DESTDIR)/public/module/x11/bin
+ #define IncRoot			$(DESTDIR)/public/module/x11/include
+ #define FontDir			$(DESTDIR)/public/module/x11/fonts/$(ARCH)
+ #define	DefaultRGBDatabase	$(DESTDIR)/public/module/x11/lib/rgb/$(ARCH)/rgb
+ 
+ #define	ManSuffix		1
+ #define	ManPath			ManDirectoryRoot
+ #define	XmanLocalSearchPath	ManDirectoryRoot
+ 
+ #define DefaultUserPath		:/bin:$(BINDIR)
+ #define DefaultSystemPath	/bin:$(BINDIR):
+ 
+ #define StandardIncludes	-I$(ATOP)/src/h -I$(ATOP)/src/h/posix -I$(ATOP)/src/h/posix/machdep/$(ARCH) -I$(ATOP)/src/h/machdep/arch/$(ARCH) -I$(ATOP)/src/h/toolset/$(TOOLSET)
+ 
+ /* XDMCP is turned on by default, this turns it off for Amoeba */
+ #ifdef GccGasOption
+ #define	ServerExtraDefines	-DXDEBUG -DNO_ALLOCA GccGasOption
+ #else
+ #define	ServerExtraDefines	-DXDEBUG -DNO_ALLOCA
+ #endif
+ 
+ #define	Malloc0ReturnsNull	YES
+ #define ServerInstallFlags	-s 32
+ #define FontDefines		-DFONT_SNF
+ #define ConnectionFlags		-DAMTCPCONN -DAMCONN
+ #ifndef ExtraFPLoadFlags
+ #define ExtraFPLoadFlags
+ #endif
+ #define OSLibraries		$(ALIB)/ajax/libajax.a $(ALIB)/amoeba/libamoeba.a $(ALIB)/math/libmath.a ExtraFPLoadFlags
+ 
+ ATOP		= AmoebaTop
+ ALIB		= AmoebaConf/$(ARCH).$(TOOLSET)/lib
+ #ifdef AckToolset 
+ /* The ACK toolset already links in the appropriate head.o by default */
+ HEAD		=
+ #else
+ HEAD		= $(ALIB)/head/head.o
+ #endif
+ 
+ ABIN		= AmoebaBin
+ AINSTALL	= /bin/sh $(SCRIPTSRC)/aminstall.sh $(ABIN)
+ AINSTALLFLAGS	=
+ TOB		= /bin/sh $(SCRIPTSRC)/aminstall.sh $(ABIN)
+ 
+ MKXDIRHIER	= /bin/sh $(SCRIPTSRC)/ammkdirhier.sh $(ABIN)
+ 
+ #endif /* AfterVendorCF */
+ 
diff -c /dev/null mit/config/amoeba.cf:1.2
*** /dev/null	Sat Mar 12 00:36:19 1994
--- mit/config/amoeba.cf	Sat Mar 12 00:36:19 1994
***************
*** 0 ****
--- 1,26 ----
+ XCOMM $XFree86: mit/config/amoeba.cf,v 1.2 1993/03/23 12:58:52 dawes Exp $
+ 
+ /*
+  * Defines for X11 Amoeba that are both compiler set and architecture
+  * independent.
+  */
+ #define	OSName			AMOEBA
+ #define	OSMajorVersion		5
+ #define	OSMinorVersion		1
+ #define OSVendor		Vrije Universiteit
+ 
+ #define	Amoeba			YES
+ 
+ #define BuildServer		YES
+ #define	BuildFonts		NO
+ #define BuildFontServer		NO
+ #define	BuildPex		NO
+ 
+ #define	ExecableScripts		NO
+ #define	HasPutenv		NO	/* will change, some day */
+ #define	HasVoidSignalReturn	YES
+ #define	HasSharedLibraries	NO
+ #define	HasShm			NO
+ #define	HasNdbm			YES	/* i.e. something that looks like it */
+ 
+ #define NdbmDefines		-DSDBM -DNDBM -I$(INCLUDESRC)
diff -c mit/config/att.cf:1.1.1.1 mit/config/att.cf:2.0
*** mit/config/att.cf:1.1.1.1	Sat Mar 12 00:36:20 1994
--- mit/config/att.cf	Sat Mar 12 00:36:20 1994
***************
*** 15,19 ****
  #define NeedWidePrototypes	NO	/* experimental */
  #define DefaultCCOptions	-Xc
  #define ServerOSDefines		-DSYSV386 -DATT
! #define X386Server		YES
  #include <sv4Lib.rules>
--- 15,19 ----
  #define NeedWidePrototypes	NO	/* experimental */
  #define DefaultCCOptions	-Xc
  #define ServerOSDefines		-DSYSV386 -DATT
! #define XF86SVGAServer		YES
  #include <sv4Lib.rules>
diff -c /dev/null mit/config/bsdLib.rules:2.1
*** /dev/null	Sat Mar 12 00:36:20 1994
--- mit/config/bsdLib.rules	Sat Mar 12 00:36:20 1994
***************
*** 0 ****
--- 1,73 ----
+ XCOMM $XFree86: mit/config/bsdLib.rules,v 2.1 1993/12/03 13:11:55 dawes Exp $
+ XCOMM $XConsortium: sunLib.rules,v 1.7 91/12/20 11:19:47 rws Exp $
+ 
+ /*
+  * NetBSD/FreeBSD shared library rules
+  */
+ 
+ #ifndef HasSharedLibraries
+ #define HasSharedLibraries YES
+ #endif
+ #ifndef ForceNormalLib
+ #define ForceNormalLib YES
+ #endif
+ #ifndef SharedDataSeparation
+ #define SharedDataSeparation NO
+ #endif
+ #ifndef SharedCodeDef
+ #define SharedCodeDef
+ #endif
+ #ifndef SharedLibraryDef
+ #define SharedLibraryDef -DBSDSHLIB
+ #endif
+ #ifndef ShLibIncludeFile
+ #define ShLibIncludeFile <bsdLib.tmpl>
+ #endif
+ #ifndef SharedLibraryLoadFlags
+ #define SharedLibraryLoadFlags -Bshareable
+ #endif
+ #ifndef PositionIndependentCFlags
+ #define PositionIndependentCFlags -fpic
+ #endif
+ 
+ /*
+  * InstallSharedLibrary - generate rules to install the shared library.
+  */
+ #ifndef InstallSharedLibrary
+ #define	InstallSharedLibrary(libname,rev,dest)				@@\
+ install:: Concat(lib,libname.so.rev) 					@@\
+ 	MakeDir($(DESTDIR)dest)						@@\
+ 	$(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
+ 
+ #endif /* InstallSharedLibrary */
+ 
+ /*
+  * NormalSharedLibraryTarget - generate rules to create a shared library;
+  * build it into a different name so that the we do not hose people by having
+  * the library gone for long periods.
+  */
+ #ifndef SharedLibraryTarget
+ #define SharedLibraryTarget(libname,rev,solist,down,up)			@@\
+ AllTarget(Concat(lib,libname.so.rev))					@@\
+ 									@@\
+ Concat(lib,libname.so.rev):  solist					@@\
+ 	$(RM) $@~							@@\
+ 	(cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
+ 	$(RM) $@ 							@@\
+ 	$(MV) $@~ $@  							@@\
+ 									@@\
+ clean::									@@\
+ 	$(RM) Concat(lib,libname.so.rev)
+ 
+ #endif /* SharedLibraryTarget */
+ 
+ /*
+  * SharedLibraryDataTarget - generate rules to create shlib data file;
+  */
+ #ifndef SharedLibraryDataTarget
+ #define SharedLibraryDataTarget(libname,rev,salist)
+ #endif /* SharedLibraryDataTarget */
+ 
+ #ifndef InstallSharedLibraryData
+ #define InstallSharedLibraryData(libname,rev,dest)
+ #endif /* InstallSharedLibraryData */
diff -c /dev/null mit/config/bsdLib.tmpl:2.1
*** /dev/null	Sat Mar 12 00:36:20 1994
--- mit/config/bsdLib.tmpl	Sat Mar 12 00:36:20 1994
***************
*** 0 ****
--- 1,79 ----
+ XCOMM $XFree86: mit/config/bsdLib.tmpl,v 2.1 1993/12/17 10:57:09 dawes Exp $
+ XCOMM $XConsortium: sunLib.tmpl,v 1.14.1.2 92/11/11 09:52.02 rws Exp $
+ 
+ /*
+  * SunOS shared library template
+  */
+ 
+ #ifndef SharedXlibRev
+ #define SharedXlibRev 2.0
+ #endif
+ #ifndef SharedOldXRev
+ #define SharedOldXRev 2.0
+ #endif
+ #ifndef SharedXtRev
+ #define SharedXtRev 2.0
+ #endif
+ #ifndef SharedXawRev
+ #define SharedXawRev 2.0
+ #endif
+ #ifndef SharedXmuRev
+ #define SharedXmuRev 2.0
+ #endif
+ #ifndef SharedXextRev
+ #define SharedXextRev 2.0
+ #endif
+ #ifndef SharedXinputRev
+ #define SharedXinputRev 2.0
+ #endif
+ #ifndef SharedXTrapRev
+ #define SharedXTrapRev 2.0
+ #endif
+ #ifndef SharedPexRev
+ #define SharedPexRev 2.0
+ #endif
+ 
+ SHLIBLDFLAGS = SharedLibraryLoadFlags
+ PICFLAGS = PositionIndependentCFlags
+ 
+ /*
+  * and now a little bit of magic for using imake without source tree; if we
+  * are using shared libraries, we really do not need to depend on anything
+  */
+ #if SharedLibXext
+   DEPEXTENSIONLIB = /* _UseCat($(USRLIBDIR),$(EXTENSIONSRC)/lib,/libXext.so.$(SOXEXTREV)) */
+      EXTENSIONLIB = _Use(-lXext,-L$(EXTENSIONSRC)/lib -lXext)
+ #endif
+ #if SharedLibX
+           DEPXLIB = $(DEPEXTENSIONLIB) /* _UseCat($(USRLIBDIR),$(XLIBSRC),/libX11.so.$(SOXLIBREV)) */
+              XLIB = $(EXTENSIONLIB) _Use(-lX11,-L$(XLIBSRC) -lX11)
+ #endif
+ #if SharedLibXmu
+ /* Sun shared libraries are deficient in link semantics */
+         DEPXMULIB = _UseCat($(USRLIBDIR),$(XMUSRC),/libXmu.so.$(SOXMUREV))
+        XMULIBONLY = _Use(-lXmu,-L$(XMUSRC) -lXmu)
+            XMULIB = _Use(-lXmu,-L$(XMUSRC) -lXmu -L$(TOOLKITSRC) -lXt -L$(EXTENSIONSRC)/lib -lXext -L$(XLIBSRC) -lX11)
+ #if !defined(UseInstalled) && !defined(XawClientLibs)
+ #define XawClientLibs $(XAWLIB) $(XMULIBONLY) $(XTOOLLIB) $(XLIB)
+ #endif
+ #endif
+ #if SharedOldLibX
+        DEPOLDXLIB = /* _UseCat($(USRLIBDIR),$(OLDXLIBSRC),/liboldX.so.$(SOOLDXREV)) */
+           OLDXLIB = _Use(-loldX,-L$(OLDXLIBSRC) -loldX)
+ #endif
+ #if SharedLibXt
+       DEPXTOOLLIB = _UseCat($(USRLIBDIR),$(TOOLKITSRC),/libXt.so.$(SOXTREV))
+          XTOOLLIB = _Use(-lXt,-L$(TOOLKITSRC) -lXt)
+ #endif
+ #if SharedLibXaw
+         DEPXAWLIB = _UseCat($(USRLIBDIR),$(AWIDGETSRC),/libXaw.so.$(SOXAWREV))
+            XAWLIB = _Use(-lXaw,-L$(AWIDGETSRC) -lXaw)
+ #endif
+ #if SharedLibXinput
+         DEPXILIB = /* _UseCat($(USRLIBDIR),$(XILIBSRC),/libXi.so.$(SOXINPUTREV)) */
+            XILIB = _Use(-lXi,-L$(XILIBSRC) -lXi)
+ #endif
+ #if SharedLibPex
+         DEPPEXLIB = /* _UseCat($(USRLIBDIR),$(PEXLIBSRC),/libPEX5.so.$(SOPEXREV)) */
+            PEXLIB = _Use(-lPEX5,-L$(PEXLIBSRC) -lPEX5)
+ #endif
diff -c /dev/null mit/config/gnu_am_i386.cf:1.1
*** /dev/null	Sat Mar 12 00:36:20 1994
--- mit/config/gnu_am_i386.cf	Sat Mar 12 00:36:20 1994
***************
*** 0 ****
--- 1,8 ----
+ XCOMM $XFree86: mit/config/gnu_am_i386.cf,v 1.1 1993/03/23 12:56:38 dawes Exp $
+ 
+ #include "x_am_i386.cf"
+ 
+ #define	ExtraLoadFlags		-lsoft
+ #define CrossConf		AmoebaConf
+ 
+ #include "gnucross386.cf"
diff -c /dev/null mit/config/gnu_mnx_386.cf:1.1
*** /dev/null	Sat Mar 12 00:36:21 1994
--- mit/config/gnu_mnx_386.cf	Sat Mar 12 00:36:21 1994
***************
*** 0 ****
--- 1,8 ----
+ XCOMM $XFree86: mit/config/gnu_mnx_386.cf,v 1.1 1993/03/23 12:56:39 dawes Exp $
+ 
+ #include "x_mnx_i386.cf"
+ 
+ #define ExtraLoadFlags		-lsoft -N
+ #define CrossConf		MinixConf
+ 
+ #include "gnucross386.cf"
diff -c /dev/null mit/config/gnucross386.cf:1.1
*** /dev/null	Sat Mar 12 00:36:21 1994
--- mit/config/gnucross386.cf	Sat Mar 12 00:36:21 1994
***************
*** 0 ****
--- 1,42 ----
+ XCOMM $XFree86: mit/config/gnucross386.cf,v 1.1 1993/03/23 12:56:40 dawes Exp $
+ 
+ #define CrossCompiling		YES
+ #define GnuToolset		YES
+ 
+ #define GccUsesGas		YES
+ #define UseGas			YES
+ 
+ #define GccGasOption		-DGCCUSESGAS
+ 
+ #define CcCmd			CrossConf/$(ARCH).$(TOOLSET)/toolset/do_gcc
+ #define ServerCcCmd		CcCmd
+ #define LdCmd			CrossConf/$(ARCH).$(TOOLSET)/toolset/do_ld
+ 
+ #define DoGccOption		-mam_i80386 -msoft
+ #define YaccCmd			byacc
+ #define DefaultCCOptions	DoGccOption -DNO_ASM -nodeps -fwritable-strings
+ #define LibraryCCOptions	DoGccOption -DNO_ASM -nodeps
+ #define LdCombineFlags		-r
+ #define OptimizedCDebugFlags	-O2
+ #define TermcapLibrary		/* in standard library */
+ 
+ #define GnuAr			CrossConf/$(ARCH).$(TOOLSET)/toolset/do_ar
+ #if HasLargeTmp
+ #define ArCmd			GnuAr crsv   /* use /tmp for temp files */
+ #else
+ #define ArCmd			GnuAr clrsv  /* use local dir for temp files */
+ #endif
+ #define RanlibCmd		/bin/true
+ 
+ #define AsCmd			CrossConf/$(ARCH).$(TOOLSET)/toolset/do_as
+ #define AsIncl			-I$(ATOP)/src/h/machdep/arch/$(ARCH)
+ #define AsmDefines		-DUSE_GAS
+ 
+ #define AssembleObject(flags) $(RM) $@                                  @@\
+ 	AsCmd -mam_i80386 -o $*.o AsmDefines $(INCLUDES) AsIncl flags $*.s
+ 
+ ARCH		= i80386
+ TOOLSET		= gnu-2
+ ALDFLAGS	= -mam_i80386
+ 
+ #include "x386.cf"
diff -c /dev/null mit/config/hostcc.def:1.1
*** /dev/null	Sat Mar 12 00:36:21 1994
--- mit/config/hostcc.def	Sat Mar 12 00:36:21 1994
***************
*** 0 ****
--- 1,13 ----
+ XCOMM $XFree86: mit/config/hostcc.def,v 1.1 1993/03/23 12:56:41 dawes Exp $
+ 
+ /* Host C compiler definitions.  Used in cross-compile environments in
+  * case we want to compile a program that should run on the host itself.
+  */
+ #ifdef CrossCompiling
+                CC = cc
+            CFLAGS = $(ALLINCLUDES) $(DEFINES)
+                AR = ar clq
+            RANLIB = ranlib
+                LD = cc
+         LDOPTIONS =
+ #endif /* CrossCompiling */
diff -c mit/config/imake.c:1.1.1.1 mit/config/imake.c:2.1
*** mit/config/imake.c:1.1.1.1	Sat Mar 12 00:36:22 1994
--- mit/config/imake.c	Sat Mar 12 00:36:22 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/config/imake.c,v 2.1 1993/12/18 11:42:21 dawes Exp $ */
  /* $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $ */
  
  /*****************************************************************************\
***************
*** 100,107 ****
--- 101,110 ----
  #include <ctype.h>
  #include "Xosdefs.h"
  #ifndef X_NOT_POSIX
+ #ifndef _POSIX_SOURCE
  #define _POSIX_SOURCE
  #endif
+ #endif
  #include <sys/types.h>
  #include <fcntl.h>
  #ifdef X_NOT_POSIX
***************
*** 129,135 ****
  #define waitSig(w)	WTERMSIG(w)
  typedef int		waitType;
  #else /* X_NOT_POSIX */
! #ifdef SYSV
  #define waitCode(w)	(((w) >> 8) & 0x7f)
  #define waitSig(w)	((w) & 0xff)
  typedef int		waitType;
--- 132,138 ----
  #define waitSig(w)	WTERMSIG(w)
  typedef int		waitType;
  #else /* X_NOT_POSIX */
! #if defined(SYSV) || defined(AMOEBA) || defined(_MINIX)
  #define waitCode(w)	(((w) >> 8) & 0x7f)
  #define waitSig(w)	((w) & 0xff)
  typedef int		waitType;
***************
*** 155,165 ****
--- 158,174 ----
  #if defined(macII) && !defined(__STDC__)  /* stdlib.h fails to define these */
  char *malloc(), *realloc();
  #endif /* macII */
+ #ifdef __NetBSD__
+ #include <sys/param.h>
+ #endif /* __NetBSD__ */
  #ifdef X_NOT_STDC_ENV
  extern char	*getenv();
  #endif
  #include <errno.h>
  extern int	errno;
+ #ifndef X_NO_STRERROR
+ #include <string.h>
+ #endif
  #include "imakemdep.h"
  
  
***************
*** 441,447 ****
--- 450,458 ----
  LogFatal(x0,x1)
  	char *x0, *x1;
  {
+ #ifdef X_NO_STRERROR
  	extern char	*sys_errlist[];
+ #endif
  	static boolean	entered = FALSE;
  
  	if (entered)
***************
*** 450,456 ****
--- 461,471 ----
  
  	fprintf(stderr, "%s: ", program);
  	if (errno)
+ #ifdef X_NO_STRERROR
  		fprintf(stderr, "%s: ", sys_errlist[ errno ]);
+ #else
+ 		fprintf(stderr, "%s: ", strerror(errno));
+ #endif
  	fprintf(stderr, x0,x1);
  	fprintf(stderr, "  Stop.\n");
  	wrapup();
***************
*** 493,498 ****
--- 508,520 ----
  		cleanedImakefile = CleanCppInput(Imakefile);
  		if ((pipeFile = fdopen(pipefd[1], "w")) == NULL)
  			LogFatalI("Cannot fdopen fd %d for output.", pipefd[1]);
+ #ifdef CROSS_COMPILE
+ 		fprintf(pipeFile, "#define INCLUDE_PLATFORM\t<platform.def>\n");
+ #endif
+ #ifdef __NetBSD__
+ 		fprintf(pipeFile, "#define __NetBSD__version__\t%d\n",
+ 			NetBSD);
+ #endif
  		fprintf(pipeFile, "#define IMAKE_TEMPLATE\t\"%s\"\n",
  			template);
  		fprintf(pipeFile, "#define INCLUDE_IMAKEFILE\t<%s>\n",
***************
*** 506,511 ****
--- 528,534 ----
  			if (WIFEXITED(status) && waitCode(status))
  				LogFatalI("Exit code %d.", waitCode(status));
  		}
+ 		freopen(outfname, "r+", outfd);
  		CleanCppOutput(outfd, outfname);
  	} else {	/* child... dup and exec cpp */
  		if (verbose)
***************
*** 710,722 ****
  		fseek(tmpfd, 0, 0);
  		fstat(fileno(tmpfd), &st);
  		pline = buf = Emalloc(st.st_size+1);
! 		total_red = read(fileno(tmpfd), buf, st.st_size);
  		if (total_red != st.st_size)
  			LogFatal("cannot read %s\n", tmpMakefile);
  		end = buf + st.st_size;
  		*end = '\0';
! 		lseek(fileno(tmpfd), 0, 0);
! #ifdef SYSV
  		freopen(tmpfname, "w+", tmpfd);
  #else	/* !SYSV */
  		ftruncate(fileno(tmpfd), 0);
--- 733,745 ----
  		fseek(tmpfd, 0, 0);
  		fstat(fileno(tmpfd), &st);
  		pline = buf = Emalloc(st.st_size+1);
! 		total_red = fread(buf, 1, st.st_size, tmpfd);
  		if (total_red != st.st_size)
  			LogFatal("cannot read %s\n", tmpMakefile);
  		end = buf + st.st_size;
  		*end = '\0';
! 		fseek(tmpfd, 0, 0);
! #if defined(SYSV) || defined(AMOEBA) || defined(_MINIX)
  		freopen(tmpfname, "w+", tmpfd);
  #else	/* !SYSV */
  		ftruncate(fileno(tmpfd), 0);
diff -c mit/config/imakemdep.h:1.1.1.1 mit/config/imakemdep.h:2.7
*** mit/config/imakemdep.h:1.1.1.1	Sat Mar 12 00:36:23 1994
--- mit/config/imakemdep.h	Sat Mar 12 00:36:23 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/config/imakemdep.h,v 2.7 1994/02/12 11:03:52 dawes Exp $
   * $XConsortium: imakemdep.h,v 1.38 91/08/25 11:36:39 rws Exp $
   * 
   * This file contains machine-dependent constants for the imake utility.
***************
*** 73,84 ****
  
  #ifdef SYSV386
  # ifdef SVR4
! #  define imake_ccflags "-Xc -DSVR4"
  # else
  #  define imake_ccflags "-DSYSV"
  # endif
  #endif
  
  #ifdef __convex__
  #define imake_ccflags "-fn -tm c1"
  #endif
--- 74,95 ----
  
  #ifdef SYSV386
  # ifdef SVR4
! #  ifdef SOLX86
! #    define imake_ccflags "-DSOLX86 -DSVR4"
! #  else
! #    define imake_ccflags "-Xc -DSVR4"
! #  endif
  # else
  #  define imake_ccflags "-DSYSV"
  # endif
  #endif
  
+ #ifdef MACH
+ # ifdef i386
+ #  define imake_ccflags "-DNOSTDHDRS"
+ # endif
+ #endif
+ 
  #ifdef __convex__
  #define imake_ccflags "-fn -tm c1"
  #endif
***************
*** 126,131 ****
--- 137,151 ----
  #if defined(_IBMR2) && !defined(DEFAULT_CPP)
  #define DEFAULT_CPP "/usr/lpp/X11/Xamples/util/cpp/cpp"
  #endif
+ #if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
+ #define DEFAULT_CPP "/usr/libexec/cpp"
+ #endif
+ #ifdef __bsdi__
+ #define DEFAULT_CPP "/usr/bin/cpp"
+ #endif
+ #ifdef SOLX86
+ #define DEFAULT_CPP "/usr/ccs/lib/cpp"
+ #endif 
  
  /*
   * Step 5:  cpp_argv
***************
*** 156,161 ****
--- 176,187 ----
  #ifdef unix
  	"-Uunix",	/* remove unix symbol so that filename unix.c okay */
  #endif
+ #if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined (__bsdi__)
+ 	"-traditional",
+ #endif
+ #ifdef __OSF__
+ 	"-traditional",
+ #endif
  #ifdef M4330
  	"-DM4330",	/* Tektronix */
  #endif
***************
*** 226,240 ****
  #endif /* MOTOROLA */
  #ifdef SYSV386           /* System V/386 folks */
  	"-DSYSV386",
  # ifdef SVR4
  	"-DSVR4",
  # endif
  # ifdef ISC
! 	"-DISC",         /* ISC 2.2.1 */
  # endif
  # ifdef SCO
  	"-DSCO",
  # endif
  # ifdef ESIX
  	"-DESIX",
  # endif
--- 252,288 ----
  #endif /* MOTOROLA */
  #ifdef SYSV386           /* System V/386 folks */
  	"-DSYSV386",
+ # ifdef SOLX86			 /* Solaris 2.1 x86 */
+     "-DSOLX86"
+ # endif
  # ifdef SVR4
  	"-DSVR4",
  # endif
  # ifdef ISC
! 	"-DISC",
! #  ifdef ISC30
! 	"-DISC30",       /* ISC 3.0 */
! #  else
! #   ifdef ISC202
! 	"-DISC202",      /* ISC 2.0.2 */
! #   else
! #    ifdef ISC40
! 	"-DISC40",       /* ISC 4.0 */
! #    else
! 	"-DISC22",       /* ISC 2.2.1 */
! #    endif
! #   endif
! #  endif
  # endif
+ # ifdef NCR
+ 	"-DNCR",
+ # endif
  # ifdef SCO
  	"-DSCO",
  # endif
+ # ifdef SCO324
+ 	"-DSCO324",
+ # endif
  # ifdef ESIX
  	"-DESIX",
  # endif
***************
*** 241,249 ****
  # ifdef ATT
  	"-DATT",
  # endif
! # ifdef DELL
! 	"-DDELL",
  #endif
  #endif
  };
  #else /* else MAKEDEPEND */
--- 289,303 ----
  # ifdef ATT
  	"-DATT",
  # endif
! #endif
! #ifdef __386BSD__
! # ifdef __FreeBSD__
! /* __FreeBSD__ is not defined by the OS in FreeBSD 1.0.2 or earlier. */
! 	"-D__FreeBSD__",
! # endif
  #endif
+ #ifdef linux
+ 	"-traditional",
  #endif
  };
  #else /* else MAKEDEPEND */
***************
*** 314,319 ****
--- 368,379 ----
  #ifdef CMU
  	{"CMU", "1"},
  #endif
+ #ifdef i386
+ 	{"i386", "1"},
+ #endif
+ #ifdef MACH
+ 	{"MACH", "1"},
+ #endif
  #ifdef luna
  	{"luna", "1"},
  #ifdef luna1
***************
*** 348,354 ****
  	{"bsd43", "1"},
  #endif
  #ifdef hcx
! 	{"hcx", 1},
  #endif
  	/* add any additional symbols before this line */
  	{NULL, NULL}
--- 408,426 ----
  	{"bsd43", "1"},
  #endif
  #ifdef hcx
! 	{"hcx", "1"},
! #endif
! #ifdef __386BSD__
! 	{"__386BSD__", "1"},
! #endif
! #ifdef __NetBSD__
! 	{"__NetBSD__", "1"},
! #endif
! #ifdef __FreeBSD__
! 	{"__FreeBSD__", "1"},
! #endif
! #ifdef __bsdi__
! 	{"__bsdi__", "1"},
  #endif
  	/* add any additional symbols before this line */
  	{NULL, NULL}
diff -c /dev/null mit/config/lnuxLib.rules:2.8
*** /dev/null	Sat Mar 12 00:36:23 1994
--- mit/config/lnuxLib.rules	Sat Mar 12 00:36:23 1994
***************
*** 0 ****
--- 1,384 ----
+ XCOMM $XFree86: mit/config/lnuxLib.rules,v 2.8 1994/03/08 06:10:55 dawes Exp $
+ /*
+  * Linux shared library rules (DLL version)
+  */
+ #ifndef HasSharedLibraries
+ #define HasSharedLibraries YES
+ #endif
+ #ifndef ForceNormalLib
+ #define ForceNormalLib NO
+ #endif
+ 
+ #ifndef SharedLibX
+ #define SharedLibX HasSharedLibraries
+ #endif
+ #ifndef SharedOldLibX
+ #define SharedOldLibX NO
+ #endif
+ #ifndef SharedLibXt
+ #define SharedLibXt HasSharedLibraries
+ #endif
+ #ifndef SharedLibXaw
+ #define SharedLibXaw HasSharedLibraries
+ #endif
+ #ifndef SharedLibXmu
+ #define SharedLibXmu HasSharedLibraries
+ #endif
+ #ifndef SharedLibXext
+ #define SharedLibXext HasSharedLibraries
+ #endif
+ #ifndef SharedLibXTest
+ #define SharedLibXTest HasSharedLibraries
+ #endif
+ #ifndef NormalLibXTest
+ #define NormalLibXTest (!SharedLibXTest | ForceNormalLib)
+ #endif
+ #ifndef SharedLibXinput
+ #define SharedLibXinput HasSharedLibraries
+ #endif
+ #ifndef SharedLibPex
+ #define SharedLibPex HasSharedLibraries
+ #endif
+ 
+ #ifndef SharedDataSeparation
+ #define SharedDataSeparation NO
+ #endif
+ #ifndef SharedCodeDef
+ #define SharedCodeDef /**/
+ #endif
+ #ifndef SharedLibraryDef
+ #define SharedLibraryDef /**/
+ #endif
+ #ifndef ShLibIncludeFile
+ #define ShLibIncludeFile <lnuxLib.tmpl>
+ #endif
+ #ifndef SharedLibraryLoadFlags
+ #define SharedLibraryLoadFlags /**/
+ #endif
+ #ifndef PositionIndependentCFlags
+ #define PositionIndependentCFlags -B/usr/dll/jump/
+ #endif
+ 
+ DLL_BINDIR = /usr/dll/bin
+ 
+ /*
+  * These definitions are now extended to work with the X sources and
+  * external sources wishing to build shared libs.
+  *
+  * A library can create it's own shlibs (.so) or can be incorporated into
+  * another "host" lib. All libraries generate stub (.sa) files.
+  * A "host" lib does all the work to generate the stubs for itself and its
+  * "guests", invoking the "guest" Makefiles to create the objects for
+  * inclusion into the "host" shlib. A "guest" lib will ask the "host" to
+  * create the stubfiles, then copy its own into its directory.
+  * Most external libs are "host" libs; the concept of "guest" is a holdover
+  * from older libs during the days of scarce shared library address space.
+  *
+  * To create a simple "host" shared lib, Xfoo, define:
+  *
+  *  JUMP_ROOT_Xfoo = <source directory>
+  *  JUMP_IS_HOST_Xfoo = YES
+  *  JUMP_STUBLIBS_Xfoo = libXfoo.sa
+  *  JUMP_DIR_Xfoo = $(JUMP_ROOT_Xfoo)/shared		<work directory>
+  *  JUMP_VARS_Xfoo = $(JUMP_ROOT_Xfoo)/jump_vars	<see DLL docs>
+  *  JUMP_FUNCS_Xfoo = $(JUMP_ROOT_Xfoo)/jump_funcs	<see DLL docs>
+  *  JUMP_IGNORE_Xfoo = $(JUMP_ROOT_Xfoo)/jump_ignore	<see DLL docs>
+  *  JUMP_ADDRESS_Xfoo = 0xXXXXXXXX			<fill in with address>
+  *  JUMP_JUMPTABLESIZE_Xfoo = 0x4000			<adjust if necessary>
+  *  JUMP_GOTSIZE_Xfoo = 4096				<adjust if necessary>
+  *  JUMP_STUBNAMES_Xfoo = libXfoo			<and others>
+  *  JUMP_STUBS_IMPORT_Xfoo = /usr/lib/libc.sa		<and others>
+  *  JUMP_LDLIBS_Xfoo = `$(CC) --print` -lc		<and others>
+  *
+  * To create a complex "host", you need to add
+  *  JUMP_SIBARS_Xt = jump/libXbar.a~			<and others>
+  * These are the archives of the shared objects of the "guest" libs. They
+  * need to be added to the JUMP_LDLIBS_Xfoo lines.
+  *
+  * For further clarification, study the definitions of libXaw, a simple "host"
+  * lib, libXt, a complex "host" lib, and libXmu, one of libXts "guests".
+  *
+  * As a hint of how to start (with the DLL docs), touch jump_vars, jump_funcs
+  * and jump_ignore, then compile. Then massage the jump.vars and jump.funcs
+  * files in the shared subdirectory into jump_xxx files.
+  */
+ 
+ #ifndef UseInstalled
+ XCOMM These are only needed to build the server
+ 
+ XCOMM libX11.so (X11)
+ JUMP_ROOT_X11 = $(XLIBSRC)
+ JUMP_IS_HOST_X11 = YES
+ JUMP_STUBLIBS_X11 = libX11.sa
+ JUMP_DIR_X11 = $(JUMP_ROOT_X11)/shared
+ JUMP_VARS_X11 = $(JUMP_ROOT_X11)/jump_vars
+ JUMP_FUNCS_X11 = $(JUMP_ROOT_X11)/jump_funcs
+ JUMP_IGNORE_X11 = $(JUMP_ROOT_X11)/jump_ignore
+ JUMP_ADDRESS_X11 = 0x60200000
+ JUMP_JUMPTABLESIZE_X11 = 0x4000
+ JUMP_GOTSIZE_X11 = 4096
+ JUMP_STUBNAMES_X11 = libX11
+ JUMP_STUBS_IMPORT_X11 = /usr/lib/libc.sa
+ JUMP_LDLIBS_X11 = `$(CC) --print` -lc
+ 
+ XCOMM libXt.so (Xt, Xmu, Xext, Xi, Xtst)
+ JUMP_ROOT_Xt = $(TOOLKITSRC)
+ JUMP_IS_HOST_Xt = YES
+ JUMP_STUBLIBS_Xt = libXt.sa libXmu.sa libXext.sa libXi.sa libXtst.sa
+ JUMP_SUBDIRS_Xt = $(JUMP_ROOT_X11)
+ JUMP_SIBDIRS_Xt = $(JUMP_ROOT_Xmu) $(JUMP_ROOT_Xext) \
+ 	$(JUMP_ROOT_Xi) $(JUMP_ROOT_Xtst)
+ JUMP_DIR_Xt = $(JUMP_ROOT_Xt)/shared
+ JUMP_VARS_Xt = $(JUMP_ROOT_Xt)/jump_vars
+ JUMP_FUNCS_Xt = $(JUMP_ROOT_Xt)/jump_funcs
+ JUMP_IGNORE_Xt = $(JUMP_ROOT_Xt)/jump_ignore
+ JUMP_IMPORT_Xt = $(JUMP_VARS_X11)
+ JUMP_ADDRESS_Xt = 0x602a0000
+ JUMP_JUMPTABLESIZE_Xt = 0x4000
+ JUMP_GOTSIZE_Xt = 4096
+ JUMP_STUBNAMES_Xt = libXt libXmu libXext libXi libXtst
+ JUMP_STUBS_IMPORT_Xt = $(JUMP_STUBS_IMPORT_X11)
+ JUMP_SIBARS_Xt = jump/libXmu.a~ jump/libXext.a~ jump/libXi.a~ jump/libXtst.a~
+ JUMP_LDLIBS_Xt = $(JUMP_SIBARS_Xt) $(JUMP_ROOT_X11)/libX11.sa $(JUMP_LDLIBS_X11)
+ 
+ XCOMM libXmu (part of libXt.so)
+ JUMP_ROOT_Xmu = $(XMUSRC)
+ JUMP_IS_HOST_Xmu = NO
+ JUMP_HOST_Xmu = $(JUMP_ROOT_Xt)
+ JUMP_DIR_Xmu = $(JUMP_DIR_Xt)
+ 
+ XCOMM libXext (part of libXt.so)
+ JUMP_ROOT_Xext = $(EXTENSIONSRC)/lib
+ JUMP_IS_HOST_Xext = NO
+ JUMP_HOST_Xext = $(JUMP_ROOT_Xt)
+ JUMP_DIR_Xext = $(JUMP_DIR_Xt)
+ 
+ XCOMM libXi (part of libXt.so)
+ JUMP_ROOT_Xi = $(XILIBSRC)
+ JUMP_IS_HOST_Xi = NO
+ JUMP_HOST_Xi = $(JUMP_ROOT_Xt)
+ JUMP_DIR_Xi = $(JUMP_DIR_Xt)
+ 
+ XCOMM libXtst (part of libXt.so)
+ JUMP_ROOT_Xtst = $(EXTENSIONSRC)/lib/xtest
+ JUMP_IS_HOST_Xtst = NO
+ JUMP_HOST_Xtst = $(JUMP_ROOT_Xt)
+ JUMP_DIR_Xtst = $(JUMP_DIR_Xt)
+ 
+ XCOMM libXaw.so (Xaw)
+ JUMP_ROOT_Xaw = $(AWIDGETSRC)
+ JUMP_IS_HOST_Xaw = YES
+ JUMP_STUBLIBS_Xaw = libXaw.sa
+ JUMP_SUBDIRS_Xaw = $(JUMP_ROOT_Xt)
+ JUMP_DIR_Xaw = $(JUMP_ROOT_Xaw)/shared
+ JUMP_VARS_Xaw = $(JUMP_ROOT_Xaw)/jump_vars
+ JUMP_FUNCS_Xaw = $(JUMP_ROOT_Xaw)/jump_funcs
+ JUMP_IGNORE_Xaw = $(JUMP_ROOT_Xaw)/jump_ignore
+ JUMP_IMPORT_Xaw = $(JUMP_VARS_Xt) $(JUMP_VARS_X11)
+ JUMP_ADDRESS_Xaw = 0x60300000
+ JUMP_JUMPTABLESIZE_Xaw = 0x4000
+ JUMP_GOTSIZE_Xaw = 4096
+ JUMP_STUBNAMES_Xaw = libXaw
+ JUMP_STUBS_IMPORT_Xaw = $(JUMP_STUBS_IMPORT_X11)
+ JUMP_LDLIBS_Xaw = $(JUMP_ROOT_Xt)/libXt.sa $(JUMP_ROOT_Xt)/libXmu.sa \
+ 	$(JUMP_ROOT_Xt)/libXext.sa $(JUMP_ROOT_X11)/libX11.sa \
+ 	$(JUMP_LDLIBS_X11)
+ 
+ # libPEX.so (PEX5)
+ JUMP_ROOT_PEX5 = $(EXTENSIONSRC)/lib/PEXlib
+ JUMP_IS_HOST_PEX5 = YES
+ JUMP_STUBLIBS_PEX5 = libPEX5.sa
+ JUMP_SUBDIRS_PEX5 = $(JUMP_ROOT_X11)
+ JUMP_DIR_PEX5 = $(JUMP_ROOT_PEX5)/shared
+ JUMP_VARS_PEX5 = $(JUMP_ROOT_PEX5)/jump_vars
+ JUMP_FUNCS_PEX5 = $(JUMP_ROOT_PEX5)/jump_funcs
+ JUMP_IGNORE_PEX5 = $(JUMP_ROOT_PEX5)/jump_ignore
+ JUMP_IMPORT_PEX5 = $(JUMP_VARS_X11)
+ JUMP_ADDRESS_PEX5 = 0x60b00000
+ JUMP_JUMPTABLESIZE_PEX5 = 0x4000
+ JUMP_GOTSIZE_PEX5 = 4096
+ JUMP_STUBNAMES_PEX5 = libPEX5
+ JUMP_STUBS_IMPORT_PEX5 = $(JUMP_STUBS_IMPORT_X11) /usr/lib/libm.sa
+ JUMP_LDLIBS_PEX5 = $(JUMP_ROOT_X11)/libX11.sa $(JUMP_LDLIBS_X11) -lm
+ 
+ #endif /* !UseInstalled */
+ 
+ /*
+  * SharedLibraryDataTarget - generate rules to create shared data file
+  */
+ #ifndef SharedLibraryDataTarget
+ #define SharedLibraryDataTarget(libname,rev,salist)
+ #endif
+ 
+ /*
+  * SharedLibraryTarget - generate rules to create a shared library;
+  * There are two basic flavors of libs: self-generating, which create
+  * their own (and possibly other) libs, and hosted, which rely on another
+  * lib for all the work.
+  */
+ #ifndef SharedLibraryTarget
+ #define SharedLibraryTarget(libname,rev,solist,down,up)			@@\
+ XCOMM This logic is such to compile the libs in their proper order,	@@\
+ XCOMM remain dependent on subsidiary libs, and yet minimize local work	@@\
+ 									@@\
+ JUMP_DIR=./jump								@@\
+ JUMP_LIB=Concat(lib,libname)						@@\
+ 									@@\
+ XCOMM  this is needed for newer gnumake versions			@@\
+ 	export JUMP_DIR JUMP_LIB					@@\
+ 									@@\
+ JUMP_IS_HOST=$(Concat(JUMP_IS_HOST_,libname))				@@\
+ JUMP_AR=$(JUMP_DIR)/Concat(lib,libname.a~)				@@\
+ JUMP_SA=Concat(lib,libname.sa)						@@\
+ JUMP_SO=Concat(lib,libname.so.rev)					@@\
+ 									@@\
+ JUMP_HOST=$(Concat(JUMP_HOST_,libname))					@@\
+ 									@@\
+ INSTSOLIBFLAGS=-m 0555							@@\
+ 									@@\
+ AllTarget($(JUMP_SA))							@@\
+ 									@@\
+ $(JUMP_SA) $(Concat(JUMP_STUBLIBS_,libname)) do_JUMP_SA: \
+ 		down/mk_JUMP_SA_$(JUMP_IS_HOST)				@@\
+ 									@@\
+ down/mk_JUMP_SA_0:: mk_JUMP_HOST					@@\
+ 									@@\
+ down/mk_JUMP_SA_0:: $(JUMP_HOST)/$(JUMP_SA)				@@\
+ 	$(RM) $(JUMP_SA)						@@\
+ 	$(LN) $(JUMP_HOST)/$(JUMP_SA) $(JUMP_SA)			@@\
+ 	touch $@							@@\
+ 									@@\
+ down/mk_JUMP_SA_1:: $(JUMP_SO)						@@\
+ 									@@\
+ down/mk_JUMP_SA_1:: down/mk_JUMP_SO_2					@@\
+ 	$(RM) $(Concat(JUMP_STUBLIBS_,libname))				@@\
+ 	$(DLL_BINDIR)/mkstubs -v rev -l $(JUMP_LIB) \
+ 		-a $(Concat(JUMP_ADDRESS_,libname)) \
+ 		-j $(Concat(JUMP_JUMPTABLESIZE_,libname)) \
+ 		-g $(Concat(JUMP_GOTSIZE_,libname)) \
+ 		-- $(Concat(JUMP_STUBNAMES_,libname))			@@\
+ 	$(DLL_BINDIR)/verify-shlib -l $(JUMP_SO) \
+ 		$(Concat(JUMP_STUBLIBS_,libname)) && \
+ 		$(RM) verify.out					@@\
+ 	touch $@							@@\
+ 									@@\
+ mk_JUMP_HOST:								@@\
+ 	@echo checking stub library $(JUMP_SA) in $(JUMP_HOST)...	@@\
+ 	@(cd $(JUMP_HOST); $(MAKE) $(MFLAGS) $(JUMP_SA)) || exit 1	@@\
+ 	@echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...	@@\
+ 									@@\
+ $(JUMP_SO): down/mk_JUMP_SO_$(JUMP_IS_HOST)				@@\
+ 									@@\
+ down/mk_JUMP_SO_0:							@@\
+ 									@@\
+ down/mk_JUMP_SO_1:: $(JUMP_AR) mk_JUMP_SIBDIRS down/mk_JUMP_SO_2	@@\
+ 									@@\
+ down/mk_JUMP_SO_2: down/mk_JUMP_AR $(Concat(JUMP_SIBARS_,libname))	@@\
+ 	$(RM) $(JUMP_SO)						@@\
+ 	$(DLL_BINDIR)/mkimage -f -v rev -l $(JUMP_LIB) \
+ 		-a $(Concat(JUMP_ADDRESS_,libname)) \
+ 		-j $(Concat(JUMP_JUMPTABLESIZE_,libname)) \
+ 		-g $(Concat(JUMP_GOTSIZE_,libname)) \
+ 		-- $(JUMP_AR) $(Concat(JUMP_LDLIBS_,libname))		@@\
+ 	$(RM) $(JUMP_DIR)/__jump.s $(JUMP_DIR)/__jump.o			@@\
+ 	touch $@							@@\
+ 									@@\
+ mk_JUMP_SIBDIRS:							@@\
+ 	@for d in $(Concat(JUMP_SIBDIRS_,libname)); do \
+ 		echo checking ar library in $$d...; \
+ 		(cd $$d ; $(MAKE) $(MFLAGS) fastdo_JUMP_AR) || edit 1; \
+ 		echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...;done@@\
+ 									@@\
+ fastdo_JUMP_AR: $(JUMP_DIR) down/mk_JUMP_AR				@@\
+ 									@@\
+ $(JUMP_AR) do_JUMP_AR:: jumpsetup down/mk_JUMP_AR			@@\
+ 									@@\
+ jumpsetup: $(JUMP_DIR) jumpsetup_$(JUMP_IS_HOST)			@@\
+ 									@@\
+ $(JUMP_DIR):								@@\
+ 	$(RM) jump							@@\
+ 	LibMkdir($(Concat(JUMP_DIR_,libname)))				@@\
+ 	$(LN) $(Concat(JUMP_DIR_,libname)) jump				@@\
+ 									@@\
+ jumpsetup_0:								@@\
+ 	@echo doing jump setup in host $(JUMP_HOST)...			@@\
+ 	@(cd $(JUMP_HOST); $(MAKE) $(MFLAGS) jumpsetup) || exit 1	@@\
+ 	@echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...	@@\
+ 									@@\
+ jumpsetup_1::								@@\
+ 	@for d in $(Concat(JUMP_SUBDIRS_,libname)); do \
+ 		echo checking stub library in $$d...; \
+ 		(cd $$d ; $(MAKE) $(MFLAGS) do_JUMP_SA) || exit 1; \
+ 		echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...;done@@\
+ 									@@\
+ jumpsetup_1:: $(JUMP_DIR)/jump.funcs $(JUMP_DIR)/jump.vars \
+ 	$(JUMP_DIR)/jump.ignore $(JUMP_DIR)/jump.import			@@\
+ 									@@\
+ $(JUMP_DIR)/jump.funcs: $(Concat(JUMP_FUNCS_,libname))			@@\
+ 	$(RM) $(JUMP_DIR)/jump.funcs					@@\
+ 	cat $(Concat(JUMP_FUNCS_,libname)) > $@				@@\
+ 									@@\
+ $(JUMP_DIR)/jump.vars: $(Concat(JUMP_VARS_,libname))			@@\
+ 	$(RM) $(JUMP_DIR)/jump.vars					@@\
+ 	cat $(Concat(JUMP_VARS_,libname)) > $@				@@\
+ 									@@\
+ $(JUMP_DIR)/jump.ignore: $(Concat(JUMP_IGNORE_,libname))		@@\
+ 	$(RM) $(JUMP_DIR)/jump.ignore					@@\
+ 	cat $(Concat(JUMP_IGNORE_,libname)) > $@			@@\
+ 									@@\
+ $(JUMP_DIR)/jump.import: $(JUMP_DIR)/stubs.import \
+ 		$(Concat(JUMP_IMPORT_,libname))				@@\
+ 	$(RM) $(JUMP_DIR)/jump.import					@@\
+ 	cat $(JUMP_DIR)/stubs.import $(Concat(JUMP_IMPORT_,libname)) > $@ @@\
+ 									@@\
+ $(JUMP_DIR)/stubs.import: $(Concat(JUMP_STUBS_IMPORT_,libname))		@@\
+ 	$(RM) $(JUMP_DIR)/stubs.import					@@\
+ 	nm --no-cplus $(Concat(JUMP_STUBS_IMPORT_,libname)) | grep '__GOT__' | \
+ 		sed 's/__GOT__/_/' > $@					@@\
+ 									@@\
+ down/mk_JUMP_AR: solist							@@\
+ 	$(RM) $(JUMP_AR)						@@\
+ 	(cd down; $(AR) up/$(JUMP_AR) solist) || exit 1			@@\
+ 	$(RANLIB) $(JUMP_AR)						@@\
+ 	touch $@							@@\
+ 									@@\
+ clean:: jumpclean							@@\
+ 									@@\
+ jumpclean: jumpclean_$(JUMP_IS_HOST)					@@\
+ 	$(RM) $(JUMP_SA) $(JUMP_DIR)/__jump.s $(JUMP_DIR)/__jump.o \
+ 		down/mk_JUMP_AR $(JUMP_AR)				@@\
+ 	$(RM) -r $(JUMP_DIR)						@@\
+ 									@@\
+ jumpclean_0:								@@\
+ 	$(RM) down/mk_JUMP_SA_0						@@\
+ 									@@\
+ jumpclean_1:								@@\
+ 	$(RM) $(JUMP_SO) $(JUMP_DIR)/_GCMN_*.s $(JUMP_DIR)/_GVAR_*.s \
+ 		$(JUMP_DIR)/jump.vars $(JUMP_DIR)/jump.funcs \
+ 		$(JUMP_DIR)/jump.ignore $(JUMP_DIR)/jump.params \
+ 		$(JUMP_DIR)/jump.undefs $(JUMP_DIR)/jump.log \
+ 		$(JUMP_DIR)/jump.import $(JUMP_DIR)/stubs.import \
+ 		down/mk_JUMP_SA_1 down/mk_JUMP_SO_1 down/mk_JUMP_SO_2
+ #endif /* SharedLibraryTarget */
+ 
+ /*
+  * InstallSharedLibrary - generate rules to install the shared library.
+  */
+ #ifndef InstallSharedLibrary
+ #define	InstallSharedLibrary(libname,rev,dest)				@@\
+ install:: $(JUMP_SA) $(JUMP_SO)						@@\
+ 	MakeDir($(DESTDIR)dest)						@@\
+ 	@if [ "$(JUMP_IS_HOST)" = YES ]; then \
+ 		(T=$(DESTDIR)dest/`echo $(JUMP_SO)|sed 's/\.[^\.]*\.[^\.]*$$//'`;\
+ 		set -x; \
+ 		$(INSTALL) -s -c $(INSTSOLIBFLAGS) $(JUMP_SO) $(DESTDIR)dest; \
+ 		$(RM) $$T && $(LN) $(DESTDIR)dest/$(JUMP_SO) $$T); fi	@@\
+ 	$(INSTALL) -c $(INSTLIBFLAGS) $(JUMP_SA) $(DESTDIR)dest
+ #endif /* InstallSharedLibrary */
+ 
+ /*
+  * InstallSharedLibraryData - generate rules to install the shared library data
+  */
+ #ifndef InstallSharedLibraryData
+ #define	InstallSharedLibraryData(libname,rev,dest)
+ #endif /* InstallSharedLibraryData */
diff -c /dev/null mit/config/lnuxLib.tmpl:2.0
*** /dev/null	Sat Mar 12 00:36:24 1994
--- mit/config/lnuxLib.tmpl	Sat Mar 12 00:36:24 1994
***************
*** 0 ****
--- 1,75 ----
+ XCOMM $XFree86: mit/config/lnuxLib.tmpl,v 2.0 1993/08/29 14:15:39 dawes Exp $
+ /*
+  * Linux shared library template
+  */
+ #ifndef SharedXlibRev
+ #define SharedXlibRev 3.1.0
+ #endif
+ #ifndef SharedOldXRev
+ #define SharedOldXRev 3.1.0
+ #endif
+ #ifndef SharedXtRev
+ #define SharedXtRev 3.1.0
+ #endif
+ #ifndef SharedXawRev
+ #define SharedXawRev 3.1.0
+ #endif
+ #ifndef SharedXmuRev
+ #define SharedXmuRev 3.1.0
+ #endif
+ #ifndef SharedXextRev
+ #define SharedXextRev 3.1.0
+ #endif
+ #ifndef SharedXinputRev
+ #define SharedXinputRev 3.1.0
+ #endif
+ #ifndef SharedPexRev
+ #define SharedPexRev 1.1.0
+ #endif
+ 
+ SHLIBLDFLAGS = SharedLibraryLoadFlags
+ PICFLAGS = PositionIndependentCFlags
+ 
+ /*
+  * and now a little bit of magic for using imake without source tree; if we
+  * are using shared libraries, we really do not need to depend on anything
+  */
+ #if SharedLibXext
+   DEPEXTENSIONLIB = /* _UseCat($(USRLIBDIR),$(EXTENSIONSRC)/lib,/libXext.sa.$(SOXEXTREV)) */
+      EXTENSIONLIB = _Use(-lXext,-L$(EXTENSIONSRC)/lib -lXext)
+ #endif
+ #if SharedLibX
+           DEPXLIB = $(DEPEXTENSIONLIB) /* _UseCat($(USRLIBDIR),$(XLIBSRC),/libX11.sa.$(SOXLIBREV)) */
+              XLIB = $(EXTENSIONLIB) _Use(-lX11,-L$(XLIBSRC) -lX11)
+ #endif
+ #if SharedLibXmu
+         DEPXMULIB = /* _UseCat($(USRLIBDIR),$(XMUSRC),/libXmu.sa.$(SOXMUREV)) */
+            XMULIB = _Use(-lXmu,-L$(XMUSRC) -lXmu)
+ #ifndef XawClientLibs
+ #define XawClientLibs $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
+ #endif
+ #endif
+ #if SharedOldLibX
+        DEPOLDXLIB = /* _UseCat($(USRLIBDIR),$(OLDXLIBSRC),/liboldX.sa.$(SOOLDXREV)) */
+           OLDXLIB = _Use(-loldX,-L$(OLDXLIBSRC) -loldX)
+ #endif
+ #if SharedLibXt
+       DEPXTOOLLIB = /* _UseCat($(USRLIBDIR),$(TOOLKITSRC),/libXt.sa.$(SOXTREV)) */
+          XTOOLLIB = _Use(-lXt,-L$(TOOLKITSRC) -lXt)
+ #endif
+ #if SharedLibXaw
+         DEPXAWLIB = /* _UseCat($(USRLIBDIR),$(AWIDGETSRC),/libXaw.sa.$(SOXAWREV)) */
+            XAWLIB = _Use(-lXaw,-L$(AWIDGETSRC) -lXaw)
+ #endif
+ #if SharedLibXinput
+         DEPXILIB = /* _UseCat($(USRLIBDIR),$(XILIBSRC),/libXi.sa.$(SOXINPUTREV)) */
+            XILIB = _Use(-lXi,-L$(XILIBSRC) -lXi)
+ #endif
+ #if SharedLibXTest
+     DEPXTESTLIB = /* _UseCat($(USRLIBDIR),$(EXTENSIONSRC)/lib,/libXtst.sa.$(SOXEXTREV)) */
+        XTESTLIB = _Use(-lXtst,-L$(EXTENSIONSRC)/lib/xtest -lXtst)
+ #endif
+ #if SharedLibPex
+         DEPPEXLIB = /* _UseCat($(USRLIBDIR),$(PEXLIBSRC),/libPEX5.sa.$(SOPEXREV)) */
+          PEXLIB = _Use(-lPEX5,-L$(PEXLIBSRC) -lPEX5)
+ #endif
diff -c /dev/null mit/config/minix.cf:1.2
*** /dev/null	Sat Mar 12 00:36:24 1994
--- mit/config/minix.cf	Sat Mar 12 00:36:24 1994
***************
*** 0 ****
--- 1,25 ----
+ XCOMM $XFree86: mit/config/minix.cf,v 1.2 1993/04/20 05:09:29 dawes Exp $
+ 
+ /*
+  * Defines for Minix/X386 that are compiler set independent.
+  */
+ #define	OSName			Minix
+ #define	OSMajorVersion		1
+ #define	OSMinorVersion		6
+ #define	OSVendor		/**/
+ 
+ #define	Minix			YES
+ 
+ #define BuildServer		YES
+ #define	BuildFonts		NO
+ #define BuildFontServer		NO
+ #define	BuildPex		NO
+ 
+ #define	ExecableScripts		NO
+ #define	HasPutenv		YES
+ #define	HasVoidSignalReturn	YES
+ #define	HasSharedLibraries	NO
+ #define	HasShm			NO
+ #define	HasNdbm			YES	/* i.e. something that looks like it */
+ 
+ #define NdbmDefines             -DSDBM -DNDBM -I$(INCLUDESRC)
diff -c /dev/null mit/config/mnx_site.def:1.1
*** /dev/null	Sat Mar 12 00:36:24 1994
--- mit/config/mnx_site.def	Sat Mar 12 00:36:25 1994
***************
*** 0 ****
--- 1,68 ----
+ XCOMM $XFree86: mit/config/mnx_site.def,v 1.1 1993/03/23 12:56:44 dawes Exp $
+ 
+ /*
+  * Minix configuration defines that should require no change.
+  */
+ #ifdef BeforeVendorCF
+ 
+ #define ProjectRoot		MinixConf/$(ARCH).$(TOOLSET)/X11R5
+ 
+ #define CommonMinixDefines	-D_POSIX_C_SOURCE=2 -D_POSIX_SOURCE=2 -D_MINIX=2 -D_PCH_EXT -D_VMD_EXT -D_ARCH=_IBM_386_VM -D_ACK_LIB
+ #define StandardDefines		CommonMinixDefines
+ #define StandardCppDefines	StandardDefines
+ 
+ #endif /* BeforeVendorCF */
+ 
+ #ifdef AfterVendorCF
+ 
+ #define	InstallXdmConfig	NO
+ #define	InstallXinitConfig	NO
+ #define	InstallFSConfig		NO
+ 
+ #define MinixLibX11		/usr/lib/X11
+ #define UsrLibDir		MinixLibX11
+ #define LibDir			MinixLibX11
+ #define ManDirectoryRoot	MinixLibX11/man
+ #define IncRoot			MinixLibX11/include
+ #define FontDir			MinixLibX11/fonts
+ #define DefaultRGBDatabase      MinixLibX11/rgb
+ #define BinDir			/usr/X386/bin
+ 
+ #define DefaultUserPath		:/bin:$(BINDIR)
+ #define DefaultSystemPath	/bin:$(BINDIR):
+ 
+ #define StandardIncludes	-I$(MTOP)/incl -I$(MTOP)/include -I$(MTOP)/include/vmd -I$(MTOP)/include/minix
+ 
+ /* ServerExtraDefines contains -DXDMCP by default */
+ #ifdef AckToolset
+ #define	ServerExtraDefines	-DNO_ALLOCA
+ #else
+ #ifdef GccGasOption
+ #define	ServerExtraDefines	GccGasOption
+ #endif
+ #endif
+ 
+ #define	Malloc0ReturnsNull	YES
+ #define FontDefines		-DFONT_SNF
+ #define ConnectionFlags		-DTCPCONN
+ #ifndef ExtraFPLoadFlags
+ #define ExtraFPLoadFlags
+ #endif
+ #define OSLibraries		$(MLIB)/libc/libc.a ExtraFPLoadFlags
+ 
+ MTOP		= MinixTop
+ MLIB		= MinixConf/$(ARCH).$(TOOLSET)/lib
+ #ifdef AckToolset 
+ HEAD		=
+ #else
+ HEAD		= $(MLIB)/crtso/crtso.o
+ #endif
+ 
+ ABIN		= MinixBin
+ AINSTALL	= /bin/sh $(SCRIPTSRC)/aminstall.sh $(ABIN)
+ AINSTALLFLAGS	=
+ TOB		= /bin/sh $(SCRIPTSRC)/aminstall.sh $(ABIN)
+ MKXDIRHIER	= /bin/sh $(SCRIPTSRC)/ammkdirhier.sh $(ABIN)
+ 
+ #endif /* AfterVendorCF */
+ 
diff -c mit/config/site.def:1.1.1.1 mit/config/site.def:2.41
*** mit/config/site.def:1.1.1.1	Sat Mar 12 00:36:25 1994
--- mit/config/site.def	Sat Mar 12 00:36:25 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/config/site.def,v 2.41 1994/03/07 13:53:40 dawes Exp $
  XCOMM site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  
  /*****************************************************************************
***************
*** 23,32 ****
   *                                                                           *
   *****************************************************************************/
  
  #ifdef BeforeVendorCF
  
! /* #define HasGcc YES */
  
  #endif /* BeforeVendorCF */
  
  #ifdef AfterVendorCF
--- 24,460 ----
   *                                                                           *
   *****************************************************************************/
  
+ #ifdef AmoebaConf
+ #include "am_site.def"
+ #endif
+ 
+ #ifdef MinixConf
+ #include "mnx_site.def"
+ #endif
+ 
  #ifdef BeforeVendorCF
  
! /*****************************************************************************
!  *                                                                           *
!  * Make/Build parameters                                                     *
!  *                                                                           *
!  *****************************************************************************/
! 
! /*
!  * To build only the servers with a cut-down source tree, uncomment
!  * this.
!  */
! 
! /* #define BuildServersOnly	YES */
! 
! /*
!  * If you are using ISC's original make (which has a hash table bug),
!  * uncomment this. You will not get dependencies as a result in
!  * mit/lib/X, but better then nothing. (Using GNU make instead is recommended.)
!  */
! /* #define MakeHashTableBug YES */
! 
! /*
!  * To build normal libraries in addition to shared libraries uncomment this
!  *	defaults:
!  *		SVR4:		NO
!  *		SVR3:		YES
!  *		Linux:		NO
!  *		NetBSD, FreeBSD YES
!  */
! /* #define ForceNormalLib	YES */
! 
! /*
!  * To build shared libs on NetBSD uncomment this.
!  *	defaults:
!  *		FreeBSD:	YES
!  *		others:		NO
!  */
! /* #define BuildBsdSharedLibs	YES */
! 
! /*
!  * HasLibCrypt: If your system uses a separate libcrypt.a, uncomment this.
!  *	    defaults:
!  *		NetBsd, FreeBsd YES
!  *		others:		NO
!  */
! /* #define HasLibCrypt		YES */
! 
! /*
!  * UseGccMakeDepend: Uses 'gcc -M' to generate Makefile dependency lists.
!  *                   This is much slower than the "standard" makedepend
!  *                   but is more accurate.
!  *	    defaults:
!  *		same as HasGcc
!  */
! /* #define UseGccMakeDepend	NO */
! 
! /*****************************************************************************
!  *                                                                           *
!  * Compiler parameters                                                       *
!  *                                                                           *
!  *****************************************************************************/
! 
! /*
!  * HasGcc: defaults:
!  *		SVR3,4:		YES
!  *		NCR:		NO
!  *		Mach, 386bsd:	YES
!  *		linux:		YES
!  */
! /* #define HasGcc 		NO */
! 
! /*
!  * HasGcc2: (should also set HasGcc)
!  *	    defaults:
!  *		SVR3,4:		YES
!  *		NCR:		NO
!  *		Mach, 386bsd:	NO
!  *		NetBSD, FreeBSD YES
!  *		linux:		YES
!  */
! /* #define HasGcc2		NO */
! 
! /*
!  * ProWorksHome: location of the ProWorks compiler on Solaris x86, and can
!  *               be ignored if you are using gcc.
!  *	    defaults:
!  *		Solaris x86:	/opt/SUNWspro
!  *
!  *    NOTE: ProWorks installs by default into /opt/SUNWspro. Use this option
!  *    to override the default location if ProWorks is installed in a
!  *    place other than /opt/SUNWspro
!  */
! /* #define ProWorksHome  /opt/SUNWspro */
! 
! /*
!  * GccUsesGas: Required if your gcc uses gas as its assembler.
!  *          defaults:
!  *		SVR3,4		NO
!  *		Mach, 386bsd:	YES
!  *		linux:		YES
!  */
! /* #define GccUsesGas	YES */
! 
! /*
!  * UseGas: Required if you use gas as your assembler.
!  *          defaults:
!  *		SVR3,4		NO
!  *		Mach, 386bsd:	YES
!  *		linux:		YES
!  */
! /* #define UseGas		YES */
! 
! /*
!  * GnuCpp:
!  *	    defaults:
!  *		SVR3,4:		NO
!  *		Mach:		NO
!  *		386bsd:		YES
!  *		linux:		YES
!  */
! /* #define GnuCpp		YES */
! 
! /*
!  * If you are building for a 386 you can uncomment this.  It is not
!  * necessary that you do this because the -m486 compiled binaries run
!  * without performance loss on a 386 CPU.  This option is only used
!  * when using gcc-2.x
!  */
! /* #define Target_486	NO */
! 
! /*****************************************************************************
!  *                                                                           *
!  * Networking parameters                                                     *
!  *                                                                           *
!  *****************************************************************************/
! 
! /* If you don't want to include SCO's Xsight connection code for SVR4,
!  * uncomment this (all SVR4's should be able to compile this).
!  * Note: you must have SVR4.0.4 or later, with the 'Advanced Compatibility
!  * Package' (iBSC-2 compatibility) to make use of this feature. 
!  */
! /* #define SCOLocalConnSysv4 NO */
! 
! /* If you don't have sockets, uncomment this */
! /* #define HasSockets	NO */
! 
! /*****************************************************************************
!  *                                                                           *
!  * Other compile-time parameters                                             *
!  *                                                                           *
!  *****************************************************************************/
! 
! /*
!  * HasShadowPasswd: Required if your system uses shadow passwords.
!  *          defaults:
!  *		SVR3,4:		YES
!  *		Mach, 386bsd:	NO
!  *		linux:		NO
!  */
! /* #define HasShadowPasswd	NO */
! 
! /*****************************************************************************
!  *                                                                           *
!  * Select features to be built/not built                                     *
!  *                                                                           *
!  *****************************************************************************/
! 
! /* You need the DES stuff from MIT to use this */
! /* #define HasXdmAuth	YES */
! 
! /*
!  * To include MIT-SHM support for BSD systems, uncomment the following
!  *	    defaults:
!  *		SVR3,4:		YES
!  *		linux:		YES
!  *		Mach, OSF/1	NO
!  *		FreeBSD		YES
!  *		other BSD	NO
!  */
! /* #define HasShm		YES */
! 
! /* To exclude XTEST support, uncomment the following */
! /* #define BuildXTest	NO */
! 
! /* Do you *really* want PEX? */
! /* #define BuildPex	YES */
! 
! /*****************************************************************************
!  *                                                                           *
!  * Font-related parameters                                                   *
!  *                                                                           *
!  *****************************************************************************/
! 
! /* To build the Font Server, uncomment the following */
! /* #define BuildFontServer	YES */
! 
! /* Usually only want to build fonts once */
! #define BuildFonts	NO
! 
! /* If you don't want to compress pcf fonts, uncomment this */
! /* #define CompressAllFonts	NO */
! 
! /* If you want to build 100dpi fonts, uncomment this */
! /* #define Build100Dpi	YES */
! 
! /* If you don't want to build 75dpi fonts, uncomment this */
! /* #define Build75Dpi	NO */
  
+ /* If you want to build the k14, jiskan, hanglg fonts, uncomment this */
+ /* #define BuildLargeMiscFonts	YES */
+ 
+ /* If you want Type1 code included */
+ #if !defined(AmoebaConf) && !defined(MinixConf) && !defined(OsfArchitecture)
+ #define BuildType1	YES
+ #endif
+ 
+ /* If you don't want to build Speedo fonts, uncomment this */
+ /* #define BuildSpeedo	NO */
+ 
+ /*
+  * Select Font Renderers to include.  This overrides BuildType1 and 
+  * BuildSpeedo above - it's best to leave this alone and use the above
+  * defines unless you are adding a custom font renderer.
+  *
+  * Default: Speedo
+  */
+ /* #define FontRenderers	Speedo */
+ 
+ /*****************************************************************************
+  *                                                                           *
+  * Server-related parameters                                                 *
+  *                                                                           *
+  *****************************************************************************/
+ 
+ /* Uncomment this if you don't want to build the server */
+ /* #define BuildServer	NO */
+ 
+ /* Change YES to NO for servers you don't want to build */
+ 
+ /* Build the 256 colour SVGA server */
+ #define XF86SVGAServer		YES
+ 
+ /* Build the 16 colour server */
+ #define XF86VGA16Server		YES
+ 
+ /* Build the monochrome server */
+ #define XF86MonoServer		YES
+ 
+ /* Build the S3 server */
+ #define XF86S3Server		YES
+ 
+ /* Build the 8514/A server */
+ #define XF86I8514Server		YES
+ 
+ /* Build the Mach8 server */
+ #define XF86Mach8Server		YES
+ 
+ /* Build the Mach32 server */
+ #define XF86Mach32Server	YES
+ 
+ /* Set the default server (ie the one that gets the sym-link to "X") */
+ /* #define XFree86DefaultServer	XF86_S3 */
+ 
+ /*
+  * Select drivers in 256-colour server
+  *
+  * Default: et4000 et3000 pvga1 gvga ati tvga8900 cirrus ncr compaq
+  */
+ /* #define X386Vga256Drivers	et4000 et3000 pvga1 gvga ati tvga8900 cirrus \
+ 				ncr oak compaq */
+ /*
+  * Select drivers in 16-colour server
+  *
+  * Default: et4000 tvga8900 generic
+  */
+ /* #define X386Vga16Drivers	et4000 tvga8900 generic */
+ 
+ /*
+  * Select (S)VGA drivers in monochrome server
+  *
+  * Default: et4000 et3000 pvga1 gvga tvga8900 ncr compaq generic
+  */
+ /* #define X386Vga2Drivers	et4000 et3000 pvga1 gvga tvga8900 ncr \
+ 				compaq oak generic */
+ /*
+  * To include the Hercules driver in the monochrome server, uncomment this:
+  */
+ /* #define X386Hga2Drivers		hga6845 */
+ 
+ /*
+  * To include the generic banked monochrome driver in the monochrome server,
+  * uncomment this with one of the following low level drivers
+  * 	hgc1280		[Hyundai HGC-1280 1280x1024]
+  *	sigma		[Sigma L-View]
+  *	visa		[???]
+  *	...
+  *	(list is subject to grow)
+  */
+ /* #define X386Bdm2Drivers		hgc1280 sigma visa */
+ 
+ /*
+  * Select drivers in the accelerated S3 server
+  */
+ /* #define XF86S3Drivers		mmio_928 s3_generic */
+ 
+ /* Uncomment this to include support for SVR3 mmap driver */
+ /* #define HasSVR3mmapDrv	YES */
+ 
+ /* Uncomment this to include support for Solaris aperture driver */
+ /* #define HasSolx86apertureDrv	YES */
+ 
+ /* Uncomment this if you want to build a debuggable server */
+ /* #define DebuggableServer	YES */
+ 
+ /* Uncomment this if you are using Conor Cahill's debugging malloc library */
+ /* #define SpecialMalloc	YES */
+ 
+ /* Uncomment this if you want to link with the Gnu malloc library */
+ /* #define GnuMalloc		YES */
+ 
+ /*
+  * GnuMallocLib: link-time flags to include the Gnu malloc library.
+  * this is only used when GnuMalloc is set to YES.
+  *	    defaults:
+  *		386bsd:		-lgnumalloc
+  *		others:		-lgmalloc
+  */
+ /* #define GnuMallocLib		-L/usr/local/gnu -lmalloc */
+ 
+ /*
+  * Set this to disable blanking the screen during startup (can be useful
+  * for debugging)
+  */
+ /* #define DirtyStartup	YES */
+ 
+ /*****************************************************************************
+  *                                                                           *
+  * Client-related parameters                                                 *
+  *                                                                           *
+  *****************************************************************************/
+ 
+ /*
+  * Set logging parameters for xterm.  By default, logging is off because of
+  * security problems.  It can be turned on by defining XtermLogFlags to be
+  * -DALLOWLOGGING  -- BUT THIS IS A SECURITY RISK.
+  */
+ 
+ /* #define XtermLogFlags		-DALLOWLOGGING */
+ 
+ /*****************************************************************************
+  *                                                                           *
+  * Installation-related parameters                                           *
+  *                                                                           *
+  *****************************************************************************/
+ 
+ /*
+  * Enable these if you want to automatically install these config files
+  * Be careful of overwriting customised files
+  */
+ /*
+ #define InstallXdmConfig YES
+ #define InstallXinitConfig YES
+ #define InstallFSConfig YES
+ */
+ 
+ /*****************************************************************************
+  *                                                                           *
+  * Manual page parameters                                                    *
+  *                                                                           *
+  *****************************************************************************/
+ 
+ /*
+  * Only for SVR3, 386BSD, FreeBSD and NetBSD.
+  * FormattedManPages: To install unformatted man pages, set this to NO.
+  *	    defaults:
+  *		SVR3:		YES
+  *		FreeBSD:	NO
+  *		other BSD	YES
+  */
+ /* #define FormattedManPages NO */
+ 
+ /*
+  * The default man page installation paramters have been moved to x386.cf
+  * and may be overriden here.  Note that these are ignored for preformatted
+  * man pages on *BSD -- where all suffices are '0'.
+  *
+  *	    defaults:		ManSuffix	LibManSuffix	FileManSuffix
+  *	        SVR3,4:		   1x    	    3x      	      4
+  *	        others:		   1x    	    3x      	      5x
+  */
+ 
+ /*
+  * Only for SVR3:
+  * Remove obsolete .DE and .DS macros from manual pages
+  *	defaults:
+  *		ISC 2.2, 3.0:	YES
+  *		SVR3:		NO
+  */
+ /* #define RemoveDSDENroffMacros YES */
+ 
+ /* Only for SVR3:
+  * Compress installed manual pages
+  *	defaults:
+  *		ISC, SCO:	YES
+  *		SVR3:		NO
+  */
+ /* #define CompressManPages YES */
+ 
+ /*
+  * If you compress the manual pages and want to use gzip, uncomment this.
+  * Use the first line if you are using gzip version 1.0.7 or earlier, and
+  * the second for gzip 1.1 or later.
+  *	default:	compress -v
+  */
+ /* #define CompressManCmd	gzip -v */
+ /* #define CompressManCmd	gzip -v --suffix .z */
+ 
+ /* If you don't like the 'x' at the end, uncomment these: */
+ /* #define ManSuffix		1 */
+ /* #define LibManSuffix		3 */
+ /* #define FileManSuffix	5  */
+ 
  #endif /* BeforeVendorCF */
  
  #ifdef AfterVendorCF
***************
*** 37,41 ****
--- 465,470 ----
  #endif
  #define ProjectRoot /usr/X11R5
  */
+ 
  
  #endif /* AfterVendorCF */
diff -c /dev/null mit/config/sv3Lib.rules:1.2
*** /dev/null	Sat Mar 12 00:36:26 1994
--- mit/config/sv3Lib.rules	Sat Mar 12 00:36:26 1994
***************
*** 0 ****
--- 1,192 ----
+ XCOMM $XFree86: mit/config/sv3Lib.rules,v 1.2 1993/03/06 09:02:42 dawes Exp $
+ /*
+  * SVR3 shared library rules
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * Author: Thomas Wolfram, thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de
+  * Conception derived partially from work of Thomas Roell
+  */
+ 
+ #ifndef HasSharedLibraries
+ #define HasSharedLibraries YES
+ #endif
+ #ifndef ForceNormalLib
+ #define ForceNormalLib YES
+ #endif
+ 
+ #ifndef SharedLibX
+ #define SharedLibX HasSharedLibraries
+ #endif
+ #ifndef SharedOldLibX
+ #define SharedOldLibX NO		/* it's obsolete */
+ #endif
+ #ifndef SharedLibXt
+ #define SharedLibXt HasSharedLibraries
+ #endif
+ #ifndef SharedLibXaw
+ #define SharedLibXaw HasSharedLibraries
+ #endif
+ #ifndef SharedLibXmu
+ #define SharedLibXmu HasSharedLibraries
+ #endif
+ #ifndef SharedLibXext
+ #define SharedLibXext HasSharedLibraries
+ #endif
+ #ifndef SharedLibXinput
+ #define SharedLibXinput HasSharedLibraries
+ #endif
+ #ifndef SharedLibPex
+ #define SharedLibPex NO
+ #endif
+ 
+ #ifndef SharedDataSeparation
+ #define SharedDataSeparation NO
+ #endif
+ #ifndef SharedCodeDef
+ #define SharedCodeDef /**/
+ #endif
+ #ifndef SharedLibraryDef
+ #define SharedLibraryDef -DSVR3SHLIB
+ #endif
+ #ifndef ShLibIncludeFile
+ #define ShLibIncludeFile <sv3Lib.tmpl>
+ #endif
+ #ifndef SharedLibraryLoadFlags
+ #define SharedLibraryLoadFlags -q
+ #endif
+ #ifndef PositionIndependentCFlags
+ #if HasGcc2
+ #define PositionIndependentCFlags -msvr3-shlib  
+ #else
+ #define PositionIndependentCFlags /**/
+ #endif
+ #endif
+ 
+ /*
+  * LibCleanDir - helper for cleaning library object subdirectories
+  */
+ #ifndef LibCleanDir
+ #define LibCleanDir(dir) -@if [ -d dir ]; then \                           @@\
+                 (set -x; cd dir; $(RM) *.o *.sd); else exit 0; fi
+ #endif
+ 
+ /*
+  * SharedLibObjCompile - compile fragment for shared objects
+  */
+ #ifndef SharedLibObjCompile
+ #define SharedLibObjCompile(options) $(RM) shared/$@ 	                   @@\
+ 	cat import.h $*.c >_$*.c                                           @@\
+         $(CC) -c $(ANSICCOPTIONS) $(CCOPTIONS) $(ALLDEFINES) options \     @@\
+ $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS) $(CDEBUGFLAGS) _$*.c              @@\
+ 	$(MV) _$*.o shared/$@                                              @@\
+ 	$(RM) _$*.c
+ #endif
+ 
+ /*
+  * NormalSharedLibObjCompile - compile fragment for shared object when
+  * a normal library is not being built
+  */
+ #ifndef NormalSharedLibObjCompile
+ #define NormalSharedLibObjCompile(options) $(RM) $@                        @@\
+ 	cat import.h $*.c >_$*.c                                           @@\
+         $(CC) -c $(CFLAGS) options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS) _$*.c @@\
+ 	$(MV) _$*.o $@                                                     @@\
+ 	$(RM) _$*.c
+ #endif
+ 
+ 
+ #ifndef LibraryObjectRule
+ #define LibraryObjectRule()                                             @@\
+ all::                                                                   @@\
+         _DebuggedLibMkdir()                                             @@\
+         _ProfiledLibMkdir()                                             @@\
+         _SharedLibMkdir()                                               @@\
+                                                                         @@\
+ includes::                                                              @@\
+         _DebuggedLibMkdir()                                             @@\
+         _ProfiledLibMkdir()                                             @@\
+         _SharedLibMkdir()                                               @@\
+                                                                         @@\
+ .c.o:                                                                   @@\
+         _DebuggedObjCompile($(_NOOP_))                                  @@\
+         _ProfiledObjCompile($(_NOOP_))                                  @@\
+         _SharedObjCompile($(_NOOP_))                                    @@\
+         _NormalObjCompile($(_NOOP_))                                    @@\
+                                                                         @@\
+ .SUFFIXES: .sd                                                          @@\
+ .c.sd:                                                                  @@\
+         _SharedDatCompile(-DSVR3SHDAT)                                  @@\
+                                                                         @@\
+ clean::                                                                 @@\
+         _DebuggedCleanDir()                                             @@\
+         _ProfiledCleanDir()                                             @@\
+         _SharedCleanDir()                                               @@\
+ 
+ #endif /* LibraryObjectRule */
+ 
+ 
+ /*
+  * InstallSharedLibrary - generate rules to install the shared library.
+  */
+ #ifndef InstallSharedLibrary
+ #if StripInstalledPrograms
+ #define	InstallSharedLibrary(libname,rev,dest)				@@\
+ install:: Concat(lib,libname.rev) 					@@\
+ 	MakeDir($(DESTDIR)dest)						@@\
+ 	$(INSTALL) -c $(INSTLIBFLAGS) Concat3(lib,libname,_s.a) $(DESTDIR)dest @@\
+ 	MakeDir($(DESTDIR)$(LIBDIR)/shlib)                              @@\
+         $(INSTALL) -c $(INSTPGMFLAGS) Concat(lib,libname.rev) \         @@\
+ 	$(DESTDIR)$(LIBDIR)/shlib                                       @@\
+ 	strip Concat($(DESTDIR)$(LIBDIR)/shlib/lib,libname.rev)         @@\
+ 	mcs -d Concat($(DESTDIR)$(LIBDIR)/shlib/lib,libname.rev)
+ #else
+ #define	InstallSharedLibrary(libname,rev,dest)				@@\
+ install:: Concat(lib,libname.rev) 					@@\
+ 	MakeDir($(DESTDIR)dest)						@@\
+ 	$(INSTALL) -c $(INSTLIBFLAGS) Concat3(lib,libname,_s.a) $(DESTDIR)dest @@\
+ 	MakeDir($(DESTDIR)$(LIBDIR)/shlib)                              @@\
+         $(INSTALL) -c $(INSTPGMFLAGS) Concat(lib,libname.rev) \         @@\
+ 	$(DESTDIR)$(LIBDIR)/shlib
+ #endif
+ 
+ #endif /* InstallSharedLibrary */
+ 
+ /*
+  * InstallSharedLibraryData - generate rules to install the shared library data
+  */
+ #ifndef InstallSharedLibraryData
+ #define	InstallSharedLibraryData(libname,rev,dest)
+ #endif /* InstallSharedLibraryData */
+ 
+ 
+ /*
+  * SharedLibraryTarget - generate rules to create a shared library;
+  * build it into a different name so that we do not hose people by having
+  * the library gone for long periods.
+  */
+ #ifndef SharedLibraryTarget
+ #define SharedLibraryTarget(libname,rev,solist,down,up)			@@\
+ AllTarget(Concat(lib,libname.rev))					@@\
+ 									@@\
+ Concat(lib,libname.rev):  solist					@@\
+ 	$(RM) $@ Concat3(lib,libname,_s.a)				@@\
+         $(CPP) -DDOWN=down ConnectionFlags ShlibDefines Concat(lib,libname.def) | \ @@\
+         sed -e '/^#  *[0-9][0-9]*  *.*$$/d; /^$$/d' >spec.cpp           @@\
+         sed -e '1,/#libraries/d; /#externals/,$$d' spec.cpp | \         @@\
+         nawk '{ system("ar x " $$1 " " $$2 )}'                          @@\
+         echo "#target " Concat($(LIBDIR)/shlib/lib,libname.rev) >spec   @@\
+         sed -e '/#libraries/,$$d' spec.cpp >>spec                             @@\
+         mkshlib -s spec -t $@ -h Concat3(lib,libname,_s.a) $(SHLIBLDFLAGS)    @@\
+         ar rulv Concat3(lib,libname,_s.a) `sed -e '1,/#externals/d' spec.cpp` @@\
+         $(RM) spec.cpp spec                                             @@\
+ 									@@\
+ clean::									@@\
+ 	$(RM) Concat(lib,libname.rev) Concat3(lib,libname,_s.a)
+ 
+ #endif /* SharedLibraryTarget */
+ 
+ /*
+  * SharedLibraryDataTarget - generate rules to create shlib data file;
+  */
+ #ifndef SharedLibraryDataTarget
+ #define SharedLibraryDataTarget(libname,rev,salist)
+ #endif /* SharedLibraryTarget */
diff -c /dev/null mit/config/sv3Lib.tmpl:1.3
*** /dev/null	Sat Mar 12 00:36:27 1994
--- mit/config/sv3Lib.tmpl	Sat Mar 12 00:36:27 1994
***************
*** 0 ****
--- 1,73 ----
+ XCOMM $XFree86: mit/config/sv3Lib.tmpl,v 1.3 1993/04/27 15:38:30 dawes Exp $
+ /*
+  * SVR3 shared library template
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * Author: Thomas Wolfram, thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de
+  * Conception derived partially from work of Thomas Roell
+  */
+ 
+ #ifndef SharedXlibRev
+ #define SharedXlibRev 5.0.1
+ #endif
+ #ifndef SharedOldXRev
+ #define SharedOldXRev 5.0
+ #endif
+ #ifndef SharedXtRev
+ #define SharedXtRev 5.0
+ #endif
+ #ifndef SharedXawRev
+ #define SharedXawRev 5.0
+ #endif
+ #ifndef SharedXmuRev
+ #define SharedXmuRev 5.0
+ #endif
+ #ifndef SharedXextRev
+ #define SharedXextRev 5.0
+ #endif
+ #ifndef SharedXinputRev
+ #define SharedXinputRev 5.0
+ #endif
+ #ifndef SharedPexRev
+ #define SharedPexRev 1.0
+ #endif
+ 
+      SHLIBLDFLAGS = SharedLibraryLoadFlags
+          PICFLAGS = PositionIndependentCFlags
+ 
+ /*
+  * and now a little bit of magic for using imake without source tree; if we
+  * are using shared libraries, we really do not need to depend on anything
+  */
+ #if SharedLibXext
+   DEPEXTENSIONLIB = _UseCat($(USRLIBDIR),$(EXTENSIONSRC)/lib,/libXext_s.a)
+      EXTENSIONLIB = LoaderLibPrefix _Use(-lXext_s, $(DEPEXTENSIONLIB))
+ #endif
+ #if SharedLibX
+           DEPXLIB = $(DEPEXTENSIONLIB) _UseCat($(USRLIBDIR),$(XLIBSRC),/libX11_s.a)
+              XLIB = $(EXTENSIONLIB) LoaderLibPrefix _Use(-lX11_s,$(XLIBSRC)/libX11_s.a)
+ #endif
+ #if SharedLibXmu
+         DEPXMULIB = _UseCat($(USRLIBDIR),$(XMUSRC),/libXmu_s.a)
+            XMULIB = LoaderLibPrefix _Use(-lXmu_s,$(DEPXMULIB))
+ #endif
+ #if SharedOldLibX
+        DEPOLDXLIB = _UseCat($(USRLIBDIR),$(OLDXLIBSRC),/liboldX_s.a)
+           OLDXLIB = LoaderLibPrefix _Use(-loldX_s,$(DEPOLDXLIB))
+ #endif
+ #if SharedLibXt
+       DEPXTOOLLIB = _UseCat($(USRLIBDIR),$(TOOLKITSRC),/libXt_s.a)
+          XTOOLLIB = LoaderLibPrefix _Use(-lXt_s,$(DEPXTOOLLIB))
+ #endif
+ #if SharedLibXaw
+         DEPXAWLIB = _UseCat($(USRLIBDIR),$(AWIDGETSRC),/libXaw_s.a)
+            XAWLIB = LoaderLibPrefix _Use(-lXaw_s,$(DEPXAWLIB))
+ #endif
+ #if SharedLibXinput
+          DEPXILIB = _UseCat($(USRLIBDIR),$(XILIBSRC),/libXi_s.a)
+             XILIB = LoaderLibPrefix _Use(-lXi_s,$(DEPXILIB))
+ #endif
+ #if SharedLibPhigs
+       DEPPHIGSLIB = _UseCat($(USRLIBDIR),$(PHIGSLIBSRC),/libphigs_s.a)
+          PHIGSLIB = LoaderLibPrefix _Use(-lphigs_s,$(DEPPHIGSLIB))
+ #endif
+ 
diff -c mit/config/sv4Lib.rules:1.1.1.1 mit/config/sv4Lib.rules:2.0
*** mit/config/sv4Lib.rules:1.1.1.1	Sat Mar 12 00:36:28 1994
--- mit/config/sv4Lib.rules	Sat Mar 12 00:36:28 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/config/sv4Lib.rules,v 2.0 1993/12/10 14:32:22 dawes Exp $
  XCOMM $XConsortium: sv4Lib.rules,v 1.8 91/07/19 15:38:53 rws Exp $
  
  /*
***************
*** 23,35 ****
--- 24,50 ----
  #define SharedLibraryLoadFlags -G -z text
  #endif
  #ifndef PositionIndependentCFlags
+ #if HasGcc2
+ #define PositionIndependentCFlags -fPIC
+ #else
  #define PositionIndependentCFlags -K PIC
  #endif
+ #endif
+ 
  
  /*
   * InstallSharedLibrary - generate rules to install the shared library.
   */
  #ifndef InstallSharedLibrary
+ #if StripInstalledPrograms
+ #define	InstallSharedLibrary(libname,rev,dest)				@@\
+ install:: Concat(lib,libname.so.rev) 					@@\
+ 	MakeDir($(DESTDIR)dest)						@@\
+ 	$(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
+ 	mcs -d Concat($(DESTDIR)dest/lib,libname.so.rev)		@@\
+ 	$(RM) Concat($(DESTDIR)dest/lib,libname.so)			@@\
+ 	$(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)
+ #else
  #define	InstallSharedLibrary(libname,rev,dest)				@@\
  install:: Concat(lib,libname.so.rev) 					@@\
  	MakeDir($(DESTDIR)dest)						@@\
***************
*** 36,41 ****
--- 51,57 ----
  	$(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  	$(RM) Concat($(DESTDIR)dest/lib,libname.so)			@@\
  	$(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)
+ #endif
  
  #endif /* InstallSharedLibrary */
  
***************
*** 53,59 ****
--- 69,92 ----
   * the library gone for long periods.
   */
  #ifndef SharedLibraryTarget
+ #if defined(i386Solarisx86)
+ #define SharedLibraryTarget(libname,rev,solist,down,up)			@@\
+ AllTarget(Concat(lib,libname.so.rev))					@@\
+ 									@@\
+ Concat(lib,libname.so.rev):  solist					@@\
+ 	$(RM) $@~							@@\
+ 	(cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ solist $(REQUIREDLIBS) $(LDLINKPATH)) @@\
+ 	$(RM) $@							@@\
+ 	$(MV) $@~ $@							@@\
+ 	$(RM) Concat(lib,libname.so)					@@\
+ 	$(LN) $@ Concat(lib,libname.so)					@@\
+ 									@@\
+ clean::									@@\
+ 	$(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
+ 
+ #else
  #define SharedLibraryTarget(libname,rev,solist,down,up)			@@\
+ 									@@\
  AllTarget(Concat(lib,libname.so.rev))					@@\
  									@@\
  Concat(lib,libname.so.rev):  solist					@@\
***************
*** 66,71 ****
--- 99,105 ----
  									@@\
  clean::									@@\
  	$(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
+ #endif /* Solaris x86 */
  
  #endif /* SharedLibraryTarget */
  
diff -c mit/config/x386.cf:1.1.1.1 mit/config/x386.cf:2.41
*** mit/config/x386.cf:1.1.1.1	Sat Mar 12 00:36:29 1994
--- mit/config/x386.cf	Sat Mar 12 00:36:29 1994
***************
*** 1,31 ****
  XCOMM platform:  $XConsortium: x386.cf,v 1.7 91/08/16 19:30:10 gildea Exp $
  
  /*****************************************************************************
!  *			  Site-specfic parameters                            *
   *****************************************************************************/
  
  /*
!  * there are some switches to set appropriate...
   */
  
! #define HasGcc			YES	/* doesn't work for SVR4 */
! #define HasSockets		YES
! #define HasNdbm			YES	/* correct for GNU dbm & SVR4 */
! #define ProjectRoot		/usr/X386
! #define StripInstalledPrograms	YES
! #define X386Server		YES
! #define ExtensionOSDefines	-DXTESTEXT1
! #define MotifBC	        	YES
  
! /*****************************************************************************
!  *                        Do not change anything below                       *
!  *****************************************************************************/
  
  /* You must manually compute BootstrapCFlags for initial build */
! #define BootstrapCFlags		OSDefines OSRelease
  
  #define StandardDefines		OSDefines OSRelease
! #define LdCombineFlags		-r
  
  #if defined(i386SVR3Architecture)
  
--- 1,569 ----
+ XCOMM $XFree86: mit/config/x386.cf,v 2.41 1994/03/06 06:41:16 dawes Exp $
  XCOMM platform:  $XConsortium: x386.cf,v 1.7 91/08/16 19:30:10 gildea Exp $
  
  /*****************************************************************************
!  *	            Defaults for Site-specfic parameters                     *
   *****************************************************************************/
+ /*****************************************************************************
+  *                        Do not change anything below                       *
+  *****************************************************************************/
+ 
  
  /*
!  * If you want to change any of these, do it in the BeforeVendorCF part
!  * of site.def
   */
  
! #include <xf86_vers.def>
  
! #define WantServerLocks		YES
! #define PartialNetDefault	YES
! 
! /* Defaults for SVR3, SVR4 */
! 
! #if defined(i386SVR3Architecture) || defined(i386SVR4Architecture)
! # ifndef HasGcc
! #  ifdef i386Ncr
! #   define HasGcc		NO
! #  else
! #   define HasGcc		YES
! #  endif
! # endif
! # ifndef HasGcc2
! #  ifdef i386Ncr
! #   define HasGcc2		NO
! #  else
! #   define HasGcc2		YES
! #  endif
! # endif
! # ifndef GccUsesGas
! #  define GccUsesGas		NO
! # endif
! # ifndef UseGas
! #  define UseGas		NO
! # endif
! # ifndef GnuCpp
! #  define GnuCpp		NO
! # endif
! # ifndef HasShadowPasswd
! #  define HasShadowPasswd	YES
! # endif
! # ifndef HasLibCrypt
! #  define HasLibCrypt		NO
! # endif
! # ifndef SCOLocalConnSysv4
! #  if defined(i386SVR4Architecture)
! #   define SCOLocalConnSysv4	YES
! #  else
! #   define SCOLocalConnSysv4	NO
! #  endif
! # endif
! #ifndef HasSVR3mmapDrv
! # define HasSVR3mmapDrv		NO
! #endif
! #if HasSVR3mmapDrv
! # define SVR3mmapFlags		-DHAS_SVR3_MMAPDRV
! #else
! # define SVR3mmapFlags 		/**/
! #endif
! /* Note: this flag has no effect for SVR4 */
! #ifndef FormattedManPages
! # if defined(i386SVR3Architecture)
! #  define FormattedManPages	YES
! # else
! #  define FormattedManPages	NO
! # endif
! #endif
! #ifndef FileManSuffix
! #define FileManSuffix	4
! #endif
! #ifndef FileManDir
! #define FileManDir	$(MANSOURCEPATH)4
! #endif
! #endif
! 
! /* Defaults for BSD-like systems */
! 
! #if defined(i386BsdArchitecture) || defined(i386MachArchitecture)
! 
! # ifndef HasGcc
! #  define HasGcc		YES
! # endif
! # ifndef HasGcc2
! #  if defined(i386NetBsd) || defined(i386FreeBsd)
! #   define HasGcc2		YES
! #  else
! #   define HasGcc2		NO
! #  endif
! # endif
! # ifndef GccUsesGas
! #  define GccUsesGas		YES
! # endif
! # ifndef UseGas
! #  define UseGas		YES
! # endif
! # ifndef GnuCpp
! #  if defined(i386BsdArchitecture)
! #   define GnuCpp		YES
! #  else
! #   define GnuCpp		NO
! #  endif
! # endif
! # ifndef HasShadowPasswd
! #  define HasShadowPasswd	NO
! # endif
! # ifndef HasLibCrypt
! #  if defined(i386NetBsd) || defined(i386FreeBsd)
! #   define HasLibCrypt		YES
! #  else
! #   define HasLibCrypt		NO
! #  endif
! # endif
! # ifndef SCOLocalConnSysv4
! #  define SCOLocalConnSysv4	NO
! # endif
! # ifndef FormattedManPages
! #  if defined(i386FreeBsd)
! #   define FormattedManPages	NO
! #  else
! #   define FormattedManPages	YES
! #  endif
! # endif
! #endif
! 
! /* Defaults for Linux and OSF/1 */
! 
! #if defined(LinuxArchitecture) || defined(OsfArchitecture)
! 
! # ifndef HasGcc
! #  define HasGcc		YES
! # endif
! # ifndef HasGcc2
! #  define HasGcc2		YES	/* for GCC 2.0 or later */
! # endif
! # ifndef GccUsesGas
! #  define GccUsesGas		YES
! # endif
! # ifndef UseGas
! #  define UseGas		YES
! # endif
! # ifndef GnuCpp
! #  define GnuCpp		YES
! # endif
! # ifndef PreProcessCmd
! #  define PreProcessCmd		/lib/cpp
! # endif
! # ifndef HasShadowPasswd
! #  define HasShadowPasswd	NO
! # endif
! # ifndef HasLibCrypt
! #  define HasLibCrypt		NO
! # endif
! # ifndef SCOLocalConnSysv4
! #  define SCOLocalConnSysv4	NO
! # endif
! #endif
! 
! /* Defaults which are the same for all systems */
! 
! #ifndef X386LinkKit
! # define X386LinkKit		NO
! #endif
! #ifndef HasSockets
! # define HasSockets		YES
! #endif
! #ifndef ProjectRoot
! # define ProjectRoot		/usr/X386
! #endif
! #ifndef StripInstalledPrograms
! # define StripInstalledPrograms	YES
! #endif
! #ifndef BuildXTest
! # define BuildXTest		YES
! #endif
! #if BuildXTest
! # define XTestDefines		-DXTEST
! #else
! # define XTestDefines		/**/
! #endif
! #ifndef ExtensionOSDefines
! # define ExtensionOSDefines	-DXTESTEXT1 XTestDefines
! #endif
! #ifndef MotifBC
! # define MotifBC	       	YES
! #endif
! #ifndef Target_486
! # define Target_486		YES
! #endif
! #ifndef Target_Pentium
! # define Target_Pentium		NO
! #endif
! #ifndef CompressAllFonts
! # define CompressAllFonts	YES
! #endif
! #ifndef Build75Dpi
! # define Build75Dpi		YES
! #endif
! #ifndef Build100Dpi
! # define Build100Dpi		NO
! #endif
! #ifndef BuildLargeMiscFonts
! # define BuildLargeMiscFonts	NO
! #endif
! #ifndef BuildSpeedo
! # define BuildSpeedo		YES
! #endif
! #ifndef BuildPex
! # define BuildPex		NO
! #endif
! #ifndef BuildFontServer
! # define BuildFontServer	NO
! #endif
! #ifndef DebuggableServer
! # define DebuggableServer	NO
! #endif
! #ifndef SpecialMalloc
! # define SpecialMalloc		NO
! #endif
! #ifndef GnuMalloc
! # define GnuMalloc		NO
! #endif
! #ifndef LinkKitFlags
! # if X386LinkKit
! #  define LinkKitFlags		-DLINKKIT
! # else
! #  define LinkKitFlags		/**/
! # endif
! #endif
! 
! /* Some of these man page defaults are overriden in the above OS sections */
! #ifndef AmoebaConf
! # ifndef ManSuffix
! #  define ManSuffix	1x
! # endif
! # ifndef ManDir
! #  define ManDir	$(MANSOURCEPATH)1
! # endif
! # ifndef LibManSuffix
! #  define LibManSuffix	3x
! # endif
! # ifndef LibmanDir
! #  define LibmanDir	$(MANSOURCEPATH)3
! # endif
! # ifndef FileManSuffix
! #  define FileManSuffix	5x
! # endif
! # ifndef FileManDir
! #  define FileManDir	$(MANSOURCEPATH)5
! # endif
! #endif
! 
! #ifndef XF86SVGAServer
! # define XF86SVGAServer		YES
! #endif
! 
! #ifndef XF86MonoServer
! # define XF86MonoServer		NO
! #endif
! 
! #ifndef XF86VGA16Server
! # define XF86VGA16Server	NO
! #endif
! 
! #ifndef XF86S3Server
! # define XF86S3Server		NO
! #endif
! 
! #ifndef XF86I8514Server
! # define XF86I8514Server	NO
! #endif
! 
! #ifndef XF86Mach8Server
! # define XF86Mach8Server	NO
! #endif
! 
! #ifndef XF86Mach32Server
! # define XF86Mach32Server	NO
! #endif
! 
! #if XF86S3Server
! # define XF86S3Dir		s3
! #else
! # define XF86S3Dir		/**/
! #endif
! 
! #if XF86I8514Server
! # define XF86I8514Dir		ibm8514
! #else
! # define XF86I8514Dir		/**/
! #endif
! 
! #if XF86Mach8Server
! # define XF86Mach8Dir		mach8
! #else
! # define XF86Mach8Dir		/**/
! #endif
! 
! #if XF86Mach32Server
! # define XF86Mach32Dir		mach32
! #else
! # define XF86Mach32Dir		/**/
! #endif
! 
! #undef XF86AccelServerDirs
! #define XF86AccelServerDirs   XF86S3Dir XF86I8514Dir XF86Mach8Dir XF86Mach32Dir
! 
! #undef XF86AccelServer
! #if XF86S3Server || XF86I8514Server || XF86Mach8Server || XF86Mach32Server
! # define XF86AccelServer	YES
! #else
! # define XF86AccelServer	NO
! #endif
! 
! #ifndef XFree86DefaultServer
! # if XF86SVGAServer
! #  define XFree86DefaultServer XF86_SVGA
! # else
! #  if XF86MonoServer
! #   define XFree86DefaultServer XF86_Mono
! #  endif
! # endif
! #endif
! 
! #ifndef BuildServer
! # if !XF86SVGAServer && !XF86VGA16Server && !XF86MonoServer && !XF86AccelServer
! #  define BuildServer		NO
! # endif
! #endif
! 
! #ifndef X386Vga256Drivers
! # define X386Vga256Drivers	et4000 et3000 pvga1 gvga ati tvga8900 cirrus \
! 				ncr compaq oak
! #endif
! 
! #ifndef X386Vga16Drivers
! # define X386Vga16Drivers	et4000 tvga8900 generic
! #endif
! 
! #ifndef X386Vga2Drivers
! # define X386Vga2Drivers	et4000 et3000 pvga1 gvga tvga8900 ncr \
! 				compaq oak generic
! #endif
! 
! #ifndef X386Hga2Drivers
! # define X386Hga2Drivers	/**/
! #endif
! 
! #ifndef X386Bdm2Drivers
! # define X386Bdm2Drivers	/**/
! #endif
! 
! #ifndef XF86S3Drivers
! # define XF86S3Drivers		mmio_928 s3_generic
! #endif
! 
! #ifndef DirtyStartup
! # define DirtyStartup		NO
! #endif
! 
! #ifndef BankedMonoVga
! # define BankedMonoVga		YES
! #endif
! 
! #if BankedMonoVga
! #define MonoDefines		-DX386MONOVGA -DBANKEDMONOVGA
! #else
! #define MonoDefines		-DX386MONOVGA
! #endif
! 
! #ifndef ScoOsMouse
! # define ScoOsMouse		YES
! #endif
  
  /* You must manually compute BootstrapCFlags for initial build */
! 
! #if defined(i386SVR3Architecture) || defined(i386SVR4Architecture) || defined(i386FreeBsd)
! # define BootstrapCFlags	OSDefines OSRelease
! #else
! # define BootstrapCFlags	/* nothing */
! #endif
  
+ #ifndef StandardDefines
  #define StandardDefines		OSDefines OSRelease
! #endif
! 
! #if !defined(i386BsdArchitecture)
! # ifndef LdCombineFlags
! #  define LdCombineFlags		-r
! # endif
! #endif
! 
! #if Target_Pentium
! # if defined (i386SVR4Solarisx86)
! #    define ProworksMOption -xpentium
! # endif
! #endif
! 
! #if Target_486
! # if defined (i386SVR4Solarisx86)
! #    define ProworksMOption -x486
! # endif
! # define Gcc2MOption -m486
! #else
! # if defined (i386SVR4Solarisx86)
! #    define ProworksMOption -x386
! # endif
! # define Gcc2MOption -m386
! #endif
! 
! #if GccUsesGas
! # define GccGasOption -DGCCUSESGAS
! #else
! # define GccGasOption /**/
! #endif
! 
! #ifndef AsmDefines
! # if UseGas
! #  define AsmDefines -DUSE_GAS
! # else
! #  define AsmDefines /**/
! # endif
! #endif
! 
! #if GnuCpp
! # define StandardCppDefines -traditional StandardDefines
! #else
! # if defined (i386SVR4Solarisx86)
! #   define StandardCppDefines -P StandardDefines
! # else
! #   define StandardCppDefines StandardDefines
! # endif
! #endif
! 
! #if HasGcc2 && !HasGcc
! # undef HasGcc
! # define HasGcc			YES
! #endif
! 
! #if HasGcc
! # ifndef UseGccMakeDepend
! #  define UseGccMakeDepend	YES
! # endif
! #endif
! 
! #if SpecialMalloc
! # define MallocFlags		-DCAHILL_MALLOC -I/usr/local/debug_include
! #else
! # define MallocFlags		/**/
! #endif
! 
! #if GnuMalloc
! # ifndef GnuMallocLib
! #  if defined(i386BsdArchitecture)
! #   define GnuMallocLib		-lgnumalloc
! #  else
! #   define GnuMallocLib		-lgmalloc
! #  endif
! # endif
! #else
! # undef GnuMallocLib
! # define GnuMallocLib		/**/
! #endif
! 
! #if DebuggableServer
! # if HasGcc
! #  define ServerCDebugFlags DebuggableCDebugFlags OptimizedCDebugFlags 
! # else
! #  define ServerCDebugFlags DebuggableCDebugFlags 
! # endif
! #endif
! 
! #ifndef AssembleObject
! #define AssembleObject(flags) $(RM) $@                                  @@\
! 	$(CPP) AsmDefines $(INCLUDES) flags $*.s > $*.i                 @@\
! 	$(AS) -o $*.o $*.i                                              @@\
! 	$(RM) $*.i
! #endif
! 
! #define NormalAsmObjectRule()                                           @@\
! .s.o:                                                                   @@\
! 	AssembleObject($(_NOOP_))
! 
! #define ObjectFromSpecialAsmSource(dst,src,flags)                       @@\
! dst.s:  src.s                                                           @@\
! 	$(RM) $@                                                        @@\
! 	$(LN) $? $@                                                     @@\
!                                                                         @@\
! dst.o:  dst.s                                                           @@\
! 	AssembleObject(flags)                                           @@\
!                                                                         @@\
! depend:: dst.s                                                          @@\
!                                                                         @@\
! clean::                                                                 @@\
! 	$(RM) dst.s
! 
! 
! /*
!  * Rules for building config files from scripts
!  */
! 
! #ifndef Depend
! # define Depend depend
! #endif
!  
! #define ConfigTargetLong(target,dep,script,args,extra)                  @@\
! all:: Configure                                                         @@\
!                                                                         @@\
! Configure:: target.o                                                    @@\
!                                                                         @@\
! target.c: script dep                                                    @@\
! 	$(MAKE) $(MFLAGS) Makefile                                      @@\
! 	$(MAKE) $(MFLAGS) extra Concat(Build,target)                    @@\
!                                                                         @@\
! Concat(Build,target):                                                   @@\
! 	$(RM) target.c                                                  @@\
! 	$(SHELL) script args                                            @@\
!                                                                         @@\
! clean::                                                                 @@\
! 	$(RM) target.c
! 
! #define ConfigTarget(target,dep,script,args) ConfigTargetLong(target,dep,script,args,Depend)
! 
! #define ConfigTargetNoDepend(target,dep,script,args) ConfigTargetLong(target,dep,script,args,)
! 
! 
! /*
!  * Rules for installing LinkKit parts (target is install.linkkit)
!  */
! 
! #define InstallLinkKitNonExecFile(file,dest)				@@\
! install.linkkit:: file							@@\
! 	MakeDir($(DESTDIR)dest)						@@\
! 	$(INSTALL) -c $(INSTDATFLAGS) file $(DESTDIR)dest
! 
! #define InstallLinkKitLibrary(libname,dest)				@@\
! install.linkkit:: Concat(lib,libname.a)					@@\
! 	MakeDir($(DESTDIR)dest)						@@\
! 	$(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.a) $(DESTDIR)dest @@\
! 	RanLibrary($(RANLIBINSTFLAGS) Concat($(DESTDIR)dest/lib,libname.a))
! 
! #define InstallLinkKitNamedNonExec(srcname,dstname,dest)		@@\
! install.linkkit:: srcname						@@\
! 	MakeDir($(DESTDIR)dest)						@@\
! 	$(INSTALL) -c $(INSTDATFLAGS) srcname $(DESTDIR)dest/dstname
! 
! #define InstallLinkKitNamedProg(srcname,dstname,dest)			@@\
! install.linkkit:: srcname						@@\
! 	MakeDir($(DESTDIR)dest)						@@\
! 	$(INSTALL) -c $(INSTBINFLAGS) srcname $(DESTDIR)dest/dstname
! 
! #define InstallLinkKitSubdirs(dirs) \
! NamedTargetSubdirs(install.linkkit,dirs,"installing link kit",DESTDIR='$(DESTDIR)',install.linkkit)
! 
! #ifndef LinkKitDir
! # define LinkKitDir		$(USRLIBDIR)/Server
! #endif
! 
  
  #if defined(i386SVR3Architecture)
  
***************
*** 36,69 ****
  /*
   * V/386 Release 3.2
   */
! #ifdef ISC
! /* INTERACTIVE UNIX Version 2.2.1 */
! # define OSVendor		"Interactive System Corp."
! # define OSDefines		-DISC
! # define LocalLibraries		-lpt
! # define PosixLibraries		-lcposix
  # define SocketLibraries        -linet
  #endif
  
! #ifdef ESIX
! #define OSVendor		"ESIX System Inc."
  #define OSDefines		-DESIX
! #define LocalLibraries		-lpt
  #define SocketLibraries		-lnet -lnsl_s
  #define PosixLibraries		/**/
  #endif
  
! #ifdef SCO
! #define OSDefines		-DSCO -DBROKEN_FTOL -DNO_PROTOTYPE -D_SVID
! #define OSVendor		"Santa Cruz Operation Ltd."
! #define LocalLibraries		-lpt
! #define SocketLibraries		-lsocket 
  #define PosixLibraries		/**/
  #endif
  
! #ifdef ATT
  #define OSDefines		-DATT
! #define OSVendor		"AT&T"
  #define LocalLibraries		-lpt
  #define SocketLibraries		-lnet -lnsl_s    /* just a guess */
  #define PosixLibraries		/**/
--- 574,667 ----
  /*
   * V/386 Release 3.2
   */
! #ifdef i386Isc
! /* INTERACTIVE UNIX Version 2.0.2, 2.2.1, 3.0 and 4.0 */
! # if IscVersion == 400
! #  define ISCVerDef -DISC40 -DISC30
! #  define OSVendor		(ISC Version 4.0)
! # else
! #  if IscVersion == 300
! #   define ISCVerDef -DISC30
! #   define OSVendor		(ISC Version 3.0)
! #  else
! #   if IscVersion == 202
! #    define OSVendor		(ISC Version 2.0.2)
! #    define ISCVerDef -DISC202
! #   else
! #    define OSVendor		(ISC Version 2.2.1)
! #    define ISCVerDef -DISC22
! #   endif
! #  endif
! # endif
! # define OSDefines		-DISC ISCVerDef
! # if IscVersion > 202
! #  define LocalLibraries	-lpt
! #  define PosixLibraries	-lcposix
! # else
! #  define LocalLibraries        -lmalloc -lpt
! #  define PosixLibraries
! # endif
  # define SocketLibraries        -linet
  #endif
  
! #ifdef i386Esix
! #define OSVendor		(ESIX Version 3.2D)
  #define OSDefines		-DESIX
! #define LocalLibraries		-lpt -lbsd
  #define SocketLibraries		-lnet -lnsl_s
  #define PosixLibraries		/**/
  #endif
  
! #ifdef i386Sco
! #if ScoVersion == 324
! /*
!  * if your gcc is compiled with STDC_VALUE=0 then change the 1 to 0
!  */
! # define GCC_STDC_VALUE		1
! # if !GCC_STDC_VALUE
! #  define OSDefines		-DSCO -DSCO324 -DBROKEN_FTOL -D_NO_PROTOTYPE \
! 					-D_SVID -D__STDC__=1
! #  undef StandardCppDefines
! #  define StandardCppDefines	-DUNIXCPP=1 StandardDefines
! # else
! #  define OSDefines		-DSCO -DSCO324 -DBROKEN_FTOL -D_NO_PROTOTYPE \
! 					-D_SVID
! # endif
! # define OSVendor		(SCO Version 3.2.4)
! #else /* ScoVersion == 324 */
! # define OSDefines		-DSCO -DBROKEN_FTOL -DNO_PROTOTYPE -D_SVID
! # define OSVendor		(SCO Version 3.2.2)
! #endif /* ScoVersion == 324 */
! /*
!  *	XBSDLIB is included with the Socket libraries, because SCO
!  *	needs Xbsd as its bcopy routine doesn't handle overlapping
!  *	regions. If HasSockets is false the XINETLIB does it for
!  *	us anyway.
!  */
! #if !X386LinkKit
! # define SocketLibraries	$(XBSDLIB) -lsocket 
! #else
! # define SocketLibraries	-lsocket 
! #endif
  #define PosixLibraries		/**/
+ #define ManSourcePath		$(MANPATH)/cat.
+ 
+ #if ScoOsMouse
+ # define	ScoExtraServerDefines	-DUSE_OSMOUSE
+ # define	LocalLibraries		-lmalloc -lpt -levent
+ #else
+ # define	LocalLibraries		-lmalloc -lpt
+ #endif /* ScoOsMouse */
+ 
+ #endif /* i386Sco */
+ 
+ #ifndef ScoExtraServerDefines
+ # define	ScoExtraServerDefines	/**/
  #endif
  
! #ifdef i386Att
  #define OSDefines		-DATT
! #define OSVendor		(AT&T)
  #define LocalLibraries		-lpt
  #define SocketLibraries		-lnet -lnsl_s    /* just a guess */
  #define PosixLibraries		/**/
***************
*** 75,158 ****
  #define OSRelease		-DSYSV -DSYSV386
  
  #if HasGcc
! # define CcCmd gcc -DNO_ASM -fstrength-reduce -fpcc-struct-return -fwritable-strings
! # define LibraryCcCmd gcc -DNO_ASM -fstrength-reduce -fpcc-struct-return
! # define ShlibDefines -D__GNUC__ -DGNULIB=/usr/local/lib/gcc-gnulib
  #else
! # define ShlibDefines /**/
  #endif
  
  #if HasSockets
! /* # define ConnectionFlags -DLOCALCONN -DTCPCONN */
! # define ConnectionFlags -DTCPCONN
! # define ExtraLibraries SocketLibraries LocalLibraries -lc_s PosixLibraries
  #else
! # define ConnectionFlags -DLOCALCONN
! # define ExtraLibraries $(LIBDIR)/etc/inetemul.o LocalLibraries -lc_s PosixLibraries
  #endif
  
! /* #include <sv3Lib.rules> */  /* not working yet */
  
  /*
   * Man pages need to be formatted when installed, so override the default
   * imake rules.
   */
! #define InstallManPageLong(file,destdir,dest)                           @@\
  install.man:: file.man                                                  @@\
! 	$(RM) destdir/dest.ManSuffix					@@\
! 	cat file.man | neqn | nroff -man >/tmp/file.man  		@@\
! 	$(INSTALL) -c $(INSTMANFLAGS) /tmp/file.man destdir/dest.ManSuffix @@\
! 	$(RM) /tmp/file.man
  
  #define InstallMultipleMan(list,dest)                                   @@\
  install.man:: list                                                      @@\
! 	@case '${MFLAGS}' in *[i]*) set +e;; esac; \                    @@\
! 	for i in list; do \                                             @@\
! 		(set -x; \						@@\
! 		$(RM) dest/$$i; \					@@\
! 		cat $$i | neqn | nroff -man >/tmp/$$i; \  		@@\
! 		$(INSTALL) -c $(INSTMANFLAGS) /tmp/$$i dest/$$i; \	@@\
! 		$(RM) /tmp/$$i); \					@@\
! 	done
  
  /* If you have trouble with make bombing out in Xlib, try uncommenting this. */
  /* You will not get dependencies as a result, but better than nothing. */
! /* #define DependTarget3(srcs1,srcs2,srcs3) */
  
  #endif /* i386SVR3Architecture */
  
  
  /*
!  * V/386 Release 4.0
   */
  #if defined(i386SVR4Architecture)
  
! #define SystemV4		YES
  
! /* this is now just for Dell's one */
  
! #ifdef DELL
! #define OSDefines		-DDELL
! #define OSVendor		"DELL Computer Corp."
  #endif
  
! #define OSName			Unix System V/386 Release 4.0
  #define OSMajorVersion		4
  #define OSMinorVersion		0
  #define OSRelease		-DSVR4 -DSYSV386
  
  #if HasGcc
! # define CcCmd 		gcc -ansi -fstrength-reduce -fpcc-struct-return -Di386
! # if HasSharedLibraries
! #  define LibraryCcCmd	cc -Xc -Di386 -Dasm=__asm
  # endif
  #else
! # define CcCmd		cc -Xc -Di386 -Dasm=__asm
  #endif
  
  #include <sv4Lib.rules>
  
  #endif /* i386SVR4Architecture */
  
  
  XCOMM operating system:  OSName OSVendor
--- 673,1322 ----
  #define OSRelease		-DSYSV -DSYSV386
  
  #if HasGcc
! # define CcCmd gcc
! # if HasGcc2
! #  define DefaultCCOptions Gcc2MOption -DNO_ASM -fpcc-struct-return \
! 			   -fwritable-strings
! #  define LibraryCCOptions Gcc2MOption -DNO_ASM -fpcc-struct-return
! #  define OptimizedCDebugFlags -O2
! # else
! #  define DefaultCCOptions -DNO_ASM -fpcc-struct-return -fwritable-strings
! #  define LibraryCCOptions -DNO_ASM -fpcc-struct-return
! #  define OptimizedCDebugFlags -O -fstrength-reduce
! # endif
! # define ShlibDefines -D__GNUC__ $(XDMAUTHDEFS)
  #else
! # define ShlibDefines $(XDMAUTHDEFS)
  #endif
  
+ # define Malloc0ReturnsNull	YES
+ 
  #if HasSockets
! # define ConnectionFlags -DCLIENTS_LOCALCONN -DSERVER_LOCALCONN -DTCPCONN
! # define ExtraLibraries SocketLibraries LocalLibraries GnuMallocLib \
! 			-lc_s PosixLibraries
! # define ServerExtraDefines	GccGasOption -DXDMCP MallocFlags LinkKitFlags \
! 			-DAVOID_GLYPHBLT ScoExtraServerDefines SVR3mmapFlags
  #else
! # define NeedInetEmulLib	YES
! # define ConnectionFlags -DCLIENTS_LOCALCONN -DSERVER_LOCALCONN
! # define ExtraLibraries $(XINETLIB) LocalLibraries GnuMallocLib \
! 			-lc_s PosixLibraries
! /* This turns off XDMCP in the server if no sockets */
! # define ServerExtraDefines	GccGasOption MallocFlags LinkKitFlags \
! 			-DAVOID_GLYPHBLT ScoExtraServerDefines SVR3mmapFlags
  #endif
  
! #include <sv3Lib.rules>
  
  /*
   * Man pages need to be formatted when installed, so override the default
   * imake rules.
   */
! 
! /* The .DS and .DE macros used in some manual pages are obsolete
!  * in the often used ISC's Textprocessing Workbench 2.1.0 and break it,
!  * so it's better to remove these previously
!  */
! #ifndef RemoveDSDENroffMacros
! #if defined(i386Isc) && IscVersion != 202
! #define RemoveDSDENroffMacros   YES
! #else
! #define RemoveDSDENroffMacros   NO
! #endif
! #endif
! 
! /*
!  * Compress manual pages, default on ISC and SCO
!  */
! #ifndef CompressManPages
! #if defined(i386Isc) || defined(i386Sco)
! #define CompressManPages        YES
! #else
! #define CompressManPages        NO
! #endif
! #endif
! 
! #if RemoveDSDENroffMacros
! # define RemoveDSDENroffMacrosCmd sed -e '/^\.D[S|E]$$/d' 
! #else
! # define RemoveDSDENroffMacrosCmd cat
! #endif
! 
! #ifndef CompressManCmd
! # if CompressManPages
! #  if defined(i386Sco) && (ScoVersion < 324)
! #   define CompressManCmd pack
! #  else
! #   define CompressManCmd $(COMPRESS) -v
! #  endif
! # else
! #  define CompressManCmd @true
! # endif
! #endif
! 
!      RMDSDEMACCMD = RemoveDSDENroffMacrosCmd
!    COMPRESSMANCMD = CompressManCmd
! 
! #if FormattedManPages
! 
! #define InstallGenManPageLong(file,destdir,dest,suffix)                 @@\
  install.man:: file.man                                                  @@\
!         MakeDir($(DESTDIR)destdir)                                      @@\
!         $(RM) $(DESTDIR)destdir/dest.suffix*                            @@\
!         $(RMDSDEMACCMD) file.man | $(NEQN) | $(NROFF) -man >/tmp/file.man  @@\
!         $(INSTALL) -c $(INSTMANFLAGS) /tmp/file.man $(DESTDIR)destdir/dest.suffix @@\
!         -$(COMPRESSMANCMD) $(DESTDIR)destdir/dest.suffix                @@\
!         $(RM) /tmp/file.man
! 
! #define InstallManPageLong(file,destdir,dest)				@@\
! 	InstallGenManPageLong(file,destdir,dest,$(MANSUFFIX))
! 
  
  #define InstallMultipleMan(list,dest)                                   @@\
  install.man:: list                                                      @@\
! 	MakeDir($(DESTDIR)dest)						@@\
!         @case '${MFLAGS}' in *[i]*) set +e;; esac; \                    @@\
!         for i in list; do \                                             @@\
!                 (set -x; \                                              @@\
!                 MNAME=`echo $$i | cut -f1 -d.`; \			@@\
!                 $(RM) $(DESTDIR)dest/$${MNAME}*; \                      @@\
!                 $(RMDSDEMACCMD) $$i | $(NEQN) | $(NROFF) -man >/tmp/$$i; \ @@\
!                 $(INSTALL) -c $(INSTMANFLAGS) /tmp/$$i $(DESTDIR)dest/$${MNAME}.$(MANSUFFIX); \      @@\
!                 $(COMPRESSMANCMD) $(DESTDIR)dest/$${MNAME}.$(MANSUFFIX); \  @@\
!                 $(RM) /tmp/$$i); \                                      @@\
!         done
! 
! /*
!  * InstallManPageAliases - generate rules to install manual page aliases.
!  * (Make hard links on SVR3.)
!  */
! 
! #ifdef i386Sco
! /*
!  * due to the extra '.' chars in the file name
!  */
! 
! #define InstallManPageAliases(file,destdir,aliases)                     @@\
! install.man::                                                           @@\
!         @(SUFFIX=`echo $(DESTDIR)destdir/file.* | cut -f3,4 -d.`; \     @@\
!         for i in aliases; do (set -x; \                                 @@\
!         $(RM) $(DESTDIR)destdir/$$i.*; \                                @@\
!         $(LN) $(DESTDIR)destdir/file.$${SUFFIX} \                       @@\
!         $(DESTDIR)destdir/$$i.$${SUFFIX}); \                            @@\
!         done)
! 
! #else
! 
! #define InstallManPageAliases(file,destdir,aliases)                     @@\
! install.man::                                                           @@\
!         @(SUFFIX=`echo $(DESTDIR)destdir/file.* | cut -f2,3 -d.`; \     @@\
!         for i in aliases; do (set -x; \                                 @@\
!         $(RM) $(DESTDIR)destdir/$$i.*; \                                @@\
!         $(LN) $(DESTDIR)destdir/file.$${SUFFIX} \                       @@\
!         $(DESTDIR)destdir/$$i.$${SUFFIX}); \                            @@\
!         done)
! 
! #endif
! 
! #define InstallGenManPageAliases(file,destdir,suffix,aliases)           @@\
!         InstallManPageAliases(file,destdir,aliases)
! 
! #endif
  
  /* If you have trouble with make bombing out in Xlib, try uncommenting this. */
  /* You will not get dependencies as a result, but better than nothing. */
! #ifndef MakeHashTableBug
! #define MakeHashTableBug        NO
! #endif
! #if MakeHashTableBug
! #define DependTarget3(srcs1,srcs2,srcs3)
! #endif
  
  #endif /* i386SVR3Architecture */
  
  
  /*
!  * System V Release 4.0 (SVR4)
   */
  #if defined(i386SVR4Architecture)
+ #if defined(i386SVR4Solarisx86)
+ /*
+  * SUN Microsystems -- Solaris 2.1 x86 FCS (SVR4)
+  */
+ #define SystemV4                YES
+ #define OSName                  Solaris 2.1 x86 FCS (System V Release 4.0)
+ #define OSMajorVersion          4
+ #define OSMinorVersion          0
+ #define OSRelease               -DSVR4 -DSYSV386
+ #define OSDefines               -DSOLX86
+ #define OSVendor                SUN Microsystems
  
! #ifndef HasSharedLibraries
! # define HasSharedLibraries     YES
! #endif
! 
! #ifndef HasSolx86apertureDrv
! # define HasSolx86apertureDrv	NO
! #endif
! #if HasSolx86apertureDrv
! # define SOLX86apertureFlags	-DHAS_SOLX86_APERTUREDRV
! #else
! # define SOLX86apertureFlags	/**/
! #endif
! 
! #define CppCmd                  /usr/ccs/lib/cpp
! #define PreProcessCmd           /usr/ccs/lib/cpp
! 
! #if HasGcc
! # define CcCmd                  gcc
! # define AnsiCCOptions          /* -ansi */
! # if HasGcc2
! #  define DefaultCCOptions      Gcc2MOption -fpcc-struct-return -Di386
! #  define OptimizedCDebugFlags  -O2
! #  define MakeLdRunPath(dir)  	Concat3(-Xlinker -R,dir,$${LD_RUN_PATH+\:$$LD_RUN_PATH})
! #  define MakeLdLinkPath(dir) 	Concat3(-R,dir,$${LD_RUN_PATH+\:$$LD_RUN_PATH})
! # else
! #  define DefaultCCOptions      -fpcc-struct-return -fstrength-reduce -Di386
! #  define MakeLdRunPath(dir)  	Concat3(-R,dir,$${LD_RUN_PATH+\:$$LD_RUN_PATH})
! #  define MakeLdLinkPath(dir) 	Concat3(-R,dir,$${LD_RUN_PATH+\:$$LD_RUN_PATH})
! #  if HasSharedLibraries
! #   define LibraryCcCmd         gcc
! #   define LibraryAnsiCCOptions /* -ansi */
! #   define LibraryCCOptions     -O2 -Di386 -Dasm=__asm
! #  endif
! # endif
! #else						/* Use ProWorks compiler */
! # define NeedConstPrototoypes   YES
! # define NeedFunctionPrototypes YES
! # define NeedNestedPrototypes   YES
! # define NeedVarargsPrototypes  YES
! # define NeedWidePrototypes     NO
! # if !defined (ProWorksHome)
! #  undef ProWorksHome
! #  define ProWorksHome          /opt/SUNWspro
! # endif
! # if defined((ProworksMOption) /* XXX: ProWorks 2.0:broken -x486, -xpentium..*/
! #  undef ProworksMOption
! #  define ProworksMOption	/**/
! # endif
! # define CcCmd                  ProWorksHome/bin/cc
! # define AnsiCCOptions          /* */
! # define DefaultCCOptions       -Xc ProworksMOption -DPROWORKS -DINCLUDE_ALLOCA_H -Di386 -Dasm=__asm
! # define ServerCcCmd			ProWorksHome/bin/cc 
! # define ServerCCOptions		-Xa ProworksMOption -DPROWORKS -DINCLUDE_ALLOCA_H -Di386 -Dasm=__asm
! # define AllocateLocalDefines   -DINCLUDE_ALLOCA_H
! # define MakeLdRunPath(dir)   	Concat3(-R,dir,$${LD_RUN_PATH+\:$$LD_RUN_PATH})
! # define MakeLdLinkPath(dir)  	Concat3(-R,dir,$${LD_RUN_PATH+\:$$LD_RUN_PATH})
! # if HasSharedLibraries
! #  define LibraryCcCmd          ProWorksHome/bin/cc 
! #  define LibraryAnsiCCOptions  /* */
! #  define LibraryCCOptions      -Xc ProworksMOption -DPROWORKS -DINCLUDE_ALLOCA_H -Di386 -Dasm=__asm
! #  define SharedAllocateLocalDefines -DINCLUDE_ALLOCA_H
! # endif
! #endif
! 
! /* Make sure we don't use /usr/ucb/ld */
! #ifndef LdCmd
! # define LdCmd                  /usr/ccs/bin/ld
! #endif
! 
! #define ServerExtraDefines      GccGasOption -DXDMCP MallocFlags LinkKitFlags \
!                                 -DAVOID_GLYPHBLT SOLX86apertureFlags
! 
! #if SCOLocalConnSysv4
! # define Acp                    -DSVR4_ACP
! #else
! # define Acp                    /**/
! #endif
  
! #define ConnectionFlags         -DUNIXCONN -DTCPCONN -DCLIENTS_LOCALCONN \
!                                 -DSERVER_LOCALCONN Acp
  
! #define NeedBerklib             YES
! 
! #if defined(UseInstalled) && !X386LinkKit
! # define ExtraLibraries         -lsocket -lnsl GnuMallocLib $(XBSDLIB)
! #else
! # define ExtraLibraries         -lsocket -lnsl GnuMallocLib
  #endif
  
! #include <sv4Lib.rules>
! 
! #else
! /*
!  * USL-based V/386 System V Release 4.0 
!  */
! #define SystemV4		YES
! 
! /* No vendor defines required for SVR4 */
! 
! #define OSName			Unix System V/386 Release 4.x
  #define OSMajorVersion		4
  #define OSMinorVersion		0
  #define OSRelease		-DSVR4 -DSYSV386
+ #define OSDefines		/**/
+ #ifdef i386Ncr
+ # define OSVendor		(NCR)
+ #else
+ # define OSVendor		/**/
+ #endif
  
+ #ifndef HasSharedLibraries
+ #define HasSharedLibraries	YES
+ #endif
+ 
  #if HasGcc
! # define CcCmd			gcc
! # define AnsiCCOptions		-ansi
! # if HasGcc2
! #  define DefaultCCOptions	Gcc2MOption -fpcc-struct-return -Di386 
! #  define OptimizedCDebugFlags	-O2
! # else
! #  define DefaultCCOptions	-fpcc-struct-return -fstrength-reduce -Di386
! #  if HasSharedLibraries
! #   define LibraryCcCmd		/bin/cc
! #   define LibraryAnsiCCOptions	-Xc
! #   define LibraryCCOptions	-Di386 -Dasm=__asm
! #  endif
  # endif
  #else
! # define CcCmd			/bin/cc
! # ifdef i386Ncr
! #  define AnsiCCOptions		-Xa
! #  define DefaultCCOptions	-Di386 -Hnocopyr -DNO_SECONDARY
! # else
! #  define AnsiCCOptions		-Xc
! #  define DefaultCCOptions	-Di386 -Dasm=__asm
! # endif
! #endif
! 
! /* Make sure we don't use /usr/ucb/ld */
! #ifndef LdCmd
! #define LdCmd			/bin/ld
! #endif
! 
! #define ServerExtraDefines	GccGasOption -DXDMCP MallocFlags LinkKitFlags \
! 				-DAVOID_GLYPHBLT
! 
! #if SCOLocalConnSysv4
! # define Acp			-DSVR4_ACP
! #else
! # define Acp			/**/
! #endif
! 
! #define ConnectionFlags	    -DUNIXCONN -DTCPCONN -DCLIENTS_LOCALCONN \
! 			    -DSERVER_LOCALCONN Acp 
! #define NeedBerklib	    YES
! 
! #if defined(UseInstalled) && !X386LinkKit
! # define ExtraLibraries		-lsocket -lnsl GnuMallocLib $(XBSDLIB)
! #else
! # define ExtraLibraries		-lsocket -lnsl GnuMallocLib
  #endif
  
  #include <sv4Lib.rules>
  
+ #endif /* i386SVR4Solarisx86 */
  #endif /* i386SVR4Architecture */
  
+ #if defined(i386BsdArchitecture)
+ 
+ /*
+  * 386BSD, NetBSD, FreeBSD and BSD/386
+  */
+ 
+ #define i386Bsd			YES
+ 
+ #ifdef i386Bsdi
+ # define OSName			BSD/386
+ #else
+ # ifdef i386NetBsd
+ #  define OSName		NetBSD
+ # else
+ #  ifdef i386FreeBsd
+ #   define OSName		FreeBSD
+ #  else
+ #   define OSName		386BSD
+ #  endif
+ # endif
+ #endif
+ #define OSMajorVersion		4
+ #define OSMinorVersion		3
+ #define OSRelease		/* nothing */
+ /* Not sure if this is needed */
+ #ifdef i386FreeBsd
+ # define OSDefines		-D__FreeBSD__
+ #else
+ # define OSDefines		/* nothing */
+ #endif
+ #define OSVendor		/* nothing */
+ 
+ /* NetBSD 0.9 and later */
+ #if defined(i386NetBsd) && (__NetBSD__version__ >= 1993070)
+ # define LexLib			-ll
+ #endif
+ 
+ #ifdef i386Bsdi
+ # define CppCmd			/usr/bin/cpp
+ #else
+ # define CppCmd			/usr/libexec/cpp
+ #endif
+ 
+ #ifndef BuildBsdSharedLibs
+ # if defined(i386FreeBsd)
+ #  define BuildBsdSharedLibs	YES
+ # else
+ #  define BuildBsdSharedLibs	NO
+ # endif
+ #endif
+ 
+ #if defined(i386NetBsd) || defined(i386FreeBsd)
+ # if BuildBsdSharedLibs
+ #  include <bsdLib.rules>
+ # endif
+ #endif
+ 
+ #if HasGcc
+ # define AnsiCCOptions		/**/
+ # if HasGcc2
+ #  define CcCmd			gcc
+ #  define DefaultCCOptions	Gcc2MOption
+ #  define OptimizedCDebugFlags	-O2
+ #  define LibraryCCOptions	Gcc2MOption
+ # else
+ #  define CcCmd			cc
+ #  define DefaultCCOptions	/**/
+ #  define OptimizedCDebugFlags	-O -fstrength-reduce
+ #  define LibraryCCOptions	/**/
+ # endif
+ #endif
+ 
+ # define ServerExtraDefines	GccGasOption -DXDMCP MallocFlags LinkKitFlags \
+ 				-DAVOID_GLYPHBLT
+ 
+ #define ExtraLibraries		GnuMallocLib
+ 
+ #define HasVoidSignalReturn	YES
+ #define AvoidNullMakeCommand	YES
+ #define HasPutenv		YES
+ #define UnalignedReferencesAllowed	YES
+ #ifndef InstKmemFlags
+ # define InstKmemFlags		-m 2755 -g kmem
+ #endif
+ #define AdmDir			/var/log
+ 
+ #if defined(i386FreeBsd)
+ # ifndef HasShm
+ #  define HasShm		YES
+ # endif
+ #endif
+ 
+ #if OSMajorVersion >= 4 && OSMinorVersion >= 3
+ # define SetTtyGroup		YES
+ #endif
+ 
+ /* These are used by xdm and can be overriden in the xdm config file */
+ 
+ #define DefaultSystemPath	/sbin:/usr/sbin:/bin:/usr/bin:$(BINDIR)
+ #define DefaultUserPath		:/bin:/usr/bin:/usr/local/bin:$(BINDIR)
+ 
+ #ifdef i386Bsdi
+ # define NeqnCmd		eqn
+ #endif
+ 
+ #if FormattedManPages
+ /*
+  * Rules to install pre-formatted man pages.
+  */
+ 
+ #define ManSourcePath		$(MANPATH)/cat
+ 
+ #define InstallManPageLong(file,destdir,dest)                                @@\
+ install.man:: file.man                                                       @@\
+ 	MakeDir($(DESTDIR)destdir)                                           @@\
+ 	$(RM) $(DESTDIR)destdir/dest.0                                       @@\
+ 	cat file.man | $(NEQN) | $(TBL) | $(NROFF) -man >/tmp/file.man       @@\
+ 	$(INSTALL) -c $(INSTMANFLAGS) /tmp/file.man $(DESTDIR)destdir/dest.0 @@\
+ 	$(RM) /tmp/file.man
+ 
+ #define InstallGenManPageLong(file,destdir,dest,suffix)			@@\
+ 	InstallManPageLong(file,destdir,dest)
+ 
+ #define InstallManPageAliases(file,destdir,aliases)                     @@\
+ install.man::                                                           @@\
+ 	@for i in aliases; do (cd $(DESTDIR)destdir; set -x; \          @@\
+         $(RM) $$i.0; \                                                  @@\
+ 	$(LN) file.0 $$i.0); \                                          @@\
+ 	done
+ #endif
+ 
+ #define InstallGenManPageAliases(file,destdir,suffix,aliases)		@@\
+ 	InstallManPageAliases(file,destdir,aliases)
+ 
+ #endif /* FormattedManPages */
+ 
+ 
+ #if defined(i386MachArchitecture)
+ 
+ /*
+  * Mach i386
+  */
+ 
+ #define i386Mach		YES
+ 
+ #define OSName			Mach i386
+ #define OSMajorVersion		2
+ #define OSMinorVersion		6
+ #define OSRelease		/* nothing */
+ #define OSDefines		-DMACH386 -DNOSTDHDRS -DX_NOT_STDC_ENV \
+ 				-DNOT_POSIX
+ #define OSVendor		(CMU)
+ 
+ #if HasGcc
+ # define CcCmd			gcc
+ # define AnsiCCOptions		-traditional
+ # if HasGcc2
+ #  define DefaultCCOptions	Gcc2MOption -fwritable-strings 
+ #  define OptimizedCDebugFlags	-O2
+ #  define LibraryCCOptions	Gcc2MOption
+ # else
+ #  define DefaultCCOptions	-fwritable-strings
+ #  define OptimizedCDebugFlags	-O -fstrength-reduce
+ #  define LibraryCCOptions	/* nothing */
+ # endif
+ #endif
+ 
+ #define ServerExtraDefines	GccGasOption -DXDMCP MallocFlags LinkKitFlags \
+ 				-DAVOID_GLYPHBLT
+ 
+ #define ExtraLibraries		GnuMallocLib
+ 
+ #define SetTtyGroup		YES
+ #define HasBsearch		NO
+ #define HasVoidSignalReturn	NO
+ #define DirFailPrefix		-
+ #define AvoidNullMakeCommand	YES
+ 
+ #endif /* i386MachArchitecture */
+ 
+ /*
+  * linux
+  */
+ #if defined(LinuxArchitecture)
+ 
+ #define OSName			Linux
+ #define OSVendor		/**/
+ #define OSMajorVersion		99
+ #define OSMinorVersion		15h
+ #define OSRelease		-Dlinux
+ #define OSDefines		-D_POSIX_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE
+ 
+ #define SystemV			NO
+ #define AvoidNullMakeCommand	YES
+ 
+ #if StripInstalledPrograms
+ #define InstUidFlags -s -m 4755
+ #else
+ #define InstUidFlags -m 4755
+ #endif
+ #define ConnectionFlags		-DUNIXCONN -DTCPCONN
+ #define DefaultFontPath		$(FONTDIR)/misc/
+ #define YaccCmd			bison -y
+ #define LexCmd			flex
+ 
+ #if HasGcc
+ # define CcCmd			gcc
+ # define CppCmd			/lib/cpp
+ # define PreProcessCmd		/lib/cpp
+ # define LdCombineFlags		-r
+ # define DefaultCCOptions	Gcc2MOption -DNO_ASM -fwritable-strings
+ # define LibraryCCOptions	Gcc2MOption -DNO_ASM -fwritable-strings
+ # define OptimizedCDebugFlags	-O2
+ # define ServerExtraDefines	GccGasOption -DXDMCP MallocFlags LinkKitFlags \
+ 				-DAVOID_GLYPHBLT
+ # define Malloc0ReturnsNull	YES
+ # define NeedConstPrototoypes	YES
+ # define NeedFunctionPrototypes	YES
+ # define NeedNestedPrototypes	YES
+ # define NeedVarargsPrototypes	YES
+ # define NeedWidePrototypes	NO
+ #endif /* HasGcc */
+ 
+ #define ExtraLibraries		GnuMallocLib
+ 
+ #define HasPutenv		YES
+ #ifndef HasShm
+ # define HasShm			YES
+ #endif
+ 
+ #include <lnuxLib.rules>
+ 
+ #endif /* LinuxArchitecture */
+ 
+ /*
+  * OSF/1
+  */
+ #if defined(OsfArchitecture)
+ 
+ #define OSName			OSF/1
+ #define OSVendor		(Open Software Foundation)
+ #define OSMajorVersion		1
+ #define OSMinorVersion		1
+ #define OSRelease		/* __osf__ defined by cpp */
+ #define OSDefines		/* see /usr/include/standards.h */
+ 
+ #define InstallCmd		installbsd
+ #define	InstBinFlags		-m 755 -o bin -g bin
+ #define	InstDatFlags		-m 644 -o bin -g bin
+ #define	InstIncFlags		-m 644 -o bin -g bin
+ #define	InstKmemFlags		-m 4755 -o root -g bin
+ #define	InstLibFlags		-m 644 -o bin -g bin
+ #define	InstManFlags		-m 644 -o bin -g bin
+ #define	InstPgmFlags		-m 755 -o bin -g bin
+ #define	InstUidFlags		-m 4755 -g bin
+ #define ConnectionFlags		-DUNIXCONN -DTCPCONN
+ #define DefaultFontPath		$(FONTDIR)/misc/
+ 
+ #if HasGcc
+ #undef PreProcessCmd
+ #define CppCmd			/lib/cpp
+ #define PreProcessCmd		CppCmd
+ #define DefaultCCOptions	Gcc2MOption -pic-lib
+ #define LibraryCCOptions	DefaultCCOptions
+ #define ServerExtraDefines	GccGasOption -DXDMCP MallocFlags LinkKitFlags \
+ 				-DAVOID_GLYPHBLT
+ #define NeedConstPrototoypes	YES
+ #define NeedFunctionPrototypes	YES
+ #define NeedNestedPrototypes	YES
+ #define NeedVarargsPrototypes	YES
+ #define NeedWidePrototypes	YES
+ #define CcCmd			gcc -ansi -fwritable-strings
+ #define OptimizedCDebugFlags	-O2 -fomit-frame-pointer
+ #define ServerCcCmd  		CcCmd
+ #define ServerCCOptions		-Di386=1 DefaultCCOptions
+ #endif /* HasGcc */
+ 
+ #ifndef HasShm
+ # define	HasShm		NO
+ #endif
+ #define HasSharedLibraries	NO /* I haven't debugged this yet */
+ #define HasLargeTmp		YES
+ #define HasPutenv		YES
+ #define HasSockets		YES
+ #define HasVFork		NO
+ #define Malloc0ReturnsNull	YES
+ #define	ExtraLoadFlags		-L/usr/shlib 
+ #define UseCCMakeDepend		NO
+ #define ConstructMFLAGS		NO
+ 
+ #define ExtraLibraries		GnuMallocLib
+ 
+ XCOMM (one of these days I'll finish this) #include <osfLib.rules>
+ #endif /* OsfArchitecture */
+ 
+ #if !defined(UseInstalled) || X386LinkKit
+ #include <X386Conf.tmpl>
+ #endif
  
  XCOMM operating system:  OSName OSVendor
diff -c /dev/null mit/config/x386config.sh:2.3
*** /dev/null	Sat Mar 12 00:36:31 1994
--- mit/config/x386config.sh	Sat Mar 12 00:36:31 1994
***************
*** 0 ****
--- 1,205 ----
+ #!/bin/sh
+ 
+ # $XFree86: mit/config/x386config.sh,v 2.3 1993/09/04 16:19:20 dawes Exp $
+ #
+ # Generate X386Conf.tmpl Imake template
+ #
+ # Usage: x386config.sh MODULETYPE1 module ... MODULETYPE2 module ...
+ #
+ 
+ Iconfig=X386Conf.tmpl
+ 
+ ModuleHeader=
+ ModuleList=
+ BuildVga2=NO
+ BuildHga2=NO
+ BuildBdm2=NO
+ BuildVga16=NO
+ BuildVga256=NO
+ ExtraRenderers=NO
+ 
+ cat > $Iconfig <<EOF
+ XCOMM  --------------------------------------------------------------------
+ XCOMM  X386Conf.tmpl  -- configuration parameters for X386
+ XCOMM  This file is automatically generated -- DO NOT EDIT
+ XCOMM  --------------------------------------------------------------------
+ 
+          X386SRC = \$(SERVERSRC)/ddx/x386
+     VGADRIVERSRC = \$(X386SRC)/vga256/drivers
+   VGA16DRIVERSRC = \$(X386SRC)/vga16/drivers
+    VGA2DRIVERSRC = \$(X386SRC)/vga2/drivers
+    HGA2DRIVERSRC = \$(X386SRC)/hga2/drivers
+    BDM2DRIVERSRC = \$(X386SRC)/bdm2/drivers
+      S3DRIVERSRC = \$(X386SRC)/accel/s3/drivers
+      RENDERERSRC = \$(FONTSRC)/lib/font
+  RENDERERCONFOBJ = \$(RENDERERSRC)/fontfile/rendererConf.o
+ RENDERERCONFSUBDIR = \$(RENDERERSRC)/fontfile
+ EOF
+ 
+ Done=NO
+ while [ $Done = NO ]; do
+     Args="$*"
+     case $1 in
+         ''|VGADRIVER|VGA16DRIVER|VGA2DRIVER|HGA2DRIVER|BDM2DRIVER|S3DRIVER|RENDERER)
+             if [ X"$ObjsHeader" != X ]; then
+ 		if [ X"$ModuleObjs" = X ]; then
+ 		    echo "$ObjsHeader" >> $Iconfig
+ 		else
+ 		    echo "$ObjsHeader \\" >> $Iconfig
+ 		    set - $ModuleObjs
+ 		    while [ $# -gt 1 ]; do
+                         echo "                   $1 \\" >> $Iconfig
+                         shift
+                     done
+                     echo "                   $1" >> $Iconfig
+                     shift
+ 		fi
+ 	    fi
+             if [ X"$SubdirsHeader" != X ]; then
+ 		if [ X"$ModuleSubdirs" = X ]; then
+ 		    echo "$SubdirsHeader" >> $Iconfig
+ 		else
+ 		    echo "$SubdirsHeader \\" >> $Iconfig
+ 		    set - $ModuleSubdirs
+ 		    while [ $# -gt 1 ]; do
+                         echo "                   $1 \\" >> $Iconfig
+                         shift
+                     done
+                     echo "                   $1" >> $Iconfig
+                     shift
+ 		fi
+ 	    fi
+             set - $Args
+             ModuleType=$1
+             ModuleObjs=
+             ModuleSubdirs=
+ 	    case $ModuleType in
+                 VGADRIVER)
+                     ObjsHeader='         VGAOBJS ='
+                     SubdirsHeader='      VGASUBDIRS ='
+                     ;;
+                 VGA16DRIVER)
+                     ObjsHeader='        VGA16OBJS ='
+                     SubdirsHeader='     VGA16SUBDIRS ='
+                     ;;
+                 VGA2DRIVER)
+                     ObjsHeader='        VGA2OBJS ='
+                     SubdirsHeader='     VGA2SUBDIRS ='
+                     ;;
+                 HGA2DRIVER)
+                     ObjsHeader='        HGA2OBJS ='
+                     SubdirsHeader='     HGA2SUBDIRS ='
+                     ;;
+                 BDM2DRIVER)
+                     ObjsHeader='        BDM2OBJS ='
+                     SubdirsHeader='     BDM2SUBDIRS ='
+                     ;;
+ 		S3DRIVER)
+                     ObjsHeader='        S3OBJS ='
+                     SubdirsHeader='     S3SUBDIRS ='
+                     ;;
+                 RENDERER)
+                     ObjsHeader='    RENDERERLIBS ='
+                     SubdirsHeader=' RENDERERSUBDIRS ='
+                     ;;
+ 	    esac
+ 	    ;;
+         *)
+             case $ModuleType in
+                 VGADRIVER)
+                     BuildVga256=YES
+                     ModuleObjs="$ModuleObjs "'$(VGADRIVERSRC)'/$1/$1.o
+                     ModuleSubdirs="$ModuleSubdirs $1"
+                     ;;
+                 VGA16DRIVER)
+                     BuildVga16=YES
+                     ModuleObjs="$ModuleObjs "'$(VGA16DRIVERSRC)'/$1/$1.o
+                     ModuleSubdirs="$ModuleSubdirs $1"
+                     ;;
+                 VGA2DRIVER)
+                     BuildVga2=YES
+                     ModuleObjs="$ModuleObjs "'$(VGA2DRIVERSRC)'/$1/$1.o
+                     ModuleSubdirs="$ModuleSubdirs $1"
+                     ;;
+                 HGA2DRIVER)
+                     BuildHga2=YES
+                     ModuleObjs="$ModuleObjs "'$(HGA2DRIVERSRC)'/$1/$1.o
+                     ModuleSubdirs="$ModuleSubdirs $1"
+                     ;;
+                 BDM2DRIVER)
+                     BuildBdm2=YES
+                     ModuleObjs="$ModuleObjs "'$(BDM2DRIVERSRC)'/$1/$1.o
+                     ModuleSubdirs="$ModuleSubdirs $1"
+                     ;;
+                 S3DRIVER)
+                     ModuleObjs="$ModuleObjs "'$(S3DRIVERSRC)'/$1/$1.o
+                     ModuleSubdirs="$ModuleSubdirs $1"
+                     ;;
+                 RENDERER)
+                     ExtraRenderers=YES
+                     ModuleObjs="$ModuleObjs "'$(RENDERERSRC)'/$1/lib$1.a
+                     ModuleSubdirs="$ModuleSubdirs "$1
+                     ;;
+             esac
+             ;;
+     esac
+     if [ $# -eq 0 ]; then
+         Done=YES
+     else
+         shift
+     fi
+ done
+ 
+ echo >> $Iconfig
+ echo "#define BuildVga2 $BuildVga2" >> $Iconfig
+ echo "#define BuildHga2 $BuildHga2" >> $Iconfig
+ echo "#define BuildBdm2 $BuildBdm2" >> $Iconfig
+ echo "#define BuildVga16 $BuildVga16" >> $Iconfig
+ echo "#define BuildVga256 $BuildVga256" >> $Iconfig
+ echo "#define ExtraRenderers $ExtraRenderers" >> $Iconfig
+ echo >> $Iconfig
+ 
+ cat >> $Iconfig <<EOF
+ #if XF86MonoServer
+ #if BuildVga2
+      VGA2CONFOBJ = \$(X386SRC)/vga2/vga2Conf.o
+   VGA2CONFSUBDIR = \$(X386SRC)/vga2
+        VGA2BUILD = -DBUILD_VGA2
+ #endif
+ #if BuildHga2
+      HGA2CONFOBJ = \$(X386SRC)/hga2/hga2Conf.o
+   HGA2CONFSUBDIR = \$(X386SRC)/hga2
+        HGA2BUILD = -DBUILD_HGA2
+ #endif
+ #if BuildBdm2
+      BDM2CONFOBJ = \$(X386SRC)/bdm2/bdm2Conf.o
+   BDM2CONFSUBDIR = \$(X386SRC)/bdm2
+        BDM2BUILD = -DBUILD_BDM2
+ #endif
+    X386MCONFOBJS = \$(VGA2CONFOBJ) \$(HGA2CONFOBJ) \$(BDM2CONFOBJ)
+ X386MCONFSUBDIRS = \$(VGA2CONFSUBDIR) \$(HGA2CONFSUBDIR) \$(BDM2CONFSUBDIR)
+ #endif
+ #if XF86VGA16Server
+ #if BuildVga16
+     VGA16CONFOBJ = \$(X386SRC)/vga16/vga16Conf.o
+  VGA16CONFSUBDIR = \$(X386SRC)/vga16
+       VGA16BUILD = -DBUILD_VGA16
+ #endif
+    VGA16CONFOBJS = \$(VGA16CONFOBJ)
+ VGA16CONFSUBDIRS = \$(VGA16CONFSUBDIR)
+ #endif
+ #if XF86SVGAServer
+ #if BuildVga256
+       VGACONFOBJ = \$(X386SRC)/vga256/vga256Conf.o
+    VGACONFSUBDIR = \$(X386SRC)/vga256
+         VGABUILD = -DBUILD_VGA256
+ #endif
+     X386CONFOBJS = \$(VGACONFOBJ)
+  X386CONFSUBDIRS = \$(VGACONFSUBDIR)
+ #endif
+ #if XF86S3Server
+        S3CONFOBJ = \$(X386SRC)/accel/s3/s3Conf.o
+     S3CONFSUBDIR = \$(X386SRC)/accel/s3
+ #endif
+  X386SCREENFLAGS = \$(VGA2BUILD) \$(HGA2BUILD) \$(BDM2BUILD) \$(VGA16BUILD) \$(VGABUILD)
+ EOF
diff -c /dev/null mit/config/x_am_i386.cf:2.0
*** /dev/null	Sat Mar 12 00:36:31 1994
--- mit/config/x_am_i386.cf	Sat Mar 12 00:36:31 1994
***************
*** 0 ****
--- 1,30 ----
+ XCOMM $XFree86: mit/config/x_am_i386.cf,v 2.0 1993/08/12 11:34:01 dawes Exp $
+ 
+ /*
+  * Defines for X11/i80386 Amoeba that are compiler set independent.
+  */
+ 
+ #define WantServerLocks		YES
+ #define BuildSpeedo		YES
+ 
+ #include "amoeba.cf"
+ 
+ #define DefaultFontPath         $(FONTDIR)/misc/,$(FONTDIR)/75dpi/
+ 
+ #include "xf86_vers.def"
+ 
+ #define	XF86SVGAServer		YES
+ #define	XF86MonoServer		YES
+ #define Target_486		NO	/* we have 386s as well */
+ 
+ /*
+  * When building clients, X11R5 uses the default make rules.
+  * However, under SunOs 4.X, make insists on including -target
+  * options even though these are useless for other compilers.
+  * The following assigment fixes this problem, but it pretends
+  * to know a lot about make's mysterious ways.
+  */
+ #if defined(sun)
+ COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) -c
+ LINK.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
+ #endif
diff -c /dev/null mit/config/x_mnx_i386.cf:2.0
*** /dev/null	Sat Mar 12 00:36:32 1994
--- mit/config/x_mnx_i386.cf	Sat Mar 12 00:36:32 1994
***************
*** 0 ****
--- 1,25 ----
+ XCOMM $XFree86: mit/config/x_mnx_i386.cf,v 2.0 1993/08/12 11:34:03 dawes Exp $
+ 
+ /*
+  * Defines for X11/Minix-386 that are compiler set independent.
+  */
+ 
+ #define WantServerLocks		YES
+ #define BuildSpeedo		YES
+ 
+ #include "minix.cf"
+ 
+ #define DefaultFontPath         $(FONTDIR)/misc/,$(FONTDIR)/75dpi/
+ 
+ #include "xf86_vers.def"
+ 
+ #define	XF86SVGAServer		YES
+ #define	XF86MonoServer		YES
+ 
+ #define Target_486		YES	/* will still work for 386's */
+ 
+ #if defined(sun)
+ /* Avoid -target options while cross compiling */
+ COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) -c
+ LINK.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
+ #endif
diff -c /dev/null mit/config/xf86.rules:2.9
*** /dev/null	Sat Mar 12 00:36:32 1994
--- mit/config/xf86.rules	Sat Mar 12 00:36:32 1994
***************
*** 0 ****
--- 1,195 ----
+ XCOMM -------------------------------------------------------------------------
+ XCOMM
+ XCOMM xf86.rules: rules for XF86_ servers
+ XCOMM
+ XCOMM $XFree86: mit/config/xf86.rules,v 2.9 1993/10/02 07:12:07 dawes Exp $
+ 
+ /*
+  * XFree86Server(name,fbdirs,fblibs,specialobjs,drivobjs,drivdirs,
+  *		 confobjs,confdirs)
+  *
+  * XFree86ServerNoDrv(name,fbdirs,fblibs,specialobjs)
+  *
+  * Note: name is the full server name.
+  */
+ 
+ /*
+  * The following are assumed to be setup in the Imakefile
+  *
+  * SUBDIRS0       -- subdirs in common for all XFree86 servers
+  * XF86SYSLIBS    -- OS-dependent libs (that are within the X tree)
+  * XF86COMMONLIB  -- libx386.a
+  * XF86OSLIB      -- libxf86_os.a
+  * XF86HWLIB      -- libxf86_hw.a
+  * XF86COMMONOBJ  -- xf86_Option.o
+  *
+  */
+ 
+ #if !X386LinkKit
+ #define XFree86Server(name,fbdirs,fblibs,specialobjs,drivobjs,drivdirs,confobjs,confdirs)			    @@\
+ Concat(name,SERVERNAME) = name						    @@\
+ Concat(name,FBDIRS) = fbdirs						    @@\
+ Concat(name,SUBDIRS) = $(SUBDIRS0) $(Concat(name,FBDIRS))		    @@\
+ Concat(name,DIRS) = $(Concat(name,SUBDIRS)) $(DEPDIRS)			    @@\
+ Concat(name,CONFOBJ) = Concat3(ddx/x386/common/,name,.o)		    @@\
+ Concat(name,OBJS) =  $(Concat(name,CONFOBJ)) $(XF86COMMONOBJ) \		    @@\
+ 		     specialobjs confobjs drivobjs			    @@\
+ Concat(name,LIBS) = $(XF86COMMONLIB) fblibs \				    @@\
+ 		    $(XF86HWLIB) $(XF86OSLIB) \				    @@\
+ 		    $(XF86SYSLIBS)					    @@\
+         								    @@\
+ xf86all:: $(Concat(name,SERVERNAME))					    @@\
+         								    @@\
+ Concat(reload,$(Concat(name,SERVERNAME))): $(CONFIGSRC)/X386Conf.tmpl	    @@\
+ 	@$(MAKE) $(MFLAGS) Makefile					    @@\
+ 	@$(MAKE) $(MFLAGS) Concat(DoReload,$(Concat(name,SERVERNAME)))	    @@\
+         								    @@\
+ Concat(DoReload,$(Concat(name,SERVERNAME))): $(Concat(name,CONFOBJ)) \	    @@\
+ 		$(XF86COMMONOBJ) confobjs drivobjs $(RENDERERLIBS) \	    @@\
+ 		Concat(load,$(Concat(name,SERVERNAME)))			    @@\
+         								    @@\
+ $(Concat(name,CONFOBJ)): $(ICONFIGFILES)				    @@\
+ 	@(echo Checking in ddx/x386/common...; \			    @@\
+ 	cd ddx/x386/common; set -x; \					    @@\
+ 	$(MAKE) $(MFLAGS) Makefile; \					    @@\
+ 	$(MAKE) $(MFLAGS) Depend; \					    @@\
+ 	$(MAKE) $(MFLAGS))						    @@\
+         								    @@\
+ confobjs:: $(ICONFIGFILES)						    @@\
+ 	@for i in confdirs; do \					    @@\
+ 	(echo Checking in $$i...; cd $$i; set -x; \			    @@\
+ 	$(MAKE) $(MFLAGS) Configure); done				    @@\
+         								    @@\
+ drivobjs: $(ICONFIGFILES)						    @@\
+ 	@for i in drivdirs; do \					    @@\
+ 	(echo Checking in $$i...; cd $$i; set -x; \			    @@\
+ 	$(MAKE) $(MFLAGS) Makefile; \					    @@\
+ 	$(MAKE) $(MFLAGS) Makefiles; \					    @@\
+ 	$(MAKE) $(MFLAGS) Depend; \					    @@\
+ 	$(MAKE) $(MFLAGS)); done 					    @@\
+ 	touch drivobjs							    @@\
+         								    @@\
+ ServerTarget($(Concat(name,SERVERNAME)),$(Concat(name,DIRS)),\		    @@\
+ 	     $(Concat(name,OBJS)),$(Concat(name,LIBS)),$(SYSLIBS))	    @@\
+         								    @@\
+ InstallMultipleFlags($(Concat(name,SERVERNAME)),$(BINDIR),$(INSTPGMFLAGS))  @@\
+         								    @@\
+ clean::									    @@\
+ 	$(RM) $(Concat(name,SERVERNAME))
+ 
+ 
+ #define XFree86ServerNoDrv(name,fbdirs,fblibs,specialobjs)		    @@\
+ Concat(name,SERVERNAME) = name						    @@\
+ Concat(name,FBDIRS) = fbdirs						    @@\
+ Concat(name,SUBDIRS) = $(SUBDIRS0) $(Concat(name,FBDIRS))		    @@\
+ Concat(name,DIRS) = $(Concat(name,SUBDIRS)) $(DEPDIRS)			    @@\
+ Concat(name,CONFOBJ) = Concat3(ddx/x386/common/,name,.o)		    @@\
+ Concat(name,OBJS) = $(Concat(name,CONFOBJ)) specialobjs $(XF86COMMONOBJ)    @@\
+ Concat(name,LIBS) = $(XF86COMMONLIB) fblibs \				    @@\
+ 		    $(XF86HWLIB) $(XF86OSLIB) \				    @@\
+ 		    $(XF86SYSLIBS)					    @@\
+         								    @@\
+ xf86all:: $(Concat(name,SERVERNAME))					    @@\
+         								    @@\
+ Concat(reload,$(Concat(name,SERVERNAME))): $(CONFIGSRC)/X386Conf.tmpl	    @@\
+ 	@$(MAKE) $(MFLAGS) Makefile					    @@\
+ 	@$(MAKE) $(MFLAGS) Concat(DoReload,$(Concat(name,SERVERNAME)))	    @@\
+         								    @@\
+ Concat(DoReload,$(Concat(name,SERVERNAME))): $(Concat(name,CONFOBJ)) \	    @@\
+ 		$(XF86COMMONOBJ) $(RENDERERLIBS) \			    @@\
+ 		Concat(load,$(Concat(name,SERVERNAME)))			    @@\
+         								    @@\
+ $(Concat(name,CONFOBJ)): $(ICONFIGFILES)				    @@\
+ 	@(echo Checking in ddx/x386/common...; \			    @@\
+ 	cd ddx/x386/common; set -x; \					    @@\
+ 	$(MAKE) $(MFLAGS) Makefile; \					    @@\
+ 	$(MAKE) $(MFLAGS) Depend; \					    @@\
+ 	$(MAKE) $(MFLAGS))						    @@\
+         								    @@\
+ ServerTarget($(Concat(name,SERVERNAME)),$(Concat(name,DIRS)),\		    @@\
+ 	     $(Concat(name,OBJS)),$(Concat(name,LIBS)),$(SYSLIBS))	    @@\
+         								    @@\
+ InstallMultipleFlags($(Concat(name,SERVERNAME)),$(BINDIR),$(INSTPGMFLAGS))  @@\
+         								    @@\
+ clean::									    @@\
+ 	$(RM) $(Concat(name,SERVERNAME))
+ 
+ 
+ #else /* LinkKit versions */
+ 
+ 
+ #define XFree86Server(name,fbdirs,fblibs,specialobjs,drivobjs,drivdirs,confobjs,confdirs)			    @@\
+ Concat(name,SERVERNAME) = name						    @@\
+ Concat(name,DIRS) = fbdirs						    @@\
+ Concat(name,CONFOBJ) = Concat(name,.o)					    @@\
+ Concat(name,OBJS) = $(Concat(name,CONFOBJ)) $(XF86COMMONOBJ) specialobjs \  @@\
+ 		    confobjs drivobjs					    @@\
+ Concat(name,LIBS) = $(XF86COMMONLIB) fblibs \				    @@\
+ 		    $(XF86HWLIB) $(XF86OSLIB) \				    @@\
+ 		    $(XF86SYSLIBS)					    @@\
+         								    @@\
+ xf86all:: $(Concat(name,SERVERNAME))					    @@\
+         								    @@\
+ SpecialObjectRule($(Concat(name,CONFOBJ)),$(ICONFIGFILES), \		    @@\
+  		  $(Concat(name,CONFDEFS)))				    @@\
+         								    @@\
+ Concat(reload,$(Concat(name,SERVERNAME))): X386Conf.tmpl		    @@\
+ 	@$(MAKE) $(MFLAGS) Makefile					    @@\
+ 	@$(MAKE) $(MFLAGS) Concat(DoReload,$(Concat(name,SERVERNAME)))	    @@\
+         								    @@\
+ Concat(DoReload,$(Concat(name,SERVERNAME))): $(Concat(name,CONFOBJ)) \	    @@\
+ 		$(XF86COMMONOBJ) confobjs drivobjs $(RENDERERLIBS) \	    @@\
+ 		Concat(load,$(Concat(name,SERVERNAME)))			    @@\
+         								    @@\
+ drivobjs: $(ICONFIGFILES)						    @@\
+ 	@for i in drivdirs; do \					    @@\
+ 	(echo Checking in $$i...; cd $$i; set -x; \			    @@\
+ 	$(MAKE) $(MFLAGS) Makefile; \					    @@\
+ 	$(MAKE) $(MFLAGS) Makefiles; \					    @@\
+ 	$(MAKE) $(MFLAGS) Depend; \					    @@\
+ 	$(MAKE) $(MFLAGS)); done 					    @@\
+ 	touch drivobjs							    @@\
+         								    @@\
+ ServerTarget($(Concat(name,SERVERNAME)),$(Concat(name,DIRS)),\		    @@\
+ 	     $(Concat(name,OBJS)),$(Concat(name,LIBS)),$(SYSLIBS))	    @@\
+         								    @@\
+ InstallMultipleFlags($(Concat(name,SERVERNAME)),$(BINDIR),$(INSTPGMFLAGS))  @@\
+         								    @@\
+ clean::									    @@\
+ 	$(RM) $(Concat(name,SERVERNAME))
+ 
+ 
+ #define XFree86ServerNoDrv(name,fbdirs,fblibs,specialobjs)		    @@\
+ Concat(name,SERVERNAME) = name						    @@\
+ Concat(name,DIRS) = fbdirs						    @@\
+ Concat(name,CONFOBJ) = Concat(name,.o)					    @@\
+ Concat(name,OBJS) = $(Concat(name,CONFOBJ)) $(XF86COMMONOBJ) specialobjs    @@\
+ Concat(name,LIBS) = $(XF86COMMONLIB) fblibs \				    @@\
+ 		    $(XF86HWLIB) $(XF86OSLIB) \				    @@\
+ 		    $(XF86SYSLIBS)					    @@\
+         								    @@\
+ xf86all:: $(Concat(name,SERVERNAME))					    @@\
+         								    @@\
+ SpecialObjectRule($(Concat(name,CONFOBJ)),$(ICONFIGFILES), \		    @@\
+  		  $(Concat(name,CONFDEFS)))				    @@\
+         								    @@\
+ Concat(reload,$(Concat(name,SERVERNAME))): X386Conf.tmpl		    @@\
+ 	@$(MAKE) $(MFLAGS) Makefile					    @@\
+ 	@$(MAKE) $(MFLAGS) Concat(DoReload,$(Concat(name,SERVERNAME)))	    @@\
+         								    @@\
+ Concat(DoReload,$(Concat(name,SERVERNAME))): $(Concat(name,CONFOBJ)) \	    @@\
+ 		$(XF86COMMONOBJ) $(RENDERERLIBS) \			    @@\
+ 		Concat(load,$(Concat(name,SERVERNAME)))			    @@\
+         								    @@\
+ ServerTarget($(Concat(name,SERVERNAME)),$(Concat(name,DIRS)),\		    @@\
+ 	     $(Concat(name,OBJS)),$(Concat(name,LIBS)),$(SYSLIBS))	    @@\
+         								    @@\
+ InstallMultipleFlags($(Concat(name,SERVERNAME)),$(BINDIR),$(INSTPGMFLAGS))  @@\
+         								    @@\
+ clean::									    @@\
+ 	$(RM) $(Concat(name,SERVERNAME))
+ 
+ 
+ #endif /* X386LinkKit */
+ 
+ 
diff -c /dev/null mit/config/xf86_vers.def:2.11
*** /dev/null	Sat Mar 12 00:36:33 1994
--- mit/config/xf86_vers.def	Sat Mar 12 00:36:33 1994
***************
*** 0 ****
--- 1,20 ----
+ XCOMM -------------------------------------------------------------------------
+ XCOMM XFree86 version definition
+ XCOMM $XFree86: mit/config/xf86_vers.def,v 2.11 1994/03/05 01:56:48 dawes Exp $
+ 
+ #ifndef XFree86Version
+ # define XFree86Version 2100
+ #endif
+ 
+ #ifndef XVendorString
+ # define XVendorString "XFree86"
+ #endif
+ 
+ #ifndef XVendorRelease
+ # define XVendorRelease XFree86Version
+ #endif
+ 
+ XCOMM -------------------------------------------------------------------------
+ XCOMM XFree86 version: XFree86Version
+ XCOMM -------------------------------------------------------------------------
+ 
diff -c mit/lib/Imakefile:1.1.1.1 mit/lib/Imakefile:2.0
*** mit/lib/Imakefile:1.1.1.1	Sat Mar 12 00:36:34 1994
--- mit/lib/Imakefile	Sat Mar 12 00:36:34 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/lib/Imakefile,v 2.0 1993/12/17 10:58:18 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.18 91/07/22 22:53:06 rws Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
***************
*** 7,18 ****
  #endif
  
  #if NeedBerklib
! OTHERDIRS = Berk
  #endif
  
! LINTSUBDIRS = Xau X oldX Xt Xmu Xaw Xdmcp
  
  SUBDIRS = $(OTHERDIRS) $(LINTSUBDIRS) nls
  
  MakeSubdirs($(SUBDIRS))
  DependSubdirs($(SUBDIRS))
--- 8,36 ----
  #endif
  
  #if NeedBerklib
! BERKDIR = Berk
  #endif
  
! #if NeedInetEmulLib
! INETDIR = InetEmul
! #endif
! 
! #if Amoeba || Minix
! SDBMDIR = sdbm
! #endif
! 
! OTHERDIRS = $(BERKDIR) $(INETDIR) $(SDBMDIR)
  
+ #if !Amoeba && !Minix
+ XDMCPDIR = Xdmcp
+ #endif
+ LINTSUBDIRS = Xau X oldX Xt Xmu Xaw $(XDMCPDIR)
+ 
+ #if BuildServersOnly
+ SUBDIRS = $(OTHERDIRS) Xau $(XDMCPDIR)
+ #else
  SUBDIRS = $(OTHERDIRS) $(LINTSUBDIRS) nls
+ #endif
  
  MakeSubdirs($(SUBDIRS))
  DependSubdirs($(SUBDIRS))
diff -c /dev/null mit/lib/Berk/BSDselect.c:2.0
*** /dev/null	Sat Mar 12 00:36:35 1994
--- mit/lib/Berk/BSDselect.c	Sat Mar 12 00:36:35 1994
***************
*** 0 ****
--- 1,59 ----
+ #ifdef WANT_BSDSELECT
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/select.h>
+ 
+ 
+ 
+ /*  This is a fix for the difference between BSD's select() and
+  *  some SVR4's select().  SVR4's select() can never return a value larger
+  *  than the total number of file descriptors being checked.  So, if
+  *  you select for read and write on one file descriptor, and both
+  *  are true, SVR4 select() will only return 1.  BSD select in the
+  *  same situation will return 2.
+  *
+  *	Additionally, BSD select() on timing out, will zero the masks,
+  *	while SVR4 does not.  This is fixed here as well.
+  *
+  *	Set your tabstops to 4 characters to have this code nicely formatted.
+  *
+  *	Jerry Whelan, guru@bradley.edu, June 12th, 1993
+  */
+ 
+ /* $XFree86: mit/lib/Berk/BSDselect.c,v 2.0 1993/09/12 07:19:21 dawes Exp $ */
+ 
+ int
+ BSDselect(nfds, readfds, writefds, exceptfds, timeout)
+ int nfds;
+ fd_set *readfds, *writefds, *exceptfds;
+ struct timeval *timeout;
+ {
+ 	int		rval,
+ 			i;
+ 
+ 	rval = select(nfds, readfds, writefds, exceptfds, timeout);
+ 
+ 	switch(rval) {
+ 		case -1:	return(rval);
+ 					break;
+ 
+ 		case 0:		if(readfds != NULL)
+ 						FD_ZERO(readfds);
+ 					if(writefds != NULL)
+ 						FD_ZERO(writefds);
+ 					if(exceptfds != NULL)
+ 						FD_ZERO(exceptfds);
+ 
+ 					return(rval);
+ 					break;
+ 
+ 		default:	for(i=0, rval=0; i < nfds; i++) {
+ 						if((readfds != NULL) && FD_ISSET(i, readfds)) rval++;
+ 						if((writefds != NULL) && FD_ISSET(i, writefds)) rval++;
+ 						if((writefds != NULL) && FD_ISSET(i, exceptfds)) rval++;
+ 					}
+ 					return(rval);
+ 		}
+ /* Should never get here */
+ }
+ #endif /* WANT_BSDSELECT */
diff -c mit/lib/Berk/Berklib.c:1.1.1.1 mit/lib/Berk/Berklib.c:2.0
*** mit/lib/Berk/Berklib.c:1.1.1.1	Sat Mar 12 00:36:35 1994
--- mit/lib/Berk/Berklib.c	Sat Mar 12 00:36:35 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Berk/Berklib.c,v 2.0 1993/07/28 11:55:28 dawes Exp $ */
  /* $XConsortium: Berklib.c,v 1.15 91/09/10 08:50:04 rws Exp $ */
  
  /*
***************
*** 38,49 ****
  #endif
  #endif
  
  /* you should use Xfuncs.h in code instead of relying on Berklib */
  #ifdef WANT_BFUNCS
  
  #include <X11/Xosdefs.h>
  
! #if (__STDC__ && defined(X_NOT_STDC_ENV)) || defined(SVR4) || defined(hpux)
  
  #include <string.h>
  
--- 39,57 ----
  #endif
  #endif
  
+ #ifdef SCO
+ #ifndef SCO324
+ #define WANT_SETITIMER
+ #endif
+ #define WANT_BFUNCS
+ #endif
+ 
  /* you should use Xfuncs.h in code instead of relying on Berklib */
  #ifdef WANT_BFUNCS
  
  #include <X11/Xosdefs.h>
  
! #if !defined(SCO) && ((__STDC__ && defined(X_NOT_STDC_ENV)) || defined(SVR4) || defined(hpux))
  
  #include <string.h>
  
***************
*** 248,251 ****
--- 256,285 ----
      }
  }
  #endif /* WANT_GTOD */
+ 
+ #ifdef WANT_SETITIMER
+ 
+ #include "X11/Xos.h"
+ 
+ int setitimer(which, value, ovalue)
+ 	int which;
+ 	struct itimerval *value;
+ 	struct itimerval *ovalue;
+ {
+ 	int sec, ret;
+ 
+ 	if (!value->it_value.tv_sec && !value->it_value.tv_usec) {
+ 		ret = alarm(0);
+ 	} else {
+ 		sec = value->it_value.tv_sec + (value->it_value.tv_usec / 1000000);
+ 		ret = alarm((sec < 1) ? 1 : sec);
+ 	}
+ 	if (ovalue) {
+ 		ovalue->it_value.tv_sec = ret;
+ 		ovalue->it_value.tv_usec = 0;
+ 	}
+ 	return(0);
+ }
+ 
+ #endif /* WANT_SETITIMER */
  
diff -c mit/lib/Berk/Imakefile:1.1.1.1 mit/lib/Berk/Imakefile:2.2
*** mit/lib/Berk/Imakefile:1.1.1.1	Sat Mar 12 00:36:36 1994
--- mit/lib/Berk/Imakefile	Sat Mar 12 00:36:36 1994
***************
*** 1,8 ****
  XCOMM $XConsortium: Imakefile,v 1.4 91/09/10 08:49:42 rws Exp $
! SRCS = Berklib.c
! OBJS = Berklib.o
  
  NormalLibraryTarget(Xbsd,$(OBJS))
  InstallLibrary(Xbsd,$(USRLIBDIR))
  
  DependTarget()
--- 1,19 ----
+ XCOMM $XFree86: mit/lib/Berk/Imakefile,v 2.2 1993/09/17 16:11:37 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.4 91/09/10 08:49:42 rws Exp $
! SRCS = Berklib.c strcasecmp.c BSDselect.c
! OBJS = Berklib.o strcasecmp.o BSDselect.o
  
+ #if SystemV || SystemV4
+ STRCASEDEF = -DWANT_STRCASEFUNCS
+ #endif
+ #if SystemV4
+ SELECTDEF = -DWANT_BSDSELECT
+ #endif
+ DEFINES = $(STRCASEDEF) $(SELECTDEF)
  NormalLibraryTarget(Xbsd,$(OBJS))
  InstallLibrary(Xbsd,$(USRLIBDIR))
+ #if defined(i386SVR3Architecture)
+ InstallLinkKitNonExecFile(Berklib.o,$(LINKKITDIR)/lib)
+ #endif
  
  DependTarget()
diff -c /dev/null mit/lib/Berk/strcasecmp.c:2.0
*** /dev/null	Sat Mar 12 00:36:36 1994
--- mit/lib/Berk/strcasecmp.c	Sat Mar 12 00:36:36 1994
***************
*** 0 ****
--- 1,130 ----
+ /*
+  * Copyright (c) 1987 Regents of the University of California.
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgement:
+  *	This product includes software developed by the University of
+  *	California, Berkeley and its contributors.
+  * 4. Neither the name of the University nor the names of its contributors
+  *    may be used to endorse or promote products derived from this software
+  *    without specific prior written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /* $XFree86: mit/lib/Berk/strcasecmp.c,v 2.0 1993/09/12 05:15:52 dawes Exp $ */
+ 
+ #ifdef WANT_STRCASEFUNCS
+ 
+ #include <X11/Xos.h>
+ #include <ctype.h>
+ 
+ #ifndef __STDC__
+ # ifdef __GNUC__
+ #  define const __const__
+ # else
+ #  define const /**/
+ # endif
+ #endif
+ 
+ #if !defined(lint)
+ static char sccsid[] = "@(#)strcasecmp.c	5.10 (Berkeley) 1/26/91";
+ #endif /* not lint */
+ 
+ #if 0
+ typedef unsigned char u_char;
+ #endif
+ 
+ /*
+  * This array is designed for mapping upper and lower case letter
+  * together for a case independent comparison.  The mappings are
+  * based upon ascii character sequences.
+  */
+ static const u_char charmap[] = {
+ 	'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
+ 	'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
+ 	'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
+ 	'\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
+ 	'\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
+ 	'\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
+ 	'\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
+ 	'\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
+ 	'\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+ 	'\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+ 	'\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+ 	'\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
+ 	'\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+ 	'\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+ 	'\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+ 	'\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
+ 	'\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
+ 	'\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
+ 	'\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
+ 	'\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
+ 	'\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
+ 	'\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
+ 	'\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
+ 	'\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
+ 	'\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
+ 	'\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
+ 	'\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
+ 	'\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
+ 	'\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
+ 	'\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
+ 	'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
+ 	'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
+ };
+ 
+ int
+ strcasecmp(s1, s2)
+ 	const char *s1, *s2;
+ {
+ 	register const u_char *cm = charmap,
+ 			*us1 = (const u_char *)s1,
+ 			*us2 = (const u_char *)s2;
+ 
+ 	while (cm[*us1] == cm[*us2++])
+ 		if (*us1++ == '\0')
+ 			return (0);
+ 	return (cm[*us1] - cm[*--us2]);
+ }
+ 
+ int
+ strncasecmp(s1, s2, n)
+ 	const char *s1, *s2;
+ 	register size_t n;
+ {
+ 	if (n != 0) {
+ 		register const u_char *cm = charmap,
+ 				*us1 = (const u_char *)s1,
+ 				*us2 = (const u_char *)s2;
+ 
+ 		do {
+ 			if (cm[*us1] != cm[*us2++])
+ 				return (cm[*us1] - cm[*--us2]);
+ 			if (*us1++ == '\0')
+ 				break;
+ 		} while (--n != 0);
+ 	}
+ 	return (0);
+ }
+ #endif /* WANT_STRCASEFUNCS */
diff -c /dev/null mit/lib/InetEmul/Imakefile:1.2
*** /dev/null	Sat Mar 12 00:36:38 1994
--- mit/lib/InetEmul/Imakefile	Sat Mar 12 00:36:38 1994
***************
*** 0 ****
--- 1,8 ----
+ XCOMM $XFree86: mit/lib/InetEmul/Imakefile,v 1.2 1993/03/27 09:15:23 dawes Exp $
+ SRCS = inetemul.c
+ OBJS = inetemul.o
+ 
+ NormalLibraryTarget(Xinetem,$(OBJS))
+ InstallLibrary(Xinetem,$(USRLIBDIR))
+ 
+ DependTarget()
diff -c /dev/null mit/lib/InetEmul/inetemul.c:1.2
*** /dev/null	Sat Mar 12 00:36:39 1994
--- mit/lib/InetEmul/inetemul.c	Sat Mar 12 00:36:39 1994
***************
*** 0 ****
--- 1,278 ----
+ /* $XFree86: mit/lib/InetEmul/inetemul.c,v 1.2 1993/03/27 09:15:25 dawes Exp $ */
+ /*
+  * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+  *
+  * Permission to use, copy, modify, distribute, and sell this software and its
+  * documentation for any purpose is hereby granted without fee, provided that
+  * the above copyright notice appear in all copies and that both that
+  * copyright notice and this permission notice appear in supporting
+  * documentation, and that the name of Thomas Roell not be used in
+  * advertising or publicity pertaining to distribution of the software without
+  * specific, written prior permission.  Thomas Roell makes no representations
+  * about the suitability of this software for any purpose.  It is provided
+  * "as is" without express or implied warranty.
+  *
+  * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+  * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+  * PERFORMANCE OF THIS SOFTWARE.
+  *
+  * Author:  Thomas Roell, roell@informatik.tu-muenchen.de
+  *
+  * /home/x_cvs/mit/server/ddx/x386/etc/inetemul.c,v 1.1.1.1 1992/05/01 13:15:04 root Exp
+  */
+ 
+ 
+ /*
+  * This is a set of dummy-routines to make shared libs that were compiled for
+  * sockets linkable without libinet.a
+  *
+  * They all return with an error-condition !!!
+  */
+ #include <stdio.h> /* NULL */
+ #include <errno.h>
+ 
+ 
+ unsigned long inet_addr(cp)
+      char *cp;
+ {
+   return(-1);
+ }
+ 
+ 
+ void *gethostbyname(name)
+      char *name;
+ {
+   return (NULL);
+ }
+ 
+ int socket(domain, type, protocol)
+      int domain, type, protocol;
+ {
+   /* errno here, since they are only defined for TCP/IP ... */
+   return(-1);
+ }
+ 
+ 
+ 
+ int setsockopt(s, level, optname, optval, optlen)
+      int s, level, optname;
+      char optval;
+      int optlen;
+ {
+   errno = EBADF;
+   return (-1);
+ }     
+ 
+ 
+ 
+ int connect(s, name, namelen)
+      int s;
+      void *name;
+      int namelen;
+ {
+   errno = EBADF;
+   return (-1);
+ }
+ 
+ 
+ int bind(s, name, namelen)
+      int s;
+      void *name;
+      int namelen;
+ {
+   errno = EBADF;
+   return (-1);
+ }
+ 
+ 
+ 
+ int listen(s, backlog)
+      int s, backlog;
+ {
+   errno = EBADF;
+   return (-1);
+ }
+ 
+ 
+ 
+ int accept(s, addr, addrlen)
+      int s;
+      void *addr;
+      int *addrlen;
+ {
+   errno = EBADF;
+   return (-1);
+ }
+ 
+ 
+ 
+ int getpeername(s, name, namelen)
+      int s;
+      void *name;
+      int namelen;
+ {
+   errno = EBADF;
+   return (-1);
+ }
+ 
+ 
+ 
+ int recvfrom(s, buf, len, flags, from, fromlen)
+      int s;
+      char buf;
+      int len, flags;
+      void *from;
+      int fromlen;
+ {
+   errno = EBADF;
+   return (-1);
+ }
+ 
+ 
+ 
+ int sendto(s, msg, len, flags, to, tolen)
+      int s;
+      char msg;
+      int len, flags;
+      void *to;
+      int tolen;
+ {
+   errno = EBADF;
+   return (-1);
+ }
+ 
+ #ifdef ESIX
+ /* This one is taken from lib/X/Xstream.c */
+ 
+ #include <sys/param.h>
+ #ifndef NOFILES_MAX
+ #define NOFILES_MAX 128
+ #endif
+ 
+ #ifndef OPEN_MAX
+ #define OPEN_MAX NOFILES_MAX
+ #endif
+ 
+ #if OPEN_MAX > 256
+ #undef OPEN_MAX
+ #define OPEN_MAX 256
+ #endif
+ 
+ #define MSKCNT ((OPEN_MAX + 31) / 32)
+ 
+ #if (MSKCNT==1)
+ #define BITMASK(i) (1 << (i))
+ #define MASKIDX(i) 0
+ #endif
+ #if (MSKCNT>1)
+ #define BITMASK(i) (1 << ((i) & 31))
+ #define MASKIDX(i) ((i) >> 5)
+ #endif
+ 
+ #define MASKWORD(buf, i) buf[MASKIDX(i)]
+ #define BITSET(buf, i) MASKWORD(buf, i) |= BITMASK(i)
+ #define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i)
+ #define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i))
+ 
+ #ifdef DEBUG
+ #define PRMSG(x,a,b)	fprintf(stderr, x,a,b); fflush(stderr)
+ #else
+ #define PRMSG(x,a,b)
+ #endif
+ 
+ #include <sys/time.h>
+ #include <sys/poll.h>
+ 
+ #define POLLERROR		(POLLHUP | POLLNVAL | POLLERR)
+ #define PFD(fds, i, x) { 	if (fds) 		if (ev & (x)) 			BITSET (fds, i); 		else 			BITCLEAR (fds, i); }
+ #define ERROR(x) { 	errno = x; 	return -1; }
+ /*
+ 	simulate BSD select system call with SYSV poll system call
+ 	note that efds parameter is not fully supported (or understood)
+ */
+ 
+ extern long ulimit();
+ 
+ int
+ select (nfds, rfds, wfds, efds, timeout)
+ int nfds;
+ unsigned long *rfds;
+ unsigned long *wfds;
+ unsigned long *efds;
+ struct timeval *timeout;
+ {
+ 	int i, rc, ev, timevalue;
+ 	struct pollfd pfds[NOFILES_MAX];
+ 	static long _NOFILE = 0;
+ 
+ 	PRMSG("in select\n", 0,0);
+ 
+ 	if (_NOFILE == 0) {
+ 		_NOFILE = ulimit(4, (long)0);
+ 		if (_NOFILE > NOFILES_MAX)
+ 			_NOFILE = NOFILES_MAX;
+ 	}
+ 
+  	if (nfds > _NOFILE)
+ 		nfds = _NOFILE;   /* make poll happy */
+ 
+ 	for (i = 0; i < nfds; i++)
+ 	{
+ 		ev = 0;
+ 
+ 		if (rfds && GETBIT (rfds, i)) ev |= POLLIN;
+ 		if (wfds && GETBIT (wfds, i)) ev |= POLLOUT;
+ 		if (ev || (efds && GETBIT (efds, i)))
+ 			pfds[i].fd = i;
+ 		else
+ 			pfds[i].fd = -1;
+ 		pfds[i].events = ev;
+ 	}
+ 	if (timeout)
+ 		timevalue = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
+ 	else
+ 		timevalue = -1;
+ 
+ 	while (1)	{
+ 	   rc = poll (pfds, (unsigned long)nfds, timevalue);
+ 
+ 	   if(rc<0 && errno == EAGAIN)
+ 		continue;
+ 	   else	break;
+ 	}
+ 	if(rc>0)	{
+ 		if (!efds)
+ 			for (i = 0; i < nfds; ++i)
+ 			{
+ 				ev = pfds[i].revents;
+ 				if (ev & POLLERROR)
+ 					ERROR (EBADF);
+ 			}
+ 
+ 		for (i = 0; i < nfds; ++i)
+ 		{
+ 			ev = pfds[i].revents;
+ 			PFD (rfds, i, POLLIN);
+ 			PFD (wfds, i, POLLOUT);
+ 			PFD (efds, i, POLLERROR);
+ 		}
+ 	} 
+ 
+ 	if(rc==0)	{
+ 		i = (nfds+ 7)/8;
+ 		if ( rfds != NULL)
+ 			memset((char *) rfds, 0, i);
+ 		if ( wfds != NULL)
+ 			memset((char *) wfds, 0, i);
+ 		if ( efds != NULL)
+ 			memset((char *) efds, 0, i);
+ 	
+ 	}
+ 	
+ 	return rc;
+ }
+ #endif /* ESIX */
diff -c mit/lib/X/Imakefile:1.1.1.5 mit/lib/X/Imakefile:2.0
*** mit/lib/X/Imakefile:1.1.1.5	Sat Mar 12 00:37:01 1994
--- mit/lib/X/Imakefile	Sat Mar 12 00:37:01 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/lib/X/Imakefile,v 2.0 1993/07/28 11:56:00 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.129.1.1 93/03/09 13:31:06 rws Exp $
  #define DoNormalLib NormalLibX
  #define DoSharedLib SharedLibX
***************
*** 26,31 ****
--- 27,39 ----
  #ifdef MacIIArchitecture
  XBSDLIB = /**/
  #endif
+ #if NeedBerklib
+ XBSDLIB = /**/
+ #endif
+ #if NeedInetEmulLib
+ XINETLIB = /**/
+ #endif
+ 
  #if Malloc0ReturnsNull
          DEFINES = -DMALLOC_0_RETURNS_NULL
  #endif
***************
*** 1009,1015 ****
--- 1017,1027 ----
  SpecialLibObjectRule(Xstreams.o,$(ICONFIGFILES),$(CONN_DEFINES))
  SpecialLibObjectRule(XlibInt.o,$(ICONFIGFILES),$(CONN_DEFINES))
  SpecialLibObjectRule(XcmsColNm.o,$(ICONFIGFILES),$(CMS_DEFINES))
+ #if !defined(i386SVR3Architecture)
  SpecialLibObjectRule(globals.o,$(ICONFIGFILES),$(CONN_DEFINES))
+ #else
+ SpecialLibObjectRule(globals.o,$(ICONFIGFILES),$(CONN_DEFINES) -D_libX11_import $(XDMAUTHDEFS))
+ #endif
  SpecialLibObjectRule(Context.o,$(ICONFIGFILES),$(BC_DEFINES))
  
  LCRules()
***************
*** 1055,1063 ****
  LinkSourceFile(Wrap.c,$(XDMCPLIBSRC))
  LinkSourceFile(Wraphelp.c,$(XDMCPLIBSRC))
  
  ks_tables.h: $(INCLUDESRC)/keysymdef.h util/makekeys.c
  	$(RM) $@ makekeys
! 	-$(CC) -o makekeys util/makekeys.c $(CFLAGS) $(LOCAL_LDFLAGS) $(LDLIBS)
  	./makekeys < $(INCLUDESRC)/keysymdef.h > ks_tables_h
  	$(MV) ks_tables_h $@
  	$(RM) makekeys ks_tables_h
--- 1067,1082 ----
  LinkSourceFile(Wrap.c,$(XDMCPLIBSRC))
  LinkSourceFile(Wraphelp.c,$(XDMCPLIBSRC))
  
+ #if CrossCompiling
+ HOSTCC = cc
+ #else
+ HOSTCC = $(CC)
+ HOSTFLAGS = $(CFLAGS) $(LOCAL_LDFLAGS) $(LDLIBS)
+ #endif
+ 
  ks_tables.h: $(INCLUDESRC)/keysymdef.h util/makekeys.c
  	$(RM) $@ makekeys
! 	-$(HOSTCC) -o makekeys util/makekeys.c $(HOSTFLAGS)
  	./makekeys < $(INCLUDESRC)/keysymdef.h > ks_tables_h
  	$(MV) ks_tables_h $@
  	$(RM) makekeys ks_tables_h
diff -c /dev/null mit/lib/X/VendorKeysym.h:1.1
*** /dev/null	Sat Mar 12 00:37:02 1994
--- mit/lib/X/VendorKeysym.h	Sat Mar 12 00:37:02 1994
***************
*** 0 ****
--- 1,20 ----
+ #define hpXK_mute_acute		0x100000A8
+ #define hpXK_mute_grave		0x100000A9
+ #define hpXK_mute_asciicircum	0x100000AA
+ #define hpXK_mute_diaeresis	0x100000AB
+ #define hpXK_mute_asciitilde	0x100000AC
+ 
+ #define DXK_ring_accent		0x1000FEB0
+ #define DXK_circumflex_accent	0x1000FE5E
+ #define DXK_cedilla_accent	0x1000FE2C
+ #define DXK_acute_accent	0x1000FE27
+ #define DXK_grave_accent	0x1000FE60
+ #define DXK_tilde		0x1000FE7E
+ #define DXK_diaeresis		0x1000FE22
+ 
+ #define SunXK_FA_Grave		0x1005FF00
+ #define SunXK_FA_Circum		0x1005FF01
+ #define SunXK_FA_Tilde		0x1005FF02
+ #define SunXK_FA_Acute		0x1005FF03
+ #define SunXK_FA_Diaeresis		0x1005FF04
+ #define SunXK_FA_Cedilla		0x1005FF05
diff -c /dev/null mit/lib/X/XAmoeba.h:1.1
*** /dev/null	Sat Mar 12 00:37:02 1994
--- mit/lib/X/XAmoeba.h	Sat Mar 12 00:37:02 1994
***************
*** 0 ****
--- 1,54 ----
+ /*
+  * Xamoeba.h
+  *
+  * $XFree86: mit/lib/X/XAmoeba.h,v 1.1 1993/03/20 03:28:01 dawes Exp $
+  *
+  */
+ #define event __event
+ #define interval __interval
+ 
+ #include <amoeba.h>
+ #include <ampolicy.h>
+ #include <semaphore.h>
+ #include <cmdreg.h>
+ #include <stdcom.h>
+ #include <stderr.h>
+ #include <vc.h>
+ #include <circbuf.h>
+ #include <exception.h>
+ #include <fault.h>
+ #include <signal.h>
+ #include <module/signals.h>
+ #include <server/x11/Xamoeba.h>
+ 
+ #undef interval
+ #undef event
+ 
+ #define	MAX_TCPIP_RETRY	4
+ #define	CIRCBUFSIZE	1024
+ 
+ /*
+  */
+ typedef struct _XAmChanDesc {
+     int			state;		/* current state of connection */
+     int			type;		/* type of connection */
+     signum		signal;		/* signal to kill TCP/IP reader */
+     semaphore		*sema;		/* select semaphore */
+     struct vc		*virtcirc;	/* virtual circuit for Amoeba */
+     struct circbuf	*circbuf;	/* circular buffer for TCP/IP */
+     capability		chancap;	/* TCP/IP channel capability */
+ } XAmChanDesc;
+ 
+ /* Amoeba channel descriptor states */
+ #define	ACDS_FREE	0		/* unused */
+ #define	ACDS_USED	1		/* intermediate state */
+ #define	ACDS_CLOSED	2		/* just closed */
+ 
+ /* Amoeba channel types */
+ #define	ACDT_TCPIP	1		/* TCP/IP connection */
+ #define	ACDT_VIRTCIRC	2		/* Amoeba virtual circuit connection */
+ 
+ extern XAmChanDesc *XAmAllocChanDesc();
+ extern XAmChanDesc *XAmFdToChanDesc();
+ extern int XAmChanDescToFd();
+ extern void XAmFreeChanDesc();
diff -c mit/lib/X/XConnDis.c:1.1.1.3 mit/lib/X/XConnDis.c:2.1
*** mit/lib/X/XConnDis.c:1.1.1.3	Sat Mar 12 00:37:03 1994
--- mit/lib/X/XConnDis.c	Sat Mar 12 00:37:03 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/XConnDis.c,v 2.1 1993/08/04 03:46:14 dawes Exp $
   * $XConsortium: XConnDis.c,v 11.88 91/12/17 17:55:57 rws Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 57,63 ****
--- 58,99 ----
  #ifdef STREAMSCONN
  extern int _XMakeStreamsConnection();
  #endif
+ #ifdef AMOEBA
+ static int MakeAmConnection();
+ #endif
+ #ifdef CLIENTS_LOCALCONN
+ static int MakeLOCALConnection();
+ static int ParseLocalName();
+ static int LocalConnType;
+ 
+ #define TYPE_INVALID	-1	/* Invalid local type */
+ #define TYPE_UNIX	0	/* Unix-domain socket */
+ #define TYPE_USL	1	/* USL streams pipe */
+ #define TYPE_NAMED	2	/* USL named pipe */
+ #define TYPE_ISC	3	/* ISC streams pipe */
+ #define TYPE_SCO	4	/* SCO streams pipe */
+ #define TYPE_ANY	9	/* Any - try XLOCAL or fallback list */
+ 
+ static struct conntype {
+ 	char *pseudo_host;
+ 	char *env_name;
+ 	int conn_type;
+ } LocalConnModes[] = {
+ #ifdef UNIXCONN
+ 	{"unix",  "UNIX",  TYPE_UNIX},
+ #else
+ 	{"unix",  "UNIX",  TYPE_ANY},
+ #endif
+ 	{"usl",   "USL",   TYPE_USL},
+ 	{"named", "NAMED", TYPE_NAMED},
+ 	{"isc",   "ISC",   TYPE_ISC},
+ 	{"sco",	  "SCO",   TYPE_SCO},
+ 	{"",      "",      TYPE_INVALID}
+ };
+ 
+ #endif /* CLIENTS_LOCALCONN */
  
+ 
  static void GetAuthorization();
  
  static char *copystring (src, len)
***************
*** 209,219 ****
  #ifdef STREAMSCONN
        connfunc = _XMakeStreamsConnection;
  #else
        connfunc = NULL;
  #endif
  #endif
  
! #ifdef UNIXCONN
      /*
       * Now that the defaults have been established, see if we have any 
       * special names that we have to override:
--- 245,259 ----
  #ifdef STREAMSCONN
        connfunc = _XMakeStreamsConnection;
  #else
+ #ifdef AMOEBA
+       connfunc = MakeAmConnection;
+ #else
        connfunc = NULL;
  #endif
  #endif
+ #endif
  
! #if defined(UNIXCONN) && !defined(CLIENTS_LOCALCONN)
      /*
       * Now that the defaults have been established, see if we have any 
       * special names that we have to override:
***************
*** 235,248 ****
      else if (strcmp (phostname, "unix") == 0) {
  	connfunc = MakeUNIXSocketConnection;
      }
  #endif
      if (!connfunc)
  	goto bad;
  
! 
! #ifdef UNIXCONN
  #define LOCALCONNECTION (!phostname || connfunc == MakeUNIXSocketConnection)
! #else
  #define LOCALCONNECTION (!phostname)
  #endif
  
--- 275,325 ----
      else if (strcmp (phostname, "unix") == 0) {
  	connfunc = MakeUNIXSocketConnection;
      }
+ #endif /* UNIXCONN && !CLIENTS_LOCALCONN */
+ 
+ #ifdef CLIENTS_LOCALCONN
+     /*
+      *     :N         =>     if CLIENTS_LOCALCONN then streams 
+      *     unix:N     =>     if UNIXCONN then unix-domain-socket
+      *                                   else streams
+      *     <pseudo>:N =>     if CLIENTS_LOCALCONN then specified mode
+      */
+     if (!phostname) {
+ 	connfunc = MakeLOCALConnection;
+ 	LocalConnType = TYPE_ANY;
+     }
+ #if ABI_ALLOWS_PSEUDO_NAMES
+     /*
+      * ABI committee has decided to only use 'unix:N' until other pseudo
+      * hostnames get blessed by the X Consortium.
+      */
+     else if ((LocalConnType = ParseLocalName(phostname)) != TYPE_INVALID) {
+ 	connfunc = MakeLOCALConnection;
+     }
+ #else /* ABI_ALLOWS_PSEUDO_NAMES */
+     else if (strcmp (phostname, "unix") == 0) {
+       connfunc = MakeLOCALConnection;
+ #ifdef UNIXCONN
+       LocalConnType = TYPE_UNIX;
+ #else
+       LocalConnType = TYPE_ANY;
  #endif
+     }
+ #endif /* ABI_ALLOWS_PSEUDO_NAMES */
+ #endif /* CLIENTS_LOCALCONN */
+ 
      if (!connfunc)
  	goto bad;
  
! #if defined(UNIXCONN) && !defined(CLIENTS_LOCALCONN)
  #define LOCALCONNECTION (!phostname || connfunc == MakeUNIXSocketConnection)
! #endif
! 
! #ifdef CLIENTS_LOCALCONN
! #define LOCALCONNECTION (!phostname || connfunc == MakeLOCALConnection)
! #endif
! 
! #ifndef LOCALCONNECTION
  #define LOCALCONNECTION (!phostname)
  #endif
  
***************
*** 286,291 ****
--- 363,383 ----
       * Set close-on-exec so that programs that fork() doesn't get confused.
       */
  
+ #if !defined(AMOEBA) && !defined(_MINIX)
+ #ifdef FIOSNBIO
+     {
+ 	int arg = 1;
+ 	ioctl (fd, FIOSNBIO, &arg);
+     }
+ #else
+ # ifdef FNDELAY
+     (void) fcntl (fd, F_SETFL, FNDELAY);
+ # else
+     (void) fcntl (fd, F_SETFL, O_NDELAY);
+ # endif /* FNDELAY */
+ #endif /* FIOSNBIO */
+ #endif /* !AMOEBA && !_MINIX */
+ 
  #ifdef FD_CLOEXEC
      (void) fcntl (fd, F_SETFD, FD_CLOEXEC);
  #else
***************
*** 337,342 ****
--- 429,435 ----
   *                                                                           *
   *****************************************************************************/
  
+ #ifndef _MINIX
  #ifdef DNETCONN				/* stupid makedepend */
  #define NEED_BSDISH
  #endif
***************
*** 346,351 ****
--- 439,445 ----
  #ifdef TCPCONN
  #define NEED_BSDISH
  #endif
+ #endif /* !_MINIX */
  
  #ifdef NEED_BSDISH			/* makedepend can't handle #if */
  /*
***************
*** 452,458 ****
--- 546,556 ----
      sprintf (unaddr.sun_path, "%s%d", X_UNIX_PATH, idisplay);
  
      addr = (struct sockaddr *) &unaddr;
+ #ifdef SUN_LEN
+     addrlen = SUN_LEN (&unaddr);
+ #else
      addrlen = strlen(unaddr.sun_path) + sizeof(unaddr.sun_family);
+ #endif
  
  #ifdef hpux /* this is disgusting */
      ounaddr.sun_family = AF_UNIX;
***************
*** 512,520 ****
--- 610,625 ----
      char **saddrp;			/* RETURN */
  {
      char hostnamebuf[256];		/* tmp space */
+ #ifndef _MINIX
      unsigned long hostinetaddr;		/* result of inet_addr of arpa addr */
      struct sockaddr_in inaddr;		/* IP socket */
      struct sockaddr *addr;		/* generic socket pointer */
+ #else /* _MINIX */
+     ipaddr_t hostinetaddr;		/* result of inet_addr of arpa addr */
+     tcpport_t x_port;			/* the tcp port of the X server */
+     struct nwio_tcpconf tcpconf;	/* for bind operation */
+     struct nwio_tcpcl tcpcl;		/* options for connect */
+ #endif /* !_MINIX */
      int addrlen;			/* length of addr */
      struct hostent *hp;			/* entry in hosts table */
      char *cp;				/* character pointer iterator */
***************
*** 552,557 ****
--- 657,663 ----
  	    return -1;
  	}
   
+ #ifndef _MINIX
  	/* Set up the socket data. */
  	inaddr.sin_family = hp->h_addrtype;
  #if defined(CRAY) && defined(OLDTCP)
***************
*** 565,571 ****
--- 671,681 ----
  	bcopy ((char *)hp->h_addr, (char *)&inaddr.sin_addr, 
  	       sizeof(inaddr.sin_addr));
  #endif /* CRAY and OLDTCP */
+ #else /* _MINIX */
+ 	bcopy ((char *)hp->h_addr, &hostinetaddr, sizeof(hostinetaddr));
+ #endif /* !_MINIX */
      } else {
+ #ifndef _MINIX
  #if defined(CRAY) && defined(OLDTCP)
  	/* Only Cray UNICOS3 and UNICOS4 will define this */
  	inaddr.sin_addr = hostinetaddr;
***************
*** 573,580 ****
--- 683,692 ----
  	inaddr.sin_addr.s_addr = hostinetaddr;
  #endif /* CRAY and OLDTCP */
  	inaddr.sin_family = AF_INET;
+ #endif /* _MINIX */
      }
  
+ #ifndef _MINIX
      addr = (struct sockaddr *) &inaddr;
      addrlen = sizeof (struct sockaddr_in);
      inaddr.sin_port = X_TCP_PORT + idisplay;
***************
*** 615,621 ****
--- 727,777 ----
  	    break;
  	}
      } while (retries-- > 0);
+ #else /* _MINIX */
+     x_port = htons(X_TCP_PORT + idisplay);
+ 
+     /*
+      * Open the network connection.
+      */
+     do {
+ 	fd= open("/dev/tcp", O_RDWR);
+ 	if (fd == -1)
+ 	    return -1;
+ 
+ 
+ 	tcpconf.nwtc_flags= NWTC_EXCL | NWTC_LP_SEL | NWTC_SET_RA | NWTC_SET_RP;
+ 	tcpconf.nwtc_remaddr= hostinetaddr;
+ 	tcpconf.nwtc_remport= x_port;
+ 
+ 	if (ioctl(fd, NWIOSTCPCONF, &tcpconf) == -1)
+ 	{
+ 	    int olderrno;
+ 
+ 	    olderrno= errno;
+ 	    close(fd);
+ 	    errno= olderrno;
+ 	    return -1;
+ 	}
  
+ 	/*
+ 	 * connect to the socket; if there is no X server or if the backlog has
+ 	 * been reached, then ECONNREFUSED will be returned.
+ 	 */
+ 	tcpcl.nwtcl_flags= 0;
+ 	if (ioctl(fd, NWIOTCPCONN, &tcpcl) == -1)
+ 	{
+ 	    int olderrno = errno;
+ 	    (void) close (fd);
+ 	    if (olderrno != ECONNREFUSED || retries <= 0) {
+ 		errno = olderrno;
+ 		return -1;
+ 	    }
+ 	    sleep (1);
+ 	} else {
+ 	    break;
+ 	}
+     } while (retries-- > 0);
+ #endif /* _MINIX */
  
      /*
       * Success!  So, save the auth information
***************
*** 628,635 ****
--- 784,796 ----
  #endif /* OLDTCP */
      cp = (char *) &inaddr.sin_addr;
  #else /* else not CRAY */
+ #ifndef _MINIX
      len = sizeof(inaddr.sin_addr.s_addr);
      cp = (char *) &inaddr.sin_addr.s_addr;
+ #else  /* _MINIX */
+     len = sizeof(hostinetaddr);
+     cp = (char *) &hostinetaddr;
+ #endif /* !_MINIX */
  #endif /* CRAY */
  
      /*
***************
*** 655,660 ****
--- 816,1265 ----
  #undef INVALID_INETADDR
  #endif /* TCPCONN */
  
+ #ifdef CLIENTS_LOCALCONN
+ 
+ #include <signal.h>
+ #ifdef UNIXCONN
+ # define X_ISC_PATH "/tmp/.ISC-unix/X"
+ #else
+ # define X_ISC_PATH "/tmp/.X11-unix/X"
+ #endif
+ #define X_XSIGHT_PATH "/dev/X"
+ #define X_ATT_PATH "/dev/X/server."
+ #define X_NSTREAMS_PATH "/dev/X/Nserver."
+ 
+ #ifdef SVR4
+ static char Def_Local_Search[] = "UNIX:NAMED:USL:SCO:ISC";
+ #endif /* SVR4 */
+ #ifdef ISC
+ static char Def_Local_Search[] = "ISC:USL:UNIX";
+ #endif /* ISC */
+ #ifdef SCO
+ static char Def_Local_Search[] = "SCO:USL:UNIX";
+ #endif /* SCO */
+ #ifdef ATT
+ static char Def_Local_Search[] = "USL:UNIX";
+ #endif /* ATT */
+ 
+ static int ParseLocalName(name)
+     char *name;
+ {
+     struct conntype *p;
+ 
+     p = LocalConnModes;
+     while (*(p->pseudo_host) != '\0') {
+ 	if ((strcmp(name, p->pseudo_host) == 0) ||
+ 	    (strcmp(name, p->env_name) == 0))
+ 	    return(p->conn_type);
+ 	p++;
+     }
+     return(TYPE_INVALID);
+ }
+ 
+ static void _dummy(temp)
+     int temp;
+ {
+     return;
+ }
+ 
+ static int MakeLOCALConnection (phostname, idisplay, retries,
+ 				familyp, saddrlenp, saddrp)
+     char *phostname;
+     int idisplay;
+     int retries;
+     int *familyp;			/* RETURN */
+     int *saddrlenp;			/* RETURN */
+     char **saddrp;			/* RETURN */
+ {
+     int fds, fd, server, fl, ret;
+     unsigned alarm_time;
+     void (*savef)();
+     char rbuf[64], *slave;
+     char server_path[64];
+     long temp;
+     char *to_try;
+     extern char *getenv();
+     int conn_mode;
+ #if !defined (SVR4) || defined(SVR4_ACP)
+     struct strfdinsert buf;
+     struct strbuf ctlbuf;
+ #endif
+ 
+     /*
+      * Get list of local connection modes to try.
+      */
+     if (LocalConnType == TYPE_ANY) {
+ 	/*
+ 	 * First check XLOCAL environment variable, then use default path.
+ 	 */
+ 	to_try = getenv("XLOCAL");
+ 	if (!to_try) {
+ 	    to_try = Xmalloc(strlen(Def_Local_Search)+1);
+ 	    strcpy(to_try,Def_Local_Search);
+ 	}
+     }
+     else {
+ 	to_try = Xmalloc(strlen(LocalConnModes[LocalConnType].env_name)+1);
+ 	strcpy(to_try,LocalConnModes[LocalConnType].env_name);
+     }
+ 
+     /* 
+      * Now try each of the modes, in the search path.  If the user specifies
+      * a mode that is not supported, it will be silently ignored, and the
+      * connection will fail later on.
+      */
+     to_try = strtok(to_try, ": ");
+     while (to_try) {
+ 	switch (ParseLocalName(to_try)) {
+ 	case TYPE_UNIX:
+ #ifdef UNIXCONN
+     	    fd = MakeUNIXSocketConnection(phostname, idisplay, retries,
+ 				          familyp, saddrlenp, saddrp);
+ 	    if (fd >= 0)
+ 		return(fd);
+ #endif /* UNIXCONN */
+ 	    break;
+ 	case TYPE_USL:
+   	    /*
+    	     * USL's old-style local connection (SVR3&SVR4)
+    	     */
+   	    sprintf(server_path,"%s%d", X_ATT_PATH, idisplay);
+             if ((server = open(server_path, O_RDWR)) >= 0) {
+       		if ((fd = open("/dev/ptmx", O_RDWR)) >= 0) {
+ 		    grantpt(fd);
+         	    unlockpt(fd);
+         	    slave = (char *)ptsname(fd);  /* get name */
+ 
+         	    /*
+          	     * write slave name to server
+          	     */
+ 		    temp = strlen(slave);
+ 		    rbuf[0] = temp;
+ 		    sprintf(&rbuf[1], slave);
+         	    write(server, rbuf, temp+1);
+ 
+         	    /*
+          	     * wait for server to respond
+          	     */
+         	    savef = signal(SIGALRM, _dummy);
+         	    alarm_time = alarm (30);
+         	    ret = read(fd, rbuf, 1);
+ 		    alarm(alarm_time);
+ 		    signal(SIGALRM, savef);
+         	    if (ret == 1) {
+ 			/*
+ 			 * Success!
+ 			 */
+ 	  		(void) close(server);
+ 	  		return(fd);
+ 		    }
+       		}
+       		(void) close(server);
+       		(void) close(fd);
+     	    }
+ 	    break;
+ 	case TYPE_NAMED:
+ #ifdef SVR4
+   	    /*
+    	     * USL's new-style local connection (SVR4)
+    	     */
+   	    sprintf(server_path,"%s%d", X_NSTREAMS_PATH, idisplay);
+   	    if ((fd = open(server_path, O_RDWR)) >= 0) {
+ 		if (isastream(fd) == 1) {
+ 		    /*
+ 		     * Success!
+ 		     */
+ 		    return(fd);
+ 		}
+ 	    }
+ #endif /* SVR4 */
+ 	    break;
+ 	case TYPE_ISC:
+ #if !defined(SVR4) || defined(SVR4_ACP)
+   	    /*
+    	     * ISC's local connection (ISC or SVR4 w/ACP)
+    	     */
+   	    sprintf(server_path,"%s%d", X_ISC_PATH, idisplay);
+   	    if ((server = open(server_path, O_RDWR)) >= 0) {
+                 if ((fds = open("/dev/spx", O_RDWR)) >= 0 &&
+ 	            (fd  = open("/dev/spx", O_RDWR)) >= 0) {
+ 		    /*
+ 	 	     * make a STREAMS-pipe
+ 	 	     */
+ 		    buf.databuf.maxlen = -1;
+ 		    buf.databuf.len = -1;
+ 		    buf.databuf.buf = NULL;
+ 		    buf.ctlbuf.maxlen = sizeof(long);
+ 		    buf.ctlbuf.len = sizeof(long);
+ 		    buf.ctlbuf.buf = (caddr_t)&temp;
+ 		    buf.offset = 0;
+ 		    buf.fildes = fd;
+ 		    buf.flags = 0;
+ 	
+ 		    if (ioctl(fds, I_FDINSERT, &buf) != -1 &&
+ 	    	        ioctl(server, I_SENDFD, fds) != -1) {
+ 			/*
+ 			 * Success!
+ 			 */
+ 	    	        (void) close(fds); 
+ 	    	        (void) close(server);
+ 	    	        return (fd);
+ 	  	    }
+       	        }
+       	        (void) close(server);
+       	        (void) close(fds);
+       	        (void) close(fd);
+     	    }
+ #endif /* !SVR4 || SVR4_ACP */
+ 	    break;
+ 	case TYPE_SCO:
+ #if !defined(SVR4) || defined(SVR4_ACP)
+   	    /*
+    	     * SCO Xsight's local connection (SCO or SVR4 w/ACP)
+    	     */
+   	    sprintf(server_path,"%s%1dR", X_XSIGHT_PATH, idisplay);
+   	    if ((server = open(server_path, O_RDWR)) >= 0) {
+       		if ((fd = open("/dev/spx", O_RDWR)) >= 0) {
+ 		    (void) write(server, (char *) &server, 1);
+ 		    ctlbuf.len = 0;
+ 		    ctlbuf.maxlen = sizeof(long);
+ 		    ctlbuf.buf = (caddr_t)&temp;
+ 		    fl = 0;
+ 		    /*
+ 		     * Wait for server to respond
+ 		     */
+ 		    savef = signal(SIGALRM, _dummy);
+ 		    alarm_time = alarm(10);
+ 		    ret =  getmsg(server, &ctlbuf, 0, &fl);
+ 		    alarm(alarm_time);
+ 		    signal(SIGALRM, savef);
+ 	    
+ 		    if (ret >= 0) {
+ 	  	        /* 
+ 			 * Success!
+ 			 *
+ 			 * The msg we got via getmsg is the result of an 
+ 			 * I_FDINSERT, so if we do a putmsg with whatever 
+ 			 * we recieved, we're doing another I_FDINSERT ...
+ 	   		 */
+ 	  		putmsg(fd, &ctlbuf, 0, 0);
+ 	  		fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NDELAY);
+ 	  	 	(void) close(server);
+ 	  	 	return(fd);
+ 		    }
+ 		    (void) close (server);
+ 		    (void) close (fd);
+       	    	}
+     	    }
+ #endif /* !SVR4 || SVR4_ACP */
+ 	    break;
+ 	default:
+ 	    break;
+ 	}
+ 
+ 	/*
+ 	 * Get the next token...
+ 	 */
+ 	to_try = strtok(NULL, ": ");
+     }
+ 
+     return (-1);
+ }
+ #endif /* CLIENTS_LOCALCONN */
+ 
+ 
+ #ifdef AMOEBA
+ /*
+  * Make an Amoeba TCP/IP or virtual circuit connection
+  */
+ #include <assert.h>
+ #include "XAmoeba.h"
+ #include <server/ip/hton.h>
+ #include <server/ip/types.h>
+ #include <server/ip/gen/in.h>
+ #include <server/ip/gen/tcp.h>
+ #include <server/ip/tcpip.h>
+ #include <server/ip/tcp_io.h>
+ #include <server/ip/gen/tcp_io.h>
+ #include <server/ip/gen/netdb.h>
+ 
+ #define	THREAD_STACK_SIZE (4*1024)
+ 
+ char *getenv();
+ void XAmReaderThread();
+ 
+ static int
+ MakeAmConnection(phostname, idisplay, retries, familyp, saddrlenp, saddrp)
+     char *phostname;
+     int idisplay;
+     int retries;
+     int *familyp;			/* RETURN */
+     int *saddrlenp;			/* RETURN */
+     char **saddrp;			/* RETURN */
+ {
+     capability xservercap;
+     char xserverpath[256];
+     XAmChanDesc *chandesc;
+     errstat err;
+ 
+     /* Amoeba requires a server hostname */
+     if (phostname == NULL || *phostname == '\0') {
+ 	fprintf(stderr, "Xlib: Display name expected\n");
+ 	return -1;
+     }
+ 
+     /* allocate channel descriptor */
+     chandesc = XAmAllocChanDesc();
+     if (chandesc == (XAmChanDesc *)NULL) {
+ 	fprintf(stderr, "Xlib: Out of channel capabilities\n");
+ 	return -1;
+     }
+ 
+     /*
+      * There are two possible way to make a connection on Amoeba. Either
+      * through an Amoeba RPC or a TCP/IP connection. Depending on whether
+      * the X server resides on Amoeba, Amoeba RPC's are used. Otherwise
+      * it uses a TCP/IP connection.
+      */
+     (void)sprintf(xserverpath, "%s/%s:%d", DEF_XSVRDIR, phostname, idisplay);
+     if ((err = name_lookup(xserverpath, &xservercap)) == STD_OK) {
+ 	port vccaps[2];
+ 	bufsize size;
+ 	errstat err;
+ 	header hdr;
+ 
+ 	/* Amoeba virtual circuit connection */
+ 	chandesc->type = ACDT_VIRTCIRC;
+ 
+ 	/* get the two connection ports from the X-server */
+ 	hdr.h_command = AX_CONNECT;
+ 	hdr.h_port = xservercap.cap_port;
+ 	hdr.h_priv = xservercap.cap_priv;
+ 	size = trans(&hdr, NILBUF, 0, &hdr, (char *)vccaps, sizeof(vccaps));
+ 	if (ERR_STATUS(size)) {
+ 	    err = ERR_CONVERT(size);
+ 	} else {
+ 	    err = ERR_CONVERT(hdr.h_status);
+ 	}
+ 	if (err != STD_OK || size != sizeof(vccaps)) {
+ 	    fprintf(stderr, "Xlib: connect to Amoeba X-server failed (%s)\n",
+ 		    err_why(err));
+ 	    XAmFreeChanDesc(chandesc);
+ 	    return -1;
+ 	}
+ 
+ 	/* setup an Amoeba virtual circuit */
+ 	chandesc->virtcirc =
+ 	    vc_create(&vccaps[1], &vccaps[0], MAXBUFSIZE, MAXBUFSIZE);
+ 	if (chandesc->virtcirc == (struct vc *)NULL) {
+ 	    fprintf(stderr, "Xlib: Amoeba virtual circuit create failed\n");
+ 	    XAmFreeChanDesc(chandesc);
+ 	    return -1;
+ 	}
+ 
+ 	/*
+ 	 * Special Amoeba family type. For Amoeba no access control
+ 	 * mechanism exists, when you have the capability you have
+ 	 * the access.
+ 	 */
+ 	*familyp = FamilyAmoeba;
+ 	*saddrlenp = strlen(phostname);
+ 	*saddrp = copystring(phostname, *saddrlenp);
+     } else {
+ 	char tcpname[100];
+ 	capability tcpcap;
+ 	ipaddr_t ipaddr;
+ 	char *tcpsvr;
+ 	nwio_tcpcl_t tcpcl;
+ 	nwio_tcpconf_t tcpconf;
+ 	XAmChanDesc **param;
+ 	int result;
+ 
+ 	/* Amoeba TCP/IP connection */
+ 	chandesc->type = ACDT_TCPIP;
+ 
+ 	/* lookup up TCP/IP server */
+ 	if ((tcpsvr = getenv("TCP_SERVER")) == NULL)
+ 	    tcpsvr = TCP_SVR_NAME;
+ 	if ((err = name_lookup(tcpsvr, &tcpcap)) != STD_OK) {
+ 	    fprintf(stderr, "Xlib: Cannot lookup %s (%s)\n",
+ 		tcpsvr, err_why(err));
+ 	    std_destroy(&chandesc->chancap);
+ 	    XAmFreeChanDesc(chandesc);
+ 	    return -1;
+ 	}
+ 
+ 	/* establish TCP/IP connection */
+ 	if ((err = tcpip_open(&tcpcap, &chandesc->chancap)) != STD_OK) {
+ 	    fprintf(stderr, "Xlib: Cannot open TCP/IP server on %s (%s)\n",
+ 		tcpsvr, tcpip_why(err));
+ 	    std_destroy(&chandesc->chancap);
+ 	    XAmFreeChanDesc(chandesc);
+ 	    return -1;
+ 	}
+ 
+ 	/* lookup TCP/IP hostname */
+ 	if (isdigit(phostname[0])) {
+ 	    ipaddr = inet_addr(phostname);
+ 	} else {
+ 	    struct hostent *hp = gethostbyname(phostname);
+ 	    if (hp == NULL) {
+ 		fprintf(stderr, "Xlib: %s unknown host\n", phostname);
+ 		return -1;
+ 	    }
+ 	    bcopy(hp->h_addr, &ipaddr, hp->h_length);
+ 	}
+ 
+ 	/* set remote address/port on the TCP/IP connection */
+ 	tcpconf.nwtc_flags = NWTC_SET_RA|NWTC_SET_RP|NWTC_LP_SEL;
+ 	tcpconf.nwtc_remaddr = ipaddr;
+ 	tcpconf.nwtc_remport = htons(6000+idisplay);
+ 	if ((err = tcp_ioc_setconf(&chandesc->chancap, &tcpconf)) != STD_OK) {
+ 	    fprintf(stderr, "Xlib: Cannot configure TCP/IP server (%s)\n",
+ 		tcpip_why(err));
+ 	    std_destroy(&chandesc->chancap);
+ 	    XAmFreeChanDesc(chandesc);
+ 	    return -1;
+ 	}
+ 
+ 	/* make the actual TCP/IP connection */
+ 	tcpcl.nwtcl_flags = 0;
+ 	if ((err = tcp_ioc_connect(&chandesc->chancap, &tcpcl)) != STD_OK) {
+ 	    fprintf(stderr, "Xlib: Cannot make TCP/IP connection (%s)\n",
+ 		tcpip_why(err));
+ 	    std_destroy(&chandesc->chancap);
+ 	    XAmFreeChanDesc(chandesc);
+ 	    return -1;
+ 	}
+ 
+ 	/* start TCP/IP reader thread */
+ 	chandesc->signal = sig_uniq();
+ 	chandesc->circbuf = cb_alloc(CIRCBUFSIZE);
+ 	param = Xmalloc(sizeof(XAmChanDesc *));
+ 	*param = chandesc; /* stupid convention */
+ 	result = thread_newthread(XAmReaderThread,
+ 	    THREAD_STACK_SIZE, (char *)param, sizeof(XAmChanDesc *));
+ 	if (result == 0) {
+ 	    fprintf(stderr, "Xlib: Cannot start reader thread\n");
+ 	    std_destroy(&chandesc->chancap);
+ 	    XAmFreeChanDesc(chandesc);
+ 	    return -1;
+ 	}
+ 	threadswitch(); /* give reader a try */
+ 
+ 	/*
+ 	 * Family type is set to Internet so that the .Xauthority
+ 	 * files from Unix will work under Amoeba (for Unix displays).
+ 	 */
+ 	*familyp = FamilyInternet;
+ 	*saddrlenp = sizeof(ipaddr_t);
+ 	*saddrp = Xmalloc(sizeof(ipaddr_t));
+ 	bcopy((char *)&ipaddr, *saddrp, sizeof(ipaddr_t));
+     }
+ 
+     return XAmChanDescToFd(chandesc);
+ }
+ #endif /* AMOEBA */
  
  
  /*****************************************************************************
***************
*** 672,678 ****
--- 1277,1296 ----
      int server;
  
  {
+ #ifdef AMOEBA
+     register XAmChanDesc *chandesc;
+ 
+     chandesc = XAmFdToChanDesc(server);
+     if (chandesc->type == ACDT_TCPIP) {
+       sig_raise(chandesc->signal);
+       std_destroy(&chandesc->chancap);
+     }
+     if (chandesc->type == ACDT_VIRTCIRC)
+       vc_close(chandesc->virtcirc, VC_BOTH);
+     XAmFreeChanDesc(chandesc);
+ #else
      (void) close(server);
+ #endif
      return 0;
  }
  
***************
*** 687,692 ****
--- 1305,1311 ----
  _XWaitForWritable(dpy)
      Display *dpy;
  {
+ #if !defined(AMOEBA) && !defined(_MINIX)
      unsigned long r_mask[MSKCNT];
      unsigned long w_mask[MSKCNT];
      int nfound;
***************
*** 699,706 ****
          BITSET(w_mask, dpy->fd);
  
  	do {
! 	    nfound = select (dpy->fd + 1, r_mask, w_mask,
! 			     (char *)NULL, (char *)NULL);
  	    if (nfound < 0 && errno != EINTR)
  		_XIOError(dpy);
  	} while (nfound <= 0);
--- 1318,1325 ----
          BITSET(w_mask, dpy->fd);
  
  	do {
! 	    nfound = select (dpy->fd + 1, (fd_set *)r_mask, (fd_set *)w_mask,
! 			     (fd_set *)NULL, (struct timeval *)NULL);
  	    if (nfound < 0 && errno != EINTR)
  		_XIOError(dpy);
  	} while (nfound <= 0);
***************
*** 741,746 ****
--- 1360,1370 ----
  	if (_XANYSET(w_mask))
  	    return;
      }
+ #else /* AMOEBA || _MINIX */
+     /* It's a fatal error when this is called under Amoeba or Minix */
+     fprintf(stderr, "Xlib: _XWaitForWritable called\n");
+     abort();
+ #endif /* AMOEBA || _MINIX */
  }
  
  
***************
*** 747,752 ****
--- 1371,1377 ----
  _XWaitForReadable(dpy)
    Display *dpy;
  {
+ #if !defined(AMOEBA) && !defined(_MINIX)
      unsigned long r_mask[MSKCNT];
      int result;
  	
***************
*** 753,762 ****
      CLEARBITS(r_mask);
      do {
  	BITSET(r_mask, dpy->fd);
! 	result = select(dpy->fd + 1, r_mask,
! 			(char *)NULL, (char *)NULL, (char *)NULL);
  	if (result == -1 && errno != EINTR) _XIOError(dpy);
      } while (result <= 0);
  }
  
  
--- 1378,1393 ----
      CLEARBITS(r_mask);
      do {
  	BITSET(r_mask, dpy->fd);
! 	result = select(dpy->fd + 1, (fd_set *)r_mask,
! 			(fd_set *)NULL, (fd_set *)NULL,
! 			(struct timeval *)NULL);
  	if (result == -1 && errno != EINTR) _XIOError(dpy);
      } while (result <= 0);
+ #else /* AMOEBA || _MINIX */
+     /* It's a fatal error when this is called under Amoeba or Minix */
+     fprintf(stderr, "Xlib: _XWaitForReadable called\n");
+     abort();
+ #endif /* AMOEBA || _MINIX */
  }
  
  
***************
*** 797,809 ****
  
  #undef add_to_iov
  
      len -= WritevToServer (dpy->fd, iovarray, niov);
  
      /*
       * Set the connection non-blocking since we use select() to block.
       */
      /* ultrix reads hang on Unix sockets, hpux reads fail */
! #if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(AIXV3))
      (void) fcntl (dpy->fd, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
--- 1428,1445 ----
  
  #undef add_to_iov
  
+ #ifndef _MINIX
      len -= WritevToServer (dpy->fd, iovarray, niov);
+ #else
+     len -= MNX_WritevToServer (dpy, iovarray, niov);
+ #endif
  
+ #if !defined(AMOEBA) && !defined(_MINIX)
      /*
       * Set the connection non-blocking since we use select() to block.
       */
      /* ultrix reads hang on Unix sockets, hpux reads fail */
! #if defined(O_NONBLOCK) && (!defined(SCO) && !defined(ultrix) && !defined(hpux) && !defined(AIXV3))
      (void) fcntl (dpy->fd, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
***************
*** 823,828 ****
--- 1459,1479 ----
  #endif
  #endif
  #endif
+ #else  /* !AMOEBA && !_MINIX */
+ #ifdef _MINIX
+     {
+ 	int flags, r;
+ 
+ 	flags= fcntl(dpy->fd, F_GETFD);
+ 	if (flags == -1)
+ 	    return 0;
+ 	flags |= FD_ASYNCHIO;
+ 	r= fcntl(dpy->fd, F_SETFD, flags);
+ 	if (r == -1)
+ 	    return 0;
+     }
+ #endif /* _MINIX */
+ #endif /* !AMOEBA && !_MINIX */
      return len == 0;
  }
  
***************
*** 1065,1070 ****
--- 1716,1725 ----
  	    int	    addrlen;
  	    struct sockaddr_in	in_addr;
  
+ #if defined(SYSV) && defined(SYSV386) && defined(CLIENTS_LOCALCONN)
+ 	    if(family == FamilyLocal) goto UseLocalID;
+ #endif
+ 
  	    addrlen = sizeof (in_addr);
  	    if (getsockname (fd,
  			     (struct sockaddr *) &in_addr,
***************
*** 1076,1081 ****
--- 1731,1737 ----
  		port = ntohs (in_addr.sin_port);
  	    }
  	    else
+ UseLocalID:
  #endif
  	    {
  		static unsigned long	unix_addr = 0xFFFFFFFF;
diff -c mit/lib/X/XErrDes.c:1.1.1.2 mit/lib/X/XErrDes.c:2.0
*** mit/lib/X/XErrDes.c:1.1.1.2	Sat Mar 12 00:37:04 1994
--- mit/lib/X/XErrDes.c	Sat Mar 12 00:37:04 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/XErrDes.c,v 2.0 1993/09/22 15:31:33 dawes Exp $
   * $XConsortium: XErrDes.c,v 11.46 92/07/23 19:17:33 rws Exp $
   */
  
***************
*** 31,36 ****
--- 32,52 ----
  #include "Xresource.h"
  #include <stdio.h>
  
+ #if defined(_POSIX_SOURCE) && !defined(X_NOT_POSIX)
+ #include <limits.h>
+ #endif
+ 
+ #ifndef PATH_MAX
+ #include <sys/param.h>
+ #ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+ #define PATH_MAX MAXPATHLEN
+ #else
+ #define PATH_MAX 1024
+ #endif
+ #endif
+ #endif
+ 
  #ifndef ERRORDB
  #define ERRORDB "/usr/lib/X11/XErrorDB"
  #endif
***************
*** 128,138 ****
      XrmString type_str;
      XrmValue result;
      char temp[BUFSIZ];
  
      if (nbytes == 0) return;
      if (!initialized) {
  	XrmInitialize();
! 	db = XrmGetFileDatabase(ERRORDB);
  	initialized = True;
      }
      if (db)
--- 144,162 ----
      XrmString type_str;
      XrmValue result;
      char temp[BUFSIZ];
+     char errordbpath[PATH_MAX];
+     char *xwinhome = NULL;
  
      if (nbytes == 0) return;
      if (!initialized) {
+         if ((xwinhome = getenv("XWINHOME")) == NULL) {
+ 	    strcpy(errordbpath, ERRORDB);
+ 	}
+ 	else {
+ 	    sprintf(errordbpath, "%s/lib/X11/XErrorDB", xwinhome);
+ 	}
  	XrmInitialize();
! 	db = XrmGetFileDatabase(errordbpath);
  	initialized = True;
      }
      if (db)
diff -c mit/lib/X/XGetDflt.c:1.1.1.1 mit/lib/X/XGetDflt.c:1.2
*** mit/lib/X/XGetDflt.c:1.1.1.1	Sat Mar 12 00:37:05 1994
--- mit/lib/X/XGetDflt.c	Sat Mar 12 00:37:05 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/XGetDflt.c,v 1.2 1993/05/24 12:36:20 dawes Exp $
   * $XConsortium: XGetDflt.c,v 1.27 91/07/09 14:54:15 rws Exp $
   */
  
***************
*** 44,50 ****
--- 45,53 ----
          uid_t uid;
  #else
  	int uid;
+ #ifndef SCO324
  	extern int getuid();
+ #endif
  #ifndef SYSV386
  	extern struct passwd *getpwuid(), *getpwnam();
  #endif
diff -c mit/lib/X/XICWrap.c:1.1.1.1 mit/lib/X/XICWrap.c:1.3
*** mit/lib/X/XICWrap.c:1.1.1.1	Sat Mar 12 00:37:05 1994
--- mit/lib/X/XICWrap.c	Sat Mar 12 00:37:05 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/XICWrap.c,v 1.3 1993/03/27 09:14:15 dawes Exp $
   * $XConsortium: XICWrap.c,v 11.7 91/05/30 13:10:36 rws Exp $
   */
  
***************
*** 36,41 ****
--- 37,46 ----
   * 
   *		 M. Collins		OSF  
   */				
+ 
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
  
  #define NEED_EVENTS
  #include "Xlibint.h"
diff -c mit/lib/X/XKeyBind.c:1.1.1.2 mit/lib/X/XKeyBind.c:2.0
*** mit/lib/X/XKeyBind.c:1.1.1.2	Sat Mar 12 00:37:06 1994
--- mit/lib/X/XKeyBind.c	Sat Mar 12 00:37:06 1994
***************
*** 24,34 ****
--- 24,140 ----
  #define XK_LATIN3
  #define XK_LATIN4
  #include <X11/keysymdef.h>
+ #include "VendorKeysym.h"
  #include <stdio.h>
  
  #define AllMods (ShiftMask|LockMask|ControlMask| \
  		 Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)
  
+ /* jbb 890512, rev. 900402 */
+ static char *compose_tab[] = {
+ 	/*   */	"''^^``~~ \240\"\250*\260",
+ 	/* ! */	"!\241^\246S\247s\247P\266p\266",
+ 	/* " */	" \250\"\250A\304E\313I\317O\326U\334a\344e\353i\357o\366u\374y\377",
+ 	/* # */	"",
+ 	/* $ */	"",
+ 	/* % */	"",
+ 	/* & */	"",
+ 	/* ' */	" ''\264A\301E\311I\315O\323U\332Y\335a\341e\351i\355o\363u\372y\375",
+ 	/* ( */	"([-{",
+ 	/* ) */	")]-}",
+ 	/* * */	" \260A\305a\345",
+ 	/* + */	"+#-\261",
+ 	/* , */	",\270C\307c\347",
+ 	/* - */	"({)}-\255L\243l\243Y\245y\245,\254^\257+\261D\320d\360:\367",
+ 	/* . */	"^\267",
+ 	/* / */	"/\\<\\^|C\242c\242U\265u\265O\330o\370",
+ 
+ 	/* 0 */	"X\244x\244S\247s\247C\251c\251R\256r\256^\260",
+ 	/* 1 */	"^\2714\2742\275",
+ 	/* 2 */	"^\262",
+ 	/* 3 */	"^\2634\276",
+ 	/* 4 */	"",
+ 	/* 5 */	"",
+ 	/* 6 */	"",
+ 	/* 7 */	"",
+ 	/* 8 */	"",
+ 	/* 9 */	"",
+ 	/* : */	"-\367",
+ 	/* ; */	"",
+ 	/* < */	"/\\<\253",
+ 	/* = */	"L\243l\243Y\245y\245",
+ 	/* > */	">\273",
+ 	/* ? */	"?\277",
+ 
+ 	/* @ */	"",
+ 	/* A */	"A@a@_\252`\300'\301^\302~\303\"\304*\305E\306",
+ 	/* B */	"",
+ 	/* C */	"/\242|\2420\251O\251o\251,\307",
+ 	/* D */	"-\320",
+ 	/* E */	"`\310'\311^\312\"\313",
+ 	/* F */	"",
+ 	/* G */	"",
+ 	/* H */	"",
+ 	/* I */	"`\314'\315^\316\"\317",
+ 	/* J */	"",
+ 	/* K */	"",
+ 	/* L */	"-\243=\243",
+ 	/* M */	"",
+ 	/* N */	"~\321",
+ 	/* O */	"X\244x\244S\247s\247C\251c\251R\256r\256_\272`\322'\323^\324~\325\"\326/\330",
+ 
+ 	/* P */	"!\266",
+ 	/* Q */	"",
+ 	/* R */	"0\256O\256o\256",
+ 	/* S */	"!\2470\247O\247o\247S\337",
+ 	/* T */	"H\336",
+ 	/* U */	"`\331'\332^\333\"\334",
+ 	/* V */	"",
+ 	/* W */	"",
+ 	/* X */	"0\244O\244o\244",
+ 	/* Y */	"-\245=\245'\335",
+ 	/* Z */	"",
+ 	/* [ */	"",
+ 	/* \ */	"",
+ 	/* ] */	"",
+ 	/* ^ */	" ^/|!\246-\257_\2570\2601\2712\2623\263.\267A\302E\312I\316O\324U\333a\342e\352i\356o\364u\373",
+ 	/* _ */	"A\252a\252^\257O\272o\272",
+ 
+ 	/* ` */	" `A\300E\310I\314O\322U\331a\340e\350i\354o\362u\371",
+ 	/* a */	"A@a@_\252`\340'\341^\342~\343\"\344*\345e\346",
+ 	/* b */	"",
+ 	/* c */	"/\242|\2420\251O\251o\251,\347",
+ 	/* d */	"-\360",
+ 	/* e */	"`\350'\351^\352\"\353",
+ 	/* f */	"",
+ 	/* g */	"",
+ 	/* h */	"",
+ 	/* i */	"`\354'\355^\356\"\357",
+ 	/* j */	"",
+ 	/* k */	"",
+ 	/* l */	"-\243=\243",
+ 	/* m */	"",
+ 	/* n */	"~\361",
+ 	/* o */	"X\244x\244C\251c\251R\256r\256S\247s\247_\272`\362'\363^\364~\365\"\366/\370",
+ 
+ 	/* p */	"!\266",
+ 	/* q */	"",
+ 	/* r */	"0\256O\256o\256",
+ 	/* s */	"!\2470\247O\247o\247s\337",
+ 	/* t */	"h\376",
+ 	/* u */	"`\371'\372^\373\"\374",
+ 	/* v */	"",
+ 	/* w */	"",
+ 	/* x */	"0\244O\244o\244x\327",
+ 	/* y */	"-\245=\245'\375\"\377",
+ 	/* z */	"",
+ 	/* { */	"",
+ 	/* | */	"C\242c\242|\246",
+ 	/* } */	"",
+ 	/* ~ */	" ~A\303N\321O\325a\343n\361o\365",
+ 	/*DEL*/ ""
+ };
+ 
  static ComputeMaskFromKeytrans();
  static int Initialize();
  static void XConvertCase();
***************
*** 371,376 ****
--- 477,610 ----
      return 1;
  }
  
+ static void
+ ComposeLed(dpy, state)
+     Display *dpy;
+     int state;
+ {
+ #define Compose_LED	16
+ 
+     XKeyboardControl kbdctrl;
+ 
+     kbdctrl.led_mode = state;
+     kbdctrl.led = Compose_LED;	
+     XChangeKeyboardControl(dpy, KBLed|KBLedMode, &kbdctrl);
+ }
+ 
+ /*
+  * dead key and compose-character support (jbb 890909, rev. 900305, 910314, 910906)
+  */
+ static void
+ ComposeHandler(dpy, keysym_in_out, modifiers, status)
+     Display *dpy;
+     KeySym *keysym_in_out;
+     unsigned int modifiers;
+     XComposeStatus *status;
+ {
+     register KeySym symbol = *keysym_in_out;
+ 
+     switch(symbol) {
+     case XK_acute:	 symbol = XK_apostrophe; goto dead;
+     case XK_diaeresis:   symbol = XK_quotedbl; goto dead;
+     case XK_cedilla:     symbol = XK_comma; goto dead;
+ #ifdef SunXK_FA_Grave	/* Sun */
+     case SunXK_FA_Grave:  symbol = XK_grave; goto dead;
+     case SunXK_FA_Circum: symbol = XK_asciicircum; goto dead;
+     case SunXK_FA_Tilde:  symbol = XK_asciitilde; goto dead;
+     case SunXK_FA_Acute:  symbol = XK_apostrophe; goto dead;
+     case SunXK_FA_Diaeresis: symbol = XK_quotedbl; goto dead;
+     case SunXK_FA_Cedilla: symbol = XK_comma; goto dead;
+ #endif
+ #ifdef DXK_grave_accent	/* DEC */
+     case DXK_grave_accent:
+     case DXK_acute_accent:
+     case DXK_circumflex_accent:
+     case DXK_tilde:
+     case DXK_diaeresis:
+     case DXK_ring_accent:
+     case DXK_cedilla_accent:
+ 	symbol &= 0xFF; goto dead;
+ #endif
+ #ifdef hpXK_mute_grave	/* HP */
+     case hpXK_mute_grave:	symbol = XK_grave; goto dead;
+     case hpXK_mute_acute:	symbol = XK_apostrophe; goto dead;
+     case hpXK_mute_asciicircum:	symbol = XK_asciicircum; goto dead;
+     case hpXK_mute_asciitilde:	symbol = XK_asciitilde; goto dead;
+     case hpXK_mute_diaeresis:	symbol = XK_quotedbl; goto dead;
+ #endif
+ #if 0
+     /* These don't occur in ISO Latin-1 */
+     case XK_macron:
+     case XK_breve:
+     case XK_abovedot:
+     case XK_doubleacute:
+     case XK_ogonek:
+     case XK_caron:
+ #endif
+ dead:
+ 	status->chars_matched = 1;
+ 	ComposeLed(dpy, LedModeOn);
+ 	break;
+     case XK_Multi_key:
+ 	status->chars_matched = 1;
+ 	ComposeLed(dpy, LedModeOn);
+ 	*keysym_in_out = NoSymbol;
+ 	return;
+     case XK_Delete:
+ 	symbol = '\177';
+ 	break;
+     }
+ 
+     /* non-Latin-1 keys and ctrl chars silently terminate compose */
+     if (status->chars_matched != 0 &&
+         ((symbol >> 8) != 0x0 || (modifiers & ControlMask))) {
+ 	/* but modifiers have no effect on compose status! */
+ 	if (! IsModifierKey(symbol)) {
+ 	    status->chars_matched = 0;
+ 	    ComposeLed(dpy, LedModeOff);
+ 	}
+ 	return;
+     }
+ 
+     if (status->chars_matched == 1) {
+ 	/* DEL ends compose processing */
+ 	if (symbol == '\177') {
+ 	    status->chars_matched = 0;
+ 	    ComposeLed(dpy, LedModeOff);
+ 	} else {
+ 	    if (symbol == XK_degree) symbol = XK_asterisk;
+ 		/* degree behaves like asterisk for compose processing */
+ 	    status->compose_ptr = compose_tab[(symbol&0x7f) - ' '];
+ 	    status->chars_matched = 2;
+ 	}
+ 	*keysym_in_out = NoSymbol;
+     }
+     else if (status->chars_matched == 2) {
+ 	register unsigned char *p;
+ 	p = (unsigned char *)status->compose_ptr;
+ 	ComposeLed(dpy, LedModeOff);
+ 	if (symbol == '\177') {
+ 	    *keysym_in_out = NoSymbol;
+ 	    status->chars_matched = 0;
+ 	} else {
+ 	    if (symbol == XK_degree) symbol = XK_asterisk;
+ 	    while (p && *p)
+ 		if ((symbol&0x7f) == p[0]) {
+ 		    *keysym_in_out = p[1];
+ 		    status->chars_matched = 3;	/* 920304 for OW3 */
+ 		    return;
+ 		} else p+=2;
+ 	    if (! (p && *p)) {
+ 		XBell(dpy, 50);
+ 		*keysym_in_out = NoSymbol;
+ 		status->chars_matched = 0;
+ 	    }
+ 	}
+     }
+     else if (status->chars_matched == 3)
+ 	status->chars_matched = 0;
+ }
+ 
  static int
  XTranslateKeySym(dpy, symbol, modifiers, buffer, nbytes)
      Display *dpy;
***************
*** 439,445 ****
      char *buffer;	/* buffer */
      int nbytes;	/* space in buffer for characters */
      KeySym *keysym;
!     XComposeStatus *status;	/* not implemented */
  {
      unsigned int modifiers;
      KeySym symbol;
--- 673,679 ----
      char *buffer;	/* buffer */
      int nbytes;	/* space in buffer for characters */
      KeySym *keysym;
!     XComposeStatus *status;	/* implemented jbb 890512 */
  {
      unsigned int modifiers;
      KeySym symbol;
***************
*** 447,452 ****
--- 681,689 ----
      if (! XTranslateKey(event->display, event->keycode, event->state,
  		  &modifiers, &symbol))
  	return 0;
+ 
+     if (status && event->type == KeyPress)
+ 	ComposeHandler(event->display, &symbol, event->state, status);
  
      if (keysym)
  	*keysym = symbol;
diff -c mit/lib/X/XKeysymDB:1.1.1.1 mit/lib/X/XKeysymDB:1.4
*** mit/lib/X/XKeysymDB:1.1.1.1	Sat Mar 12 00:37:06 1994
--- mit/lib/X/XKeysymDB	Sat Mar 12 00:37:06 1994
***************
*** 1,3 ****
--- 1,4 ----
+ ! $XFree86: mit/lib/X/XKeysymDB,v 1.4 1993/03/27 09:14:19 dawes Exp $
  ! $XConsortium: XKeysymDB,v 1.2 91/06/18 13:43:07 rws Exp $
  
  hpmute_acute		:100000A8
***************
*** 154,159 ****
  SunAgain		:FF66
  SunFind			:FF68
  SunStop			:FF69
! SunAltGraph		:FF7E	
  
  WYSetup			:1006FF00
--- 155,163 ----
  SunAgain		:FF66
  SunFind			:FF68
  SunStop			:FF69
! SunAltGraph		:FF7E
  
  WYSetup			:1006FF00
+ 
+ X386Sys_Req		:1007FF00
+ X386Mode_Lock		:1007FF01
diff -c mit/lib/X/XKeysymStr.c:1.1.1.1 mit/lib/X/XKeysymStr.c:1.2
*** mit/lib/X/XKeysymStr.c:1.1.1.1	Sat Mar 12 00:37:07 1994
--- mit/lib/X/XKeysymStr.c	Sat Mar 12 00:37:07 1994
***************
*** 13,18 ****
--- 13,21 ----
  without express or implied warranty.
  */
  
+ #ifdef SCO
+ #include <stdio.h>
+ #endif
  #include "Xlibint.h"
  #include <X11/Xresource.h>
  #include <X11/keysymdef.h>
diff -c mit/lib/X/XOpenDis.c:1.1.1.3 mit/lib/X/XOpenDis.c:1.2
*** mit/lib/X/XOpenDis.c:1.1.1.3	Sat Mar 12 00:37:07 1994
--- mit/lib/X/XOpenDis.c	Sat Mar 12 00:37:07 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/XOpenDis.c,v 1.2 1993/03/20 03:26:26 dawes Exp $
   * $XConsortium: XOpenDis.c,v 11.123 91/12/20 16:04:29 rws Exp $
   */
  
***************
*** 192,197 ****
--- 193,212 ----
  		return(NULL);
  	}
  	dpy->bufmax = dpy->buffer + BUFSIZE;
+ 
+ #ifdef _MINIX
+         /* Initialize the read buffer before the first read. */
+         dpy->read_buffer= Xmalloc(BUFSIZE);
+         if (dpy->read_buffer == NULL)
+         {
+                 OutOfMemory (dpy, setup);
+                 UnlockMutex(&lock);
+                 return(NULL);
+         }
+         dpy->read_bufptr= dpy->read_bufnxt= dpy->read_buffer;
+         dpy->read_bufmax= dpy->read_buffer + BUFSIZE;
+         dpy->read_inprogress= False;
+ #endif
   
  	/* Set up the input event queue and input event queue parameters. */
  	dpy->head = dpy->tail = NULL;
***************
*** 595,600 ****
--- 610,619 ----
  
          if (dpy->buffer)
  	   Xfree (dpy->buffer);
+ #ifdef _MINIX
+         if (dpy->read_buffer)
+            Xfree (dpy->read_buffer);
+ #endif
  	if (dpy->keysyms)
  	   Xfree ((char *) dpy->keysyms);
  	if (dpy->xdefaults)
diff -c mit/lib/X/XRdBitF.c:1.1.1.1 mit/lib/X/XRdBitF.c:1.4
*** mit/lib/X/XRdBitF.c:1.1.1.1	Sat Mar 12 00:37:08 1994
--- mit/lib/X/XRdBitF.c	Sat Mar 12 00:37:08 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/X/XRdBitF.c,v 1.4 1993/03/27 09:14:21 dawes Exp $ */
  /* $XConsortium: XRdBitF.c,v 1.15 91/02/01 16:34:46 gildea Exp $ */
  /* Copyright, 1987, Massachusetts Institute of Technology */
  
***************
*** 28,33 ****
--- 29,38 ----
   * without the other).
   */
  
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
+ 
  #include "Xlibint.h"
  #include <X11/Xos.h>
  #include "Xutil.h"
***************
*** 34,39 ****
--- 39,55 ----
  #include <stdio.h>
  #include <ctype.h>
  
+ /*
+  * Don't want getc() declared as external function for __STDC__ on
+  * ISC 2.2.1 or for _POSIX_SOURCE on 2.2.1/3.0 because of shared
+  * library creation
+  */
+ #if (defined(ISC) && defined(_POSIX_SOURCE)) || (defined(ISC22) && defined(__STDC__))
+ #ifdef getc
+ #undef getc
+ #endif
+ #define getc(p)         (--(p)->_cnt < 0 ? _filbuf(p) : (int) *(p)->_ptr++)
+ #endif
  
  #define MAX_SIZE 255
  
diff -c mit/lib/X/XStrKeysym.c:1.1.1.1 mit/lib/X/XStrKeysym.c:2.0
*** mit/lib/X/XStrKeysym.c:1.1.1.1	Sat Mar 12 00:37:09 1994
--- mit/lib/X/XStrKeysym.c	Sat Mar 12 00:37:09 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/X/XStrKeysym.c,v 2.0 1993/09/22 15:31:34 dawes Exp $ */
  /* $XConsortium: XStrKeysym.c,v 11.15 91/06/07 18:20:55 rws Exp $ */
  /* Copyright 1985, 1987, 1990 Massachusetts Institute of Technology */
  
***************
*** 13,18 ****
--- 14,22 ----
  without express or implied warranty.
  */
  
+ #ifdef SCO
+ #include <stdio.h>
+ #endif
  #include "Xlibint.h"
  #include <X11/Xresource.h>
  #include <X11/keysymdef.h>
***************
*** 33,38 ****
--- 37,57 ----
  #define NEEDKTABLE
  #include "ks_tables.h"
  
+ #if defined(_POSIX_SOURCE) && !defined(X_NOT_POSIX)
+ #include <limits.h>
+ #endif
+ 
+ #ifndef PATH_MAX
+ #include <sys/param.h>
+ #ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+ #define PATH_MAX MAXPATHLEN
+ #else
+ #define PATH_MAX 1024
+ #endif
+ #endif
+ #endif
+ 
  #ifndef KEYSYMDB
  #define KEYSYMDB "/usr/lib/X11/XKeysymDB"
  #endif
***************
*** 47,59 ****
      if (!initialized)
      {
  	char *dbname;
  
  	XrmInitialize();
  	/* use and name of this env var is not part of the standard */
  	/* implementation-dependent feature */
  	dbname = getenv("XKEYSYMDB");
! 	if (!dbname)
! 	    dbname = KEYSYMDB;
  	keysymdb = XrmGetFileDatabase(dbname);
  	if (keysymdb)
  	    Qkeysym[0] = XrmStringToQuark("Keysym");
--- 66,87 ----
      if (!initialized)
      {
  	char *dbname;
+ 	char dbpath[PATH_MAX];
+ 	char *xwinhome;
  
  	XrmInitialize();
  	/* use and name of this env var is not part of the standard */
  	/* implementation-dependent feature */
  	dbname = getenv("XKEYSYMDB");
! 	if (!dbname) {
! 	    if ((xwinhome = getenv("XWINHOME")) != NULL) {
! 		sprintf(dbpath, "%s/lib/X11/XKeysymDB", xwinhome);
! 		dbname = dbpath;
! 	    }
! 	    else {
! 		dbname = KEYSYMDB;
! 	    }
! 	}
  	keysymdb = XrmGetFileDatabase(dbname);
  	if (keysymdb)
  	    Qkeysym[0] = XrmStringToQuark("Keysym");
diff -c mit/lib/X/XcmsColNm.c:1.1.1.3 mit/lib/X/XcmsColNm.c:2.0
*** mit/lib/X/XcmsColNm.c:1.1.1.3	Sat Mar 12 00:37:09 1994
--- mit/lib/X/XcmsColNm.c	Sat Mar 12 00:37:10 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/X/XcmsColNm.c,v 2.0 1993/09/22 15:31:36 dawes Exp $" */
  /* $XConsortium: XcmsColNm.c,v 1.25 92/03/03 12:16:07 rws Exp $" */
  
  /*
***************
*** 53,62 ****
--- 54,81 ----
  extern void qsort();
  extern char *bsearch();
  #endif
+ #if defined(SVR3SHLIB) && defined(SCO)
+ extern int (*_libX11_stat)();
+ #endif
  extern XcmsColorSpace **_XcmsDIColorSpaces;
  static Status LoadColornameDB();
  void _XcmsCopyISOLatin1Lowered();
  
+ #if defined(_POSIX_SOURCE) && !defined(X_NOT_POSIX)
+ #include <limits.h>
+ #endif
+ 
+ #ifndef PATH_MAX
+ #include <sys/param.h>
+ #ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+ #define PATH_MAX MAXPATHLEN
+ #else
+ #define PATH_MAX 1024
+ #endif
+ #endif
+ #endif
+ 
  /*
   *      LOCAL DEFINES
   *		#define declarations local to this package.
***************
*** 723,733 ****
      char *pathname;
      struct stat txt;
      int length;
  
      /* use and name of this env var is not part of the standard */
      /* implementation-dependent feature */
      if ((pathname = getenv("XCMSDB")) == NULL) {
! 	pathname = XCMSDB;
      }
  
      length = strlen(pathname);
--- 742,760 ----
      char *pathname;
      struct stat txt;
      int length;
+     char xcmspath[PATH_MAX];
+     char *xwinhome;
  
      /* use and name of this env var is not part of the standard */
      /* implementation-dependent feature */
      if ((pathname = getenv("XCMSDB")) == NULL) {
! 	if ((xwinhome = getenv("XWINHOME")) != NULL) {
! 	    sprintf(xcmspath, "%s/lib/X11/Xcms.txt", xwinhome);
! 	    pathname = xcmspath;
! 	}
! 	else {
! 	    pathname = XCMSDB;
! 	}
      }
  
      length = strlen(pathname);
diff -c mit/lib/X/Xlib.h:1.1.1.1 mit/lib/X/Xlib.h:1.5
*** mit/lib/X/Xlib.h:1.1.1.1	Sat Mar 12 00:37:12 1994
--- mit/lib/X/Xlib.h	Sat Mar 12 00:37:13 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/X/Xlib.h,v 1.5 1993/03/20 03:26:30 dawes Exp $ */
  /* $XConsortium: Xlib.h,v 11.215 91/07/22 15:42:38 rws Exp $ */
  /* 
   * Copyright 1985, 1986, 1987, 1991 by the Massachusetts Institute of Technology
***************
*** 27,33 ****
  
  #define XlibSpecificationRelease 5
  
! #ifdef USG
  #ifndef __TYPES__
  #include <sys/types.h>			/* forgot to protect it... */
  #define __TYPES__
--- 28,40 ----
  
  #define XlibSpecificationRelease 5
  
! #ifdef _MINIX
! #ifndef _POSIX_INCLUDED
! #include <minix/posix.h>
! #endif /* _POSIX_INCLUDED */
! #endif /* _MINIX */
! 
! #if defined(USG) || defined(SYSV)
  #ifndef __TYPES__
  #include <sys/types.h>			/* forgot to protect it... */
  #define __TYPES__
***************
*** 40,46 ****
  #else
  #include <sys/types.h>
  #endif
! #endif /* USG */
  
  #include <X11/X.h>
  
--- 47,57 ----
  #else
  #include <sys/types.h>
  #endif
! #endif /* USG || SYSV */
! 
! #if _MINIX
! typedef char *caddr_t;
! #endif
  
  #include <X11/X.h>
  
***************
*** 58,65 ****
--- 69,79 ----
  #include <stddef.h>
  #else
  /* replace this with #include or typedef appropriate for your system */
+ #ifndef _WCHAR_T
  typedef unsigned long wchar_t;
+ #define _WCHAR_T
  #endif
+ #endif
  
  typedef char *XPointer;
  
***************
*** 478,483 ****
--- 492,504 ----
  	char *buffer;		/* Output buffer starting address. */
  	char *bufptr;		/* Output buffer index pointer. */
  	char *bufmax;		/* Output buffer maximum+1 address. */
+ #if _MINIX
+ 	char *read_buffer;	/* Read buffer starting address. */
+ 	char *read_bufptr;	/* Start of data in read buffer. */
+ 	char *read_bufnxt;	/* Place of next byte in read buffer. */
+ 	char *read_bufmax;	/* Read buffer maximum+1 address. */
+ 	Bool read_inprogress;	/* read in progress or not */
+ #endif
  	unsigned max_request_size; /* maximum number 32 bit words in request*/
  	struct _XrmHashBucketRec *db;
  	int (*synchandler)();	/* Synchronization handler */
diff -c mit/lib/X/XlibInt.c:1.1.1.3 mit/lib/X/XlibInt.c:2.1
*** mit/lib/X/XlibInt.c:1.1.1.3	Sat Mar 12 00:37:14 1994
--- mit/lib/X/XlibInt.c	Sat Mar 12 00:37:14 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/X/XlibInt.c,v 2.1 1993/11/07 14:05:53 dawes Exp $ */
  /*
   * $XConsortium: XlibInt.c,v 11.156.1.1 92/11/11 10:10:50 rws Exp $
   */
***************
*** 27,32 ****
--- 28,36 ----
  #include <X11/Xos.h>
  #include "Xlibnet.h"
  #include <stdio.h>
+ #if defined(AMOEBA) || defined(_MINIX)
+ #include <assert.h>
+ #endif
  
  static void _EatData32();
  
***************
*** 33,38 ****
--- 37,43 ----
  /* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
   * systems are broken and return EWOULDBLOCK when they should return EAGAIN
   */
+ #if !defined(AMOEBA) && !defined(_MINIX)
  #if defined(EAGAIN) && defined(EWOULDBLOCK)
  #define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
  #else
***************
*** 42,47 ****
--- 47,55 ----
  #define ETEST(err) (err == EWOULDBLOCK)
  #endif
  #endif
+ #else  /* AMOEBA || _MINIX */
+ #define ETEST(err)  0	/* EAGAIN or EWOULDBLOCK not expected */
+ #endif /* AMOEBA || _MINIX */
  
  #ifdef LACHMAN
  #ifdef EMSGSIZE
***************
*** 100,106 ****
--- 108,118 ----
  	 */
  	while (size) {
  	    errno = 0;
+ #ifndef _MINIX
  	    write_stat = WriteToServer(dpy->fd, bufindex, (int) todo);
+ #else
+ 	    write_stat = MNX_WriteToServer(dpy, bufindex, (int) todo);
+ #endif
  	    if (write_stat >= 0) {
  		size -= write_stat;
  		todo = size;
***************
*** 118,123 ****
--- 130,144 ----
  		else
  		  _XWaitForWritable(dpy);
  #endif
+ #ifdef CLIENTS_LOCALCONN
+ 	    } else if (errno == EAGAIN) {
+ 	        _XWaitForWritable(dpy);
+ 	    } else if (errno == ERANGE) {
+ 	        if (todo > 1) 
+ 		  todo >>= 1;
+ 	        else 
+ 		  _XWaitForWritable(dpy);
+ #endif
  	    } else if (errno != EINTR) {
  		/* Write failed! */
  		/* errno set by write system call. */
***************
*** 137,142 ****
--- 158,166 ----
  	char buf[BUFSIZE];
  	register xReply *rep;
  	
+ #ifdef AMOEBA
+ 	threadswitch();
+ #endif
  	if (mode == QueuedAfterFlush)
  	{
  	    _XFlush(dpy);
***************
*** 144,150 ****
--- 168,178 ----
  		return(dpy->qlen);
  	}
  	if (dpy->flags & XlibDisplayIOError) return(dpy->qlen);
+ #ifndef _MINIX
  	if (BytesReadable(dpy->fd, (char *) &pend) < 0)
+ #else
+ 	if (MNX_BytesReadable(dpy, (char *) &pend) < 0)
+ #endif
  	    _XIOError(dpy);
  #ifdef XCONN_CHECK_FREQ
  	/* This is a crock, required because FIONREAD or equivalent is
***************
*** 158,164 ****
  	    dpy->conn_checker = 0;
  	    CLEARBITS(r_mask);
  	    BITSET(r_mask, dpy->fd);
! 	    if (pend = select(dpy->fd + 1, (int *)r_mask, NULL, NULL,
  			      &zero_time))
  	    {
  		if (pend > 0)
--- 186,192 ----
  	    dpy->conn_checker = 0;
  	    CLEARBITS(r_mask);
  	    BITSET(r_mask, dpy->fd);
! 	    if (pend = select(dpy->fd + 1, (fd_set *)r_mask, NULL, NULL,
  			      &zero_time))
  	    {
  		if (pend > 0)
***************
*** 217,223 ****
--- 245,255 ----
  
  	do {
  	    /* find out how much data can be read */
+ #ifndef _MINIX
  	    if (BytesReadable(dpy->fd, (char *) &pend_not_register) < 0)
+ #else
+ 	    if (MNX_BytesReadable(dpy, (char *) &pend_not_register) < 0)
+ #endif
  	    	_XIOError(dpy);
  	    pend = pend_not_register;
  
***************
*** 265,282 ****
--- 297,340 ----
  	register long size;
  {
  	register long bytes_read;
+ #if defined(SVR4) && defined(SYSV386)
+ 	int have_waited=0;
+ #endif
  
  	if ((dpy->flags & XlibDisplayIOError) || size == 0) return;
  	errno = 0;
+ #ifndef _MINIX
  	while ((bytes_read = ReadFromServer(dpy->fd, data, (int)size))
+ #else
+ 	while ((bytes_read = MNX_ReadFromServer(dpy, data, (int)size))
+ #endif
  		!= size) {
  
  	    	if (bytes_read > 0) {
  		    size -= bytes_read;
  		    data += bytes_read;
+ #if defined(SVR4) && defined(SYSV386)
+ 		    have_waited=0;
+ #endif
  		    }
+ #if defined(SVR4) && defined(SYSV386)
+                 /*
+                  * The condition where select() says the server fd is
+                  * readable, but read returns -1 means the connection
+                  * has been closed.  This problem has been known to cause
+                  * twm to stay running (and using CPU) after the server
+                  * has finished.           DHD Dec 1991.
+                  */
+               	else if (ETEST(errno) && bytes_read < 0 && have_waited) {
+                     errno = EPIPE;
+                     _XIOError(dpy);
+                 }
+ #endif
  		else if (ETEST(errno)) {
  		    _XWaitForReadable(dpy);
+ #if defined(SVR4) && defined(SYSV386)
+ 		    have_waited=1;
+ #endif
  		    errno = 0;
  		}
  #ifdef SUNSYSV
***************
*** 284,289 ****
--- 342,353 ----
  		    _XWaitForReadable(dpy);
  		}
  #endif
+ #ifdef CLIENTS_LOCALCONN
+ 		else if (errno == EAGAIN) {
+ 		    _XWaitForReadable(dpy);
+ 		    errno = 0;
+ 		}
+ #endif
  		else if (bytes_read == 0) {
  		    /* Read failed because of end of file! */
  		    errno = EPIPE;
***************
*** 445,451 ****
--- 509,519 ----
  	iov[1].iov_base = pad;
  	size += iov[1].iov_len;
  	errno = 0;
+ #ifndef _MINIX
  	while ((bytes_read = ReadvFromServer (dpy->fd, iov, 2)) != size) {
+ #else
+ 	while ((bytes_read = MNX_ReadvFromServer (dpy, iov, 2)) != size) {
+ #endif
  
  	    if (bytes_read > 0) {
  		size -= bytes_read;
***************
*** 466,471 ****
--- 534,545 ----
  		_XWaitForReadable(dpy);
  	    }
  #endif
+ #ifdef CLIENTS_LOCALCONN
+ 	    else if (errno == EAGAIN) {
+ 		_XWaitForReadable(dpy);
+ 		errno = 0;
+ 	    }
+ #endif
  	    else if (bytes_read == 0) {
  		/* Read failed because of end of file! */
  		errno = EPIPE;
***************
*** 551,557 ****
--- 625,635 ----
  	    InsertIOV (pad, padsize)
      
  	    errno = 0;
+ #ifndef _MINIX
  	    if ((len = WritevToServer(dpy->fd, iov, i)) >= 0) {
+ #else
+ 	    if ((len = MNX_WritevToServer(dpy, iov, i)) >= 0) {
+ #endif
  		skip += len;
  		total -= len;
  		todo = total;
***************
*** 568,573 ****
--- 646,660 ----
  		else 
  		  _XWaitForWritable(dpy);
  #endif
+ #ifdef CLIENTS_LOCALCONN
+ 	    } else if (errno == EAGAIN) {
+ 		_XWaitForWritable(dpy);
+ 	    } else if (errno == ERANGE) {
+ 		if (todo > 1) 
+ 		  todo >>= 1;
+ 		else 
+ 		  _XWaitForWritable(dpy);
+ #endif
  	    } else if (errno != EINTR) {
  		_XIOError(dpy);
  	    }
***************
*** 1232,1237 ****
--- 1319,1327 ----
  }
  
  
+ #ifndef X_NO_STRERROR
+ #define _SysErrorMsg(x) strerror(x)
+ #else
  #ifndef USL_SHARELIB
  
  static char *_SysErrorMsg (n)
***************
*** 1245,1250 ****
--- 1335,1341 ----
  }
  
  #endif 	/* USL sharedlibs in don't define for SVR3.2 */
+ #endif /* !X_NO_STRERROR */
  
  
  /*
***************
*** 1674,1680 ****
   *       and so, you may be better off using gethostname (if it exists).
   */
  
! #if (defined(_POSIX_SOURCE) && !defined(AIXV3)) || defined(hpux) || defined(USG) || defined(SVR4)
  #define NEED_UTSNAME
  #include <sys/utsname.h>
  #endif
--- 1765,1771 ----
   *       and so, you may be better off using gethostname (if it exists).
   */
  
! #if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(_MINIX)) || defined(hpux) || defined(USG) || defined(SYSV) || defined(SVR4)
  #define NEED_UTSNAME
  #include <sys/utsname.h>
  #endif
***************
*** 1823,1828 ****
--- 1914,1954 ----
      return total;
  }
  
+ #ifdef SCO
+ /*
+  *	SCO doesn't have writev either
+  */
+ 
+ int _XWriteV (fd, iov, iovcnt)
+ int fd;
+ struct iovec *iov;
+ int iovcnt;
+ {
+     int i, len, total;
+     char *base;
+ 
+     errno = 0;
+     for (i = 0, total = 0; i < iovcnt; i++, iov++) {
+ 		len = iov->iov_len;
+ 		base = iov->iov_base;
+ 		while (len > 0) {
+ 			register int nbytes;
+ 
+ 			nbytes = write(fd, base, len);
+ 			if (nbytes < 0 && total == 0)
+ 				return(-1);
+ 			if (nbytes <= 0)
+ 				return(total);
+ 			errno = 0;
+ 			len   -= nbytes;
+ 			total += nbytes;
+ 			base  += nbytes;
+ 		}
+     }
+     return(total);
+ }
+ #endif /* SCO */
+ 
  #endif /* SYSV && SYSV386 && !STREAMSCONN */
  
  #ifdef STREAMSCONN
***************
*** 1963,1965 ****
--- 2089,2845 ----
  
  
  #endif /* STREAMSCONN */
+ 
+ #if defined(SCO) /* && defined(TCPCONN) */
+ BytesReadable(fd, ptr)
+      int fd, ptr;
+ {
+   /*
+    * On SCO CLIENTS_LOCALCONN uses STREAMS tty's and TCPCONN uses /dev/socksys.
+    * The later is not a STREAMS driver and will not respond to I_NREAD.
+    * On the other hand STREAMS will not respond to a FIONREAD. So we will
+    * try both here and see if any case will work.
+    */
+   register int n;
+   if ( (n = ioctl(fd, FIONREAD, ptr)) < 0 && errno == EINVAL)
+     return ioctl(fd, I_NREAD, ptr);
+   
+   return n;
+ }
+ #endif /* SCO */
+ 
+ #ifdef AMOEBA
+ #include "XAmoeba.h"
+ 
+ /*
+  * Philip's TCP/IP server silently assumes a
+  * maximum buffer size of 30000 bytes.
+  */
+ #define	TCPIP_BUFSIZE	16384
+ 
+ /*
+  * Amoeba connection information is stored in, so called,
+  * channel descriptors. Channel descriptors are identified
+  * by their index in the table below.
+  */
+ XAmChanDesc XAmChanDescriptors[OPEN_MAX];
+ 
+ /*
+  * Cleanup connection descriptors
+  */
+ void
+ XAmCleanUpChanDesc()
+ {
+     register int i;
+ 
+     for (i = 0; i < OPEN_MAX; i++) {
+ 	if (XAmChanDescriptors[i].state != ACDS_FREE) {
+ 	    /*
+ 	     * The Amoeba TCP/IP server is capability oriented, i.e.
+ 	     * it uses capabilities to identify connections. Since a
+ 	     * capability is only destroyed when it has aged too much
+ 	     * or is explicitly deleted, the connection it identifies
+ 	     * will tend to exist for some while even if the client is
+ 	     * already gone. To force connections to close this loop
+ 	     * destroys all open TCP/IP connection. This loop us auto-
+ 	     * matically executed when exit() is called.
+ 	     */
+ 	    XAmChanDescriptors[i].state = ACDS_CLOSED;
+ 	    if (XAmChanDescriptors[i].type == ACDT_TCPIP)
+ 		std_destroy(&XAmChanDescriptors[i].chancap);
+ 	    if (XAmChanDescriptors[i].type == ACDT_VIRTCIRC)
+ 		vc_close(XAmChanDescriptors[i].virtcirc, VC_BOTH);
+ 	}
+ 	XAmChanDescriptors[i].state = ACDS_FREE;
+     }
+ }
+ 
+ /*
+  * Cleanup connection descriptors on a signal
+  */
+ void
+ XAmSignalCleanUpChanDesc(sig)
+     int sig;
+ {
+     XAmCleanUpChanDesc();
+     _exit(sig | 0x80);
+ }
+ 
+ /*
+  * Allocate a channel descriptor
+  */
+ XAmChanDesc *
+ XAmAllocChanDesc()
+ {
+     register int i;
+     static int initialized = False;
+ 
+     /*
+      * Since the TCP/IP server is capability based its connections exists
+      * even if the owner process is long gone. To overcome this nuisance,
+      * a sweep is made over the connection descriptors when exit() is
+      * called or when an un-catched (by application program) signal is 
+      * received.
+      */
+     if (!initialized) {
+ 	initialized = True;
+ 	atexit(XAmCleanUpChanDesc);
+ 	if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
+ 	    signal(SIGHUP, XAmSignalCleanUpChanDesc);
+ 	if (signal(SIGQUIT, SIG_IGN) != SIG_IGN)
+ 	    signal(SIGQUIT, XAmSignalCleanUpChanDesc);
+ 	if (signal(SIGINT, SIG_IGN) != SIG_IGN)
+ 	    signal(SIGINT, XAmSignalCleanUpChanDesc);
+ 	if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
+ 	    signal(SIGTERM, XAmSignalCleanUpChanDesc);
+     }
+ 
+     for (i = 0; i < OPEN_MAX; i++) {
+ 	if (XAmChanDescriptors[i].state == ACDS_FREE) {
+ 	    XAmChanDescriptors[i].state = ACDS_USED;
+ 	    return &XAmChanDescriptors[i];
+ 	}
+     }
+     return (XAmChanDesc *) NULL;
+ }
+ 
+ /*
+  * Convert ``file descriptor'' to channel descriptor
+  */
+ XAmChanDesc *
+ XAmFdToChanDesc(fd)
+     int fd;
+ {
+     assert(fd >= 0 && fd < OPEN_MAX);
+     return &XAmChanDescriptors[fd];
+ }
+ 
+ /*
+  * Convert channel descriptor to ``file descriptor''
+  */
+ int
+ XAmChanDescToFd(chandesc)
+     XAmChanDesc *chandesc;
+ {
+     return chandesc - XAmChanDescriptors;
+ }
+ 
+ /*
+  * Free channel descriptor
+  */
+ void
+ XAmFreeChanDesc(chandesc)
+     XAmChanDesc *chandesc;
+ {
+     if (chandesc->sema) {
+ 	Xfree(chandesc->sema);
+ 	chandesc->sema = NULL;
+     }
+     chandesc->state = ACDS_FREE;
+ }
+ 
+ /*
+  * Shutdown TCP/IP reader thread
+  */
+ void
+ XAmReaderSignalCatcher(sig, us, extra)
+     signum sig;
+     thread_ustate *us;
+     char *extra;
+ {
+     register XAmChanDesc *chandesc = (XAmChanDesc *)extra;
+ 
+     cb_close(chandesc->circbuf);
+     chandesc->state = ACDS_CLOSED;
+     thread_exit();
+ }
+ 
+ /*
+  * TCP/IP reader thread
+  */
+ void
+ XAmReaderThread(argptr, argsize)
+     void *argptr;
+     int argsize;
+ {
+     register XAmChanDesc *chandesc;
+ 
+     assert(argsize == sizeof(XAmChanDesc *));
+     chandesc = *((XAmChanDesc **)argptr);
+     (void)sig_catch(chandesc->signal, XAmReaderSignalCatcher, (char*)chandesc);
+     while (True) {
+ 	char buffer[CIRCBUFSIZE];
+ 	bufsize size;
+ 
+ 	size = tcpip_read(&chandesc->chancap, buffer, sizeof(buffer));
+ 	if (ERR_STATUS(size)) {
+ 	    fprintf(stderr, "Xlib: TCP/IP read failed (%s)\n",
+ 		err_why(ERR_CONVERT(size)));
+ 	    cb_close(chandesc->circbuf);
+ 	    thread_exit();
+ 	}
+ 
+ 	if (size == 0 || cb_puts(chandesc->circbuf, buffer, size)) {
+ 	    if (size != 0)
+ 		fprintf(stderr, "Xlib: short write to circular buffer\n");
+ 	    cb_close(chandesc->circbuf);
+ 	    chandesc->state = ACDS_CLOSED;
+ 	    thread_exit();
+ 	}
+     }
+ }
+ 
+ /*
+  * Determine how many bytes are readable
+  */
+ int
+ _XBytesReadable(ifd, count)
+     int ifd;
+     int *count;
+ {
+     register XAmChanDesc *chandesc;
+ 
+     errno = 0;
+     chandesc = XAmFdToChanDesc(ifd);
+     if (chandesc->state == ACDS_CLOSED) {
+ 	errno = EBADF;
+ 	*count = 0;
+ 	return -1;
+     }
+     if (chandesc->type == ACDT_TCPIP)
+ 	*count = cb_full(chandesc->circbuf);
+     if (chandesc->type == ACDT_VIRTCIRC)
+ 	*count = vc_avail(chandesc->virtcirc, VC_IN);
+     if (*count < 0) {
+ 	errno = chandesc->state == ACDS_CLOSED ? EINTR : EPIPE;
+ 	*count = 0;
+ 	return -1;
+     }
+     return 0;
+ }
+ 
+ /*
+  * Wait until input is available or until the timer expires
+  */
+ int
+ _XAmSelect(ifd, timout)
+     int ifd;
+     int timout;
+ {
+     register XAmChanDesc *chandesc;
+     register int n;
+ 
+     errno = 0;
+     chandesc = XAmFdToChanDesc(ifd);
+     if (chandesc->state == ACDS_CLOSED) {
+ 	errno = EBADF;
+ 	return -1;
+     }
+ 
+     /*
+      * Allocate semaphore to sleep on when no characters
+      * are available. The underlying circular buffer and
+      * virtual circuit packages manage this semaphore.
+      */
+     if (chandesc->sema == (semaphore *)NULL) {
+ 	chandesc->sema = Xmalloc(sizeof(semaphore));
+ 	sema_init(chandesc->sema, 0);
+ 	if (chandesc->type == ACDT_TCPIP)
+ 	    cb_setsema(chandesc->circbuf, chandesc->sema);
+ 	else
+ 	    vc_setsema(chandesc->virtcirc, chandesc->sema);
+     }
+ 
+     /*
+      * TCP/IP connection
+      */
+     if (chandesc->type == ACDT_TCPIP) {
+ 	if ((n = cb_full(chandesc->circbuf)) != 0) {
+ 	    if (n < 0) errno = EPIPE;
+ 	    return n; /* includes error as well */
+ 	}
+ 	if (sema_trydown(chandesc->sema, timout) < 0) {
+ 	    errno = EINTR;
+ 	    return -1;
+ 	}
+ 	if ((n = cb_full(chandesc->circbuf)) < 0)
+ 	    errno = EPIPE;
+ 	return n;
+     }
+ 
+     /*
+      * Virtual circuit connection
+      */
+     if (chandesc->type == ACDT_VIRTCIRC) {
+ 	if ((n = vc_avail(chandesc->virtcirc, VC_IN)) != 0) {
+ 	    if (n < 0) errno = EPIPE;
+ 	    return n; /* includes error as well */
+ 	}
+ 	if (sema_trydown(chandesc->sema, timout) < 0) {
+ 	    errno = EINTR;
+ 	    return -1;
+ 	}
+ 	if ((n = vc_avail(chandesc->virtcirc, VC_IN)) < 0)
+ 	    errno = EPIPE;
+ 	return n;
+     }
+ 
+     errno = EINVAL;
+     return -1;
+ }
+ 
+ /*
+  * Read ``count'' bytes from server
+  */
+ int
+ _XReadFromServer(fdi, buf, count)
+     int fdi, count;
+     char *buf;
+ {
+     register XAmChanDesc *chandesc;
+     register int rv;
+ 
+     errno = 0;
+     chandesc = XAmFdToChanDesc(fdi);
+     if (chandesc->state == ACDS_CLOSED) {
+ 	errno = EBADF;
+ 	return -1;
+     }
+ 
+     /*
+      * TCP/IP connection
+      */
+     if (chandesc->type == ACDT_TCPIP) {
+ 	rv = cb_gets(chandesc->circbuf, buf, count, count);
+ 	if (rv != count) {
+ 	    if (rv == 0) {
+ 		fprintf(stderr, "Xlib: Cannot read circular buffer\n");
+ 		errno = EPIPE;
+ 		rv = -1;
+ 	    } else
+ 		fprintf(stderr, "Xlib: Cannot read circular buffer (%d)\n", rv);
+ 	}
+     }
+ 
+     /*
+      * Virtual circuit connection
+      */
+     if (chandesc->type == ACDT_VIRTCIRC) {
+ 	rv = vc_readall(chandesc->virtcirc, buf, count);
+ 	if (rv < 0) {
+ 	    fprintf(stderr, "Xlib: Cannot read virtual circuit\n");
+ 	    errno = EPIPE;
+ 	    rv = -1;
+ 	}
+     }
+ 
+     /*
+      * The circular buffer writer will only UP the semaphore when
+      * characters are available; we have to down it ourselfs.
+      */
+     if (chandesc->sema && rv != -1)
+ 	sema_mdown(chandesc->sema, count);
+     return rv;
+ }
+ 
+ /*
+  * Write ``count'' bytes to server
+  */
+ int
+ _XWriteToServer(fdi, buf, count)
+     int fdi;
+     char *buf;
+     int count;
+ {
+     register XAmChanDesc *chandesc;
+     register int size;
+ 
+     errno = 0;
+     chandesc = XAmFdToChanDesc(fdi);
+     if (chandesc->state == ACDS_CLOSED) {
+ 	errno = EBADF;
+ 	return -1;
+     }
+ 
+     /*
+      * TCP/IP connection
+      */
+     if (chandesc->type == ACDT_TCPIP) {
+ 	for (size = 0; count > 0; ) {
+ 	    bufsize bsize;
+ 	    int wrcnt;
+ 
+ 	    wrcnt = count > TCPIP_BUFSIZE ? TCPIP_BUFSIZE : count;
+ 	    bsize = tcpip_write(&chandesc->chancap, buf, wrcnt);
+ 	    if (ERR_STATUS(bsize)) {
+ 		fprintf(stderr, "Xlib: TCP/IP write failed (%s)\n",
+ 		    tcpip_why(ERR_CONVERT(bsize)));
+ 		errno = EPIPE;
+ 		return -1;
+ 	    }
+ 	    if (bsize != wrcnt) {
+ 		fprintf(stderr,
+ 		    "Xlib: TCP/IP write failed (expected %d, wrote %d)\n",
+ 			(int)bsize, wrcnt);
+ 		errno = EPIPE;
+ 		return -1;
+ 	    }
+ 	    buf += bsize;
+ 	    count -= (int) bsize;
+ 	    size += (int) bsize;
+ 	}
+     }
+ 
+     /*
+      * Virtual circuit connection
+      */
+     if (chandesc->type == ACDT_VIRTCIRC) {
+ 	if ((size = vc_write(chandesc->virtcirc, buf, count)) < 0) {
+ 	    fprintf(stderr, "Xlib: virtual circuit write failed\n");
+ 	    errno = EPIPE;
+ 	    return -1;
+ 	}
+     }
+     return size;
+ }
+ 
+ /*
+  * _XReadV - scatter/gather routine
+  */
+ _XReadV(fdi, iov, n)
+     int fdi, n;
+     register struct iovec *iov;
+ {
+     int count = 0, thiscount;
+ 
+     while (n--) {
+ 	if (iov->iov_len) {
+ 	    thiscount = ReadFromServer(fdi, iov->iov_base, iov->iov_len);
+ 	    if (thiscount < 0) return thiscount;
+ 	    count += thiscount;
+ 	    if (thiscount < iov->iov_len) break;
+ 	}
+ 	iov++;
+     }
+     return count;
+ }
+ 
+ /*
+  * _XWriteV - scatter/gather routine
+  */
+ int
+ _XWriteV(fdi, iov, n)
+     int fdi, n;
+     register struct iovec *iov;
+ {
+     int count = 0, thiscount;
+ 
+     while (n--) {
+ 	if (iov->iov_len) {
+ 	    thiscount = WriteToServer(fdi, iov->iov_base, iov->iov_len);
+ 	    if (thiscount < 0)
+ 		return thiscount;
+ 	    count += thiscount;
+ 	    if (thiscount < iov->iov_len) break;
+ 	}
+ 	iov++;
+     }
+     return count;
+ }
+ #endif /* AMOEBA */
+ 
+ #ifdef _MINIX
+ int MNX_BytesReadable (dpy, ptr)
+ Display *dpy;
+ int * ptr;
+ {
+ 	unsigned rd_siz;
+ 	int r;
+ 	asio_fd_set_t bits;
+ 	struct fwait fw;
+ 
+ 	*ptr= 0;
+ 	if (dpy->read_bufnxt > dpy->read_bufptr)
+ 	{
+ 		*ptr= dpy->read_bufnxt-dpy->read_bufptr;
+ 		return 0;
+ 	}
+ 	if (!dpy->read_inprogress)
+ 	{
+ 		dpy->read_bufptr= dpy->read_bufnxt= dpy->read_buffer;
+ 		rd_siz= dpy->read_bufmax-dpy->read_bufnxt;
+ 		r= read(dpy->fd, dpy->read_bufnxt, rd_siz);
+ 		if (r > 0)
+ 		{
+ 			dpy->read_bufnxt += r;
+ 			*ptr= r;
+ 			return 0;
+ 		}
+ 		else if (r == 0)
+ 		{
+ 			errno= EPIPE;
+ 			return -1;
+ 		}
+ 		else if (errno != EINPROGRESS)
+ 		{
+ 			return r;
+ 		}
+ 		dpy->read_inprogress= True;
+ 		return 0;
+ 	}
+ 	ASIO_FD_ZERO(&bits);
+ 	ASIO_FD_SET(dpy->fd, ASIO_READ, &bits);
+ 	fw.fw_flags= FWF_NONBLOCK;
+ 	fw.fw_bits= bits.afds_bits;
+ 	fw.fw_maxfd= ASIO_FD_SETSIZE;
+ 	r= fwait(&fw);
+ 	assert(r == 0 || r == -1 && errno == EAGAIN);
+ 	if (r == -1)
+ 	{
+ 		return 0;
+ 	}
+ 	assert(fw.fw_fd == dpy->fd);
+ 	assert(fw.fw_operation == ASIO_READ);
+ 	dpy->read_inprogress= False;
+ 	if (fw.fw_result == -1 || fw.fw_result == 0)
+ 	{
+ 		if (fw.fw_result == -1)
+ 			errno= fw.fw_errno;
+ 		else
+ 			errno= EPIPE;
+ 		return fw.fw_result;
+ 	}
+ 	dpy->read_bufnxt += fw.fw_result;
+ 	*ptr= fw.fw_result;
+ 	return 0;
+ }
+ 
+ int MNX_ReadFromServer(dpy, buf, siz)
+ Display *dpy;
+ char *buf;
+ unsigned siz;
+ {
+ 	unsigned rd_siz;
+ 	int r;
+ 	struct asio_fd_set bits;
+ 	struct fwait fw;
+ 
+ 	assert(dpy->read_buffer <= dpy->read_bufptr &&
+ 		dpy->read_bufptr <= dpy->read_bufnxt &&
+ 		dpy->read_bufnxt <= dpy->read_bufmax &&
+ 		dpy->read_buffer <= dpy->read_bufmax &&
+ 		dpy->read_buffer != NULL);
+ 	if (dpy->read_bufptr < dpy->read_bufnxt)
+ 		goto gotbytes;
+ 	if (!dpy->read_inprogress)
+ 	{
+ 		dpy->read_bufptr= dpy->read_bufnxt= dpy->read_buffer;
+ 		rd_siz= dpy->read_bufmax-dpy->read_bufnxt;
+ 		r= read(dpy->fd, dpy->read_bufnxt, rd_siz);
+ 		if (r > 0)
+ 		{
+ 			dpy->read_bufnxt += r;
+ 			goto gotbytes;
+ 		}
+ 		if (r == -1 && errno != EINPROGRESS || r == 0)
+ 		{
+ 			return r;
+ 		}
+ 		dpy->read_inprogress= True;
+ 	}
+ 	ASIO_FD_ZERO(&bits);
+ 	ASIO_FD_SET(dpy->fd, ASIO_READ, &bits);
+ 	fw.fw_flags= 0;
+ 	fw.fw_bits= bits.afds_bits;
+ 	fw.fw_maxfd= ASIO_FD_SETSIZE;
+ 	r= fwait(&fw);
+ 	assert(r == 0 || r == -1 && errno == EINTR);
+ 	if (r == -1)
+ 	{
+ 		return -1;
+ 	}
+ 	assert(fw.fw_fd == dpy->fd);
+ 	assert(fw.fw_operation == ASIO_READ);
+ 	dpy->read_inprogress= False;
+ 	if (fw.fw_result == -1 || fw.fw_result == 0)
+ 	{
+ 		if (fw.fw_result == -1)
+ 			errno= fw.fw_errno;
+ 		return fw.fw_result;
+ 	}
+ 	dpy->read_bufnxt += fw.fw_result;
+ gotbytes:
+ 	if (siz > dpy->read_bufnxt-dpy->read_bufptr)
+ 		siz= dpy->read_bufnxt-dpy->read_bufptr;
+ 	memcpy(buf, dpy->read_bufptr, siz);
+ 	dpy->read_bufptr += siz;
+ 	return siz;
+ }
+ 
+ int MNX_ReadvFromServer(dpy, iov, iovcnt)
+ Display *dpy;
+ struct iovec *iov;
+ int iovcnt;
+ {
+     int i, len, total;
+     char *base;
+ 
+     errno = 0;
+     for (i=0, total=0;  i<iovcnt;  i++, iov++) {
+ 	len = iov->iov_len;
+ 	base = iov->iov_base;
+ 	while (len > 0) {
+ 	    register int nbytes;
+ 	    nbytes = MNX_ReadFromServer(dpy, base, len);
+ 	    if (nbytes < 0 && total == 0)  return -1;
+ 	    if (nbytes <= 0)  return total;
+ 	    errno = 0;
+ 	    len   -= nbytes;
+ 	    total += nbytes;
+ 	    base  += nbytes;
+ 	}
+     }
+     return total;
+ }
+ 
+ int MNX_WritevToServer(dpy, iov, iovcnt)
+ Display *dpy;
+ struct iovec *iov;
+ int iovcnt;
+ {
+     int i, len, total;
+     char *base;
+ 
+     errno = 0;
+     for (i=0, total=0;  i<iovcnt;  i++, iov++) {
+ 	len = iov->iov_len;
+ 	base = iov->iov_base;
+ 	while (len > 0) {
+ 	    register int nbytes;
+ 	    nbytes = MNX_WriteToServer(dpy, base, len);
+ 	    if (nbytes < 0 && total == 0)  return -1;
+ 	    if (nbytes <= 0)  return total;
+ 	    errno = 0;
+ 	    len   -= nbytes;
+ 	    total += nbytes;
+ 	    base  += nbytes;
+ 	}
+     }
+     return total;
+ }
+ 
+ int MNX_WriteToServer(dpy, buf, siz)
+ Display *dpy;
+ char *buf;
+ unsigned siz;
+ {
+ /* Writing is difficult. If we just issued a blocking write then
+  * we can get deadlock if the server also decides to write.
+  * The server doesn't do deadlock prevention so we have to buffer
+  * incoming data.
+  */
+ 	int r, pend;
+ 	xEvent *ev;
+ 	asio_fd_set_t bits;
+ 	struct fwait fw;
+ 
+ 	/* Let's start with a write, maybe we are lucky. */
+ 	r= write(dpy->fd, buf,siz);
+ 	if (r >= 0 || errno != EINPROGRESS)
+ 		return r;	/* We were lucky. */
+ 	for(;;)
+ 	{
+ 		/* Try to get a read in progress. */
+ 		if (!dpy->read_inprogress)
+ 		{
+ 			char readbuf[BUFSIZE];
+ 
+ 			if (MNX_BytesReadable(dpy, &pend) < 0)
+ 				_XIOError(dpy);
+ 			if (dpy->read_inprogress)
+ 				continue;
+ 			if (pend < SIZEOF(xEvent)) pend = SIZEOF(xEvent);
+ 
+ 			if (pend > BUFSIZE) pend = BUFSIZE;
+ 
+ 			pend= (pend / SIZEOF(xEvent)) * SIZEOF(xEvent);
+ 
+ 			_XRead(dpy, readbuf, pend);
+ 
+ 			STARTITERATE (ev,xEvent, readbuf, (pend > 0),
+ 					(pend -= SIZEOF(xEvent))) {
+ 				if (ev->u.u.type == X_Error)
+ 					_XError(dpy, (xError *) ev);
+ 				else
+ 					_XEnq( dpy, ev);
+ 			}
+ 			ENDITERATE
+ 			continue;
+ 		}
+ 		/* Let's fwait. */
+ 		ASIO_FD_ZERO(&bits);
+ 		ASIO_FD_SET(dpy->fd, ASIO_READ, &bits);
+ 		ASIO_FD_SET(dpy->fd, ASIO_WRITE, &bits);
+ 		fw.fw_flags= 0;
+ 		fw.fw_bits= bits.afds_bits;
+ 		fw.fw_maxfd= ASIO_FD_SETSIZE;
+ 		r= fwait(&fw);
+ 		if (r == -1)
+ 		{
+ 			assert(errno == EINTR);
+ 			continue;
+ 		}
+ 		assert(r == 0);
+ 		assert(fw.fw_fd == dpy->fd);
+ 		if (fw.fw_operation == ASIO_WRITE)
+ 		{
+ 			/* We are done. */
+ 			r= fw.fw_result;
+ 			if (r == -1)
+ 				errno= fw.fw_errno;
+ 			return r;
+ 		}
+ 		assert(fw.fw_operation == ASIO_READ);
+ 		r= fw.fw_result;
+ 		if (r == -1)
+ 		{
+ 			errno= fw.fw_errno;
+ 			_XIOError(dpy);
+ 		}
+ 		if (r == 0)
+ 		{
+ 			errno= EPIPE;
+ 			_XIOError(dpy);
+ 		}
+ 		dpy->read_bufptr += r;
+ 		dpy->read_inprogress= False;
+ 	}
+ }
+ 			
+ int MNX_XConnectionNumber(dpy)
+ Display *dpy;
+ {
+ 	if (!dpy->read_inprogress)
+ 		return -1;
+ 	return dpy->fd;
+ }
+ 
+ void XReplyReadStatus(dpy, r, err)
+ Display *dpy;
+ int r;
+ int err;
+ {
+ 	assert(dpy->read_inprogress);
+ 	dpy->read_inprogress= False;
+ 	if (r > 0)
+ 	{
+ 		dpy->read_bufnxt += r;
+ 		return;
+ 	} 
+ 	if (r == 0)
+ 		errno= EPIPE;
+ 	else
+ 		errno= err;
+ 	_XIOError(dpy);
+ }
+ #endif /* _MINIX */
diff -c mit/lib/X/Xlibint.h:1.1.1.1 mit/lib/X/Xlibint.h:1.3
*** mit/lib/X/Xlibint.h:1.1.1.1	Sat Mar 12 00:37:16 1994
--- mit/lib/X/Xlibint.h	Sat Mar 12 00:37:16 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/X/Xlibint.h,v 1.3 1993/03/27 09:14:24 dawes Exp $ */
  /* $XConsortium: Xlibint.h,v 11.91 91/07/22 15:43:08 rws Exp $ */
  /* Copyright 1984, 1985, 1987, 1989  Massachusetts Institute of Technology */
  
***************
*** 66,73 ****
  #include <stdlib.h>
  #include <string.h>
  #else
! char *malloc(), *realloc(), *calloc();
! void exit();
  #ifdef SYSV
  #include <string.h>
  #else
--- 67,74 ----
  #include <stdlib.h>
  #include <string.h>
  #else
! extern char *malloc(), *realloc(), *calloc();
! extern void exit();
  #ifdef SYSV
  #include <string.h>
  #else
diff -c mit/lib/X/Xlibnet.h:1.1.1.1 mit/lib/X/Xlibnet.h:2.0
*** mit/lib/X/Xlibnet.h:1.1.1.1	Sat Mar 12 00:37:16 1994
--- mit/lib/X/Xlibnet.h	Sat Mar 12 00:37:16 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/X/Xlibnet.h,v 2.0 1993/07/28 11:56:11 dawes Exp $ */
  /* $XConsortium: Xlibnet.h,v 1.18 91/07/23 19:01:27 rws Exp $ */
  
  /*
***************
*** 26,37 ****
--- 27,62 ----
  #endif
  #endif /* X_UNIX_PATH */
  
+ #ifdef _MINIX
+ #define ASYNCHCONN
+ #endif
+ 
+ #ifdef ASYNCHCONN
+ #ifdef _MINIX
+ /*
+  * Minix Asynch I/O
+  */
+ #define BytesReadable(fd,ptr) (_XBytesReadable ((fd), (ptr)))
+ 
+ #include <sys/ioctl.h>
+ #include <net/gen/in.h>
+ #include <net/gen/netdb.h>
+ #include <net/gen/tcp.h>
+ #include <net/gen/tcp_io.h>
+ #include <net/gen/socket.h>
+ #endif /* _MINIX */
+ 
+ #else /* !ASYNCHCONN */
  #ifdef STREAMSCONN
  #ifdef SYSV
  /*
   * UNIX System V Release 3.2
   */
+ #ifndef SCO
  #define BytesReadable(fd,ptr) (_XBytesReadable ((fd), (ptr)))
+ #else
+ #include <sys/socket.h>
+ #endif
  #define MALLOC_0_RETURNS_NULL
  #include <sys/ioctl.h>
  
***************
*** 45,76 ****
--- 70,131 ----
  
  #endif /* SVR4 */
  #else /* not STREAMSCONN */
+ #ifdef AMOEBA
+ /*
+  * Amoeba 5.0, TCP/IP connections as well as virtual circuits
+  */
+ #define BytesReadable(fd,ptr) (_XBytesReadable ((fd), (ptr)))
+ #ifndef MALLOC_0_RETURNS_NULL
+ #define MALLOC_0_RETURNS_NULL
+ #endif
+ #else /* not AMOEBA */
  /*
   * socket-based systems
   */
+ #if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN)
  #include <netinet/in.h>
+ #else
+ #ifdef ESIX
+ #include <lan/in.h>
+ #endif
+ #endif
  #include <sys/ioctl.h>
+ #if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN)
  #include <netdb.h>
+ #endif
  #include <sys/uio.h>	/* needed for XlibInt.c */
  #ifdef SVR4
  #include <sys/filio.h>
+ #ifdef SVR4_ACP
+ #include <sys/stropts.h>
+ #endif
  #endif
  
  #if defined(SYSV386) && defined(SYSV)
+ #ifndef ESIX
  #include <net/errno.h>
+ #endif
  #include <sys/stropts.h>
+ #ifndef SCO
  #define BytesReadable(fd,ptr) ioctl((fd), I_NREAD, (ptr))
  #else
+ #include <sys/socket.h>
+ #endif
+ #else
  #define BytesReadable(fd, ptr) ioctl ((fd), FIONREAD, (ptr))
  #endif
  
+ #endif /* AMOEBA else */
  #endif /* STREAMSCONN else */
+ #endif /* ASYNCHCONN else */
  
+ #if !defined(AMOEBA) && !defined(ASYNCHCONN)
  /*
   * If your BytesReadable correctly detects broken connections, then
   * you should NOT define XCONN_CHECK_FREQ.
   */
  #define XCONN_CHECK_FREQ 256
+ #endif /* AMOEBA */
  
  #ifndef X_NOT_POSIX
  #ifdef _POSIX_SOURCE
***************
*** 90,100 ****
--- 145,159 ----
  #ifdef NOFILE
  #define OPEN_MAX NOFILE
  #else
+ #ifdef _POSIX_OPEN_MAX
+ #define OPEN_MAX _POSIX_OPEN_MAX
+ #else
  #define OPEN_MAX NOFILES_MAX
  #endif
  #endif
  #endif
  #endif
+ #endif
  
  #if OPEN_MAX > 256
  #undef OPEN_MAX
***************
*** 212,218 ****
   *		int iov_len;
   *	};
   */
! #if defined(USG) && !defined(CRAY) && !defined(umips) && !defined(MOTOROLA)
  struct iovec {
      caddr_t iov_base;
      int iov_len;
--- 271,277 ----
   *		int iov_len;
   *	};
   */
! #if defined(AMOEBA) || (defined(USG) && !defined(CRAY) && !defined(umips) && !defined(MOTOROLA))
  struct iovec {
      caddr_t iov_base;
      int iov_len;
***************
*** 234,244 ****
--- 293,310 ----
  
  #else /* else not STREAMSCONN */
  
+ #ifdef AMOEBA
+ #define ReadFromServer(dpy, data, size) _XReadFromServer((dpy), (data), (size))
+ #define WriteToServer(dpy, bufind, size) _XWriteToServer((dpy), (bufind), (size))
+ #else /* !AMOEBA */
+ #ifndef _MINIX
  /*
   * bsd can read from sockets directly
   */
  #define ReadFromServer(dpy, data, size) read((dpy), (data), (size))
  #define WriteToServer(dpy, bufind, size) write((dpy), (bufind), (size))
+ #endif /* _MINIX */
+ #endif /* AMOEBA */
  
  #endif /* STREAMSCONN */
  
***************
*** 245,254 ****
--- 311,324 ----
  
  #ifndef USL_COMPAT
  #if !defined(USG) || defined(MOTOROLA)
+ #if !defined(AMOEBA) && !defined(_MINIX)
  #if !(defined(SYSV) && defined(SYSV386))
  #define _XReadV readv
  #endif
+ #ifndef SCO
  #define _XWriteV writev
+ #endif
+ #endif /* !AMOEBA && !_MINIX */
  #endif
  #endif /* !USL_COMPAT */
  
diff -c mit/lib/X/Xrm.c:1.1.1.4 mit/lib/X/Xrm.c:1.4
*** mit/lib/X/Xrm.c:1.1.1.4	Sat Mar 12 00:37:18 1994
--- mit/lib/X/Xrm.c	Sat Mar 12 00:37:18 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/Xrm.c,v 1.4 1993/05/04 14:59:20 dawes Exp $
   * $XConsortium: Xrm.c,v 1.72 92/01/10 14:21:12 rws Exp $
   */
  
***************
*** 33,38 ****
--- 34,55 ----
  #include	<X11/Xresource.h>
  #include 	"XrmI.h"
  #include	"Xlcint.h"
+ 
+ #if defined(SVR3SHLIB) && defined(SCO)
+ extern int    (*_libX11_stat)();
+ #endif
+ 
+ /*
+  * Don't want putc() declared as external function for __STDC__
+  * on ISC 2.2.1 or for _POSIX_SOURCE on 2.2.1/3.0 because of
+  * shared library creation
+  */
+ #if (defined(ISC) && defined(_POSIX_SOURCE)) || (defined(ISC22) && defined(__STDC__))
+ #ifdef putc
+ #undef putc
+ #endif
+ #define putc(x, p)      (--(p)->_cnt < 0 ? _flsbuf((unsigned char) (x), (p)) : (int) (*(p)->_ptr++ = (unsigned char) (x)))
+ #endif
  
  #if __STDC__
  #define Const const
diff -c mit/lib/X/evtomask.c:1.1.1.1 mit/lib/X/evtomask.c:2.0
*** mit/lib/X/evtomask.c:1.1.1.1	Sat Mar 12 00:37:19 1994
--- mit/lib/X/evtomask.c	Sat Mar 12 00:37:19 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/X/evtomask.c,v 2.0 1993/07/24 04:51:03 dawes Exp $ */
  /* $XConsortium: evtomask.c,v 1.8 91/02/20 18:49:00 rws Exp $ */
  /* Copyright    Massachusetts Institute of Technology    1987	*/
  
***************
*** 12,17 ****
--- 13,24 ----
  suitability of this software for any purpose.  It is provided "as is"
  without express or implied warranty.
  */
+ 
+ #ifdef SVR3SHLIB
+ #ifdef _Xevent_to_mask
+ #undef _Xevent_to_mask
+ #endif
+ #endif
  
  #include <X11/X.h>
  
diff -c mit/lib/X/globals.c:1.1.1.1 mit/lib/X/globals.c:1.3
*** mit/lib/X/globals.c:1.1.1.1	Sat Mar 12 00:37:19 1994
--- mit/lib/X/globals.c	Sat Mar 12 00:37:19 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/globals.c,v 1.3 1993/03/27 09:14:32 dawes Exp $
   * $XConsortium: globals.c,v 1.13 91/07/12 15:54:41 gildea Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 32,38 ****
   * Some shared library implementations are *much* happier if there isn't any
   * global initialized data.
   */
! #ifdef NULL_NOT_ZERO			/* then need to initialize */
  #define SetZero(t,var,z) t var = z
  #else 
  #define SetZero(t,var,z) t var
--- 33,39 ----
   * Some shared library implementations are *much* happier if there isn't any
   * global initialized data.
   */
! #if defined(NULL_NOT_ZERO) || defined(SVR3SHLIB) /* then need to initialize */
  #define SetZero(t,var,z) t var = z
  #else 
  #define SetZero(t,var,z) t var
***************
*** 77,82 ****
--- 78,84 ----
  ZEROINIT (Display *, _XHeadOfDisplayList, NULL);
  
  
+ #include "libX11.c"
  
  
  #ifdef STREAMSCONN
***************
*** 224,230 ****
--- 226,234 ----
   */
  
  
+ #ifndef SVR3SHLIB
   _XQEvent * _qfree = NULL;
+ #endif
   long _qfreeFlag = 0;
   void * _qfreePtr = NULL;
  
diff -c /dev/null mit/lib/X/import.h:2.1
*** /dev/null	Sat Mar 12 00:37:19 1994
--- mit/lib/X/import.h	Sat Mar 12 00:37:20 1994
***************
*** 0 ****
--- 1,243 ----
+ /* libX11 : import.h
+  * indirection defines
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/X/import.h,v 2.1 1993/09/22 15:31:38 dawes Exp $
+  */
+ 
+ #ifndef _libX11_import
+ #define _libX11_import
+ #ifdef SVR3SHLIB
+ 
+ #define _ctype  (*_libX11__ctype)
+ #define _filbuf  (*_libX11__filbuf)
+ #define _flsbuf  (*_libX11__flsbuf)
+ #define _iob  (*_libX11__iob)
+ #define access  (*_libX11_access)
+ #define alarm  (*_libX11_alarm)
+ #define atoi  (*_libX11_atoi)
+ #define calloc  (*_libX11_calloc)
+ /* prevent name conflict with member close of XIM */
+ #define close(fd) (*_libX11_close)(fd)
+ #define connect  (*_libX11_connect)
+ #define errno  (*_libX11_errno)
+ #define exit  (*_libX11_exit)
+ #define fclose  (*_libX11_fclose)
+ #define fcntl  (*_libX11_fcntl)
+ #define fgets  (*_libX11_fgets)
+ #define fopen  (*_libX11_fopen)
+ #define fprintf  (*_libX11_fprintf)
+ #define fputs  (*_libX11_fputs)
+ #define fread  (*_libX11_fread)
+ /* prevent name conflict with member free of XFontSetMethods */
+ #define free(ptr) (*_libX11_free)(ptr)
+ #define fwrite  (*_libX11_fwrite)
+ #define getenv  (*_libX11_getenv)
+ #define gethostbyname  (*_libX11_gethostbyname)
+ #define uname  (*_libX11_uname)
+ #define getmsg  (*_libX11_getmsg)
+ #define getpid   (*_libX11_getpid)
+ #define getpwnam  (*_libX11_getpwnam)
+ #define getpwuid  (*_libX11_getpwuid)
+ #define getuid  (*_libX11_getuid)
+ #define grantpt  (*_libX11_grantpt)
+ #define htons  (*_libX11_htons)
+ #define inet_addr  (*_libX11_inet_addr)
+ #define ioctl  (*_libX11_ioctl)
+ #define malloc  (*_libX11_malloc)
+ #define memset  (*_libX11_memset)
+ #define ntohl  (*_libX11_ntohl)
+ #define ntohs  (*_libX11_ntohs)
+ #define open  (*_libX11_open)
+ #define ptsname  (*_libX11_ptsname)
+ #define putmsg  (*_libX11_putmsg)
+ #define qsort  (*_libX11_qsort)
+ #define read  (*_libX11_read)
+ #define realloc  (*_libX11_realloc)
+ #define rewind  (*_libX11_rewind)
+ /* prevent name conflict with bitfield select of _XtEventRec */
+ #define select(max, rd, wr, ex, to) (*_libX11_select)(max, rd, wr, ex, to)
+ #define setsockopt  (*_libX11_setsockopt)
+ #define signal  (*_libX11_signal)
+ #define sleep  (*_libX11_sleep)
+ #define socket  (*_libX11_socket)
+ #define sprintf  (*_libX11_sprintf)
+ #define sscanf  (*_libX11_sscanf)
+ /* prevent name conflict with struct stat */
+ #define stat(path, buf) (*_libX11_stat)(path, buf)
+ #define strcat  (*_libX11_strcat)
+ #define strchr  (*_libX11_strchr)
+ #define strcmp  (*_libX11_strcmp)
+ #define strcpy  (*_libX11_strcpy)
+ #define strncmp  (*_libX11_strncmp)
+ #define strncpy  (*_libX11_strncpy)
+ #define strrchr  (*_libX11_strrchr)
+ #define strtok (*_libX11_strtok)
+ #define sys_errlist  (*_libX11_sys_errlist)
+ #define sys_nerr  (*_libX11_sys_nerr)
+ #define tolower  (*_libX11_tolower)
+ #define unlockpt  (*_libX11_unlockpt)
+ #define write  (*_libX11_write)
+ #define writev  (*_libX11_writev)
+ #define XauDisposeAuth  (*_libX11_XauDisposeAuth)
+ #define XauFileName  (*_libX11_XauFileName)
+ #define XauGetBestAuthByAddr  (*_libX11_XauGetBestAuthByAddr)
+ #define XauReadAuth  (*_libX11_XauReadAuth)
+ /*
+ #define _Xevent_to_mask  (*_libX11__Xevent_to_mask)
+ */
+ 
+ /* for XDM authorization */
+ #define _XdmcpAuthSetup (*_libX11__XdmcpAuthSetup)
+ #define _XdmcpAuthDoIt (*_libX11__XdmcpAuthDoIt)
+ #define XdmcpWrap (*_libX11_XdmcpWrap)
+ 
+ #define getsockname (*_libX11_getsockname)
+ /* prevent name conflict */
+ #define time(tloc)  (*_libX11_time)(tloc)
+ 
+ 
+ /* Imported functions declarations
+  * Why declaring some imported functions here?
+  * This should be done gracefully through including of the systems
+  * header files. Unfortunatly there are some source files don't
+  * include all headers they should include, there are also some functions
+  * nowhere declared in the systems headers and some are declared
+  * without extern and cause problems since the names are redefined
+  * and these declarations then become undesired false pointer definitions.
+  */
+ 
+ /* <time.h> on ISC 2.2.1 doesn't declare time(2) for __STDC__
+  * so get time_t from it and declare it excplicit
+  */
+ #ifndef ATT
+ #include <time.h>
+ #endif
+ 
+ #ifdef __STDC__
+ #ifndef ATT
+ extern time_t time(time_t *);
+ #else
+ extern long time(time_t *);   /* gcc 2.3.3 seems to have problems */
+ #endif                        /* with typedefs on AT&T            */
+ extern int creat(char const *, unsigned short);
+ extern void exit(int);
+ #ifndef SCO
+ extern int sprintf(char *, char const *, ...);
+ extern int sscanf(char *, char const *, ...);
+ #else
+ extern int open();
+ extern int fcntl();
+ #ifndef SCO324
+ extern int uname();
+ #endif
+ #endif /* SCO */
+ extern int atoi(char const *);
+ extern int access(char const *, int);
+ extern unsigned int alarm(unsigned int);
+ extern unsigned int sleep(unsigned int);
+ extern int close(int);
+ #ifdef ISC32
+ extern int read(int, const char *, unsigned int);
+ #else
+ extern int read(int, char *, unsigned int);
+ #endif
+ extern int write(int, char const *, unsigned int);
+ extern int grantpt(int);
+ extern char *ptsname(int);
+ extern int unlockpt(int);
+ extern char *getenv(char const *);
+ extern short /*pid_t*/ getpid(void);
+ extern void XdmcpWrap(unsigned char *, unsigned char*, 
+ 		      unsigned char *, int);
+ #else /* ifndef __STDC__ */
+ #ifndef ATT
+ extern time_t time();    
+ #else
+ extern long time();     /* gcc 2.3.3 seems to have problems with */
+ #endif                  /* typedefs on AT&T                      */
+ extern int creat();
+ extern void exit();
+ #ifndef SCO
+ extern int sprintf();
+ extern int sscanf();
+ #else
+ extern int open();
+ extern int fcntl();
+ #ifndef SCO324
+ extern int uname();
+ #endif
+ #endif /* SCO */
+ extern int atoi();
+ extern int access();
+ extern unsigned int alarm();
+ extern unsigned int sleep();
+ extern int close();
+ extern int read();
+ extern int write();
+ extern int grantpt();
+ extern char *ptsname();
+ extern int unlockpt();
+ extern char *getenv();
+ extern short /*pid_t*/ getpid();
+ extern void XdmcpWrap();
+ #endif
+ 
+ /* use char * also for __STDC__, the sources want it */ 
+ extern char *malloc(), *realloc(), *calloc();
+ 
+ #include <string.h>
+ 
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ 
+ extern void qsort();
+ #ifndef ISC40
+ extern int _flsbuf();
+ extern int _filbuf();
+ #endif
+ extern int ioctl();
+ extern int getmsg();
+ extern int putmsg();
+ 
+ extern unsigned short ntohs(), htons();
+ extern unsigned long ntohl(), htonl();
+ extern unsigned long inet_addr();
+ extern int connect();
+ extern int gethostname();
+ extern int setsockopt();
+ extern int socket();
+ extern int writev();
+ extern int gettimeofday();
+ extern int getsockname();
+ 
+ extern _XdmcpAuthSetup(); 
+ extern _XdmcpAuthDoIt();
+ 
+ #if defined(ISC202) || defined(ATT)
+ extern int (*_libX11_stat)();
+ extern char (*_libX11_tolower)();
+ #endif
+ 
+ /* Functions with ambiguous names */
+ 
+ #ifdef __STDC__
+ extern int close(int);
+ extern void free(void *);
+ #include <sys/time.h>
+ #include <sys/bsdtypes.h>
+ #ifdef SCO
+ #include <sys/types.h>
+ #endif /* SCO */
+ extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+ #else
+ extern int (*_libX11_close)();
+ extern void (*_libX11_free)();
+ extern int (*_libX11_select)();
+ #endif
+ 
+ #endif
+ #endif
diff -c /dev/null mit/lib/X/jump_funcs:1.1
*** /dev/null	Sat Mar 12 00:37:20 1994
--- mit/lib/X/jump_funcs	Sat Mar 12 00:37:20 1994
***************
*** 0 ****
--- 1,787 ----
+ # $XFree86: mit/lib/X/jump_funcs,v 1.1 1993/04/16 14:20:01 dawes Exp $
+ #
+ 00000000 T _XSaveContext        libX11         Context
+ 00000000 T _XFindContext        libX11         Context
+ 00000000 T _XDeleteContext      libX11         Context
+ 00000000 T _XListDepths         libX11         Depths
+ 00000000 T _XrmParseCommand     libX11         ParseCmd
+ 00000000 T _Xpermalloc          libX11         Quarks
+ 00000000 T __XrmInternalStringToQuark libX11         Quarks
+ 00000000 T _XrmStringToQuark    libX11         Quarks
+ 00000000 T _XrmPermStringToQuark libX11         Quarks
+ 00000000 T _XrmUniqueQuark      libX11         Quarks
+ 00000000 T _XrmQuarkToString    libX11         Quarks
+ 00000000 T _XAllocColorCells    libX11         XAllCells
+ 00000000 T _XAllocColorPlanes   libX11         XAllPlanes
+ 00000000 T _XAllowEvents        libX11         XAllowEv
+ 00000000 T _XAutoRepeatOn       libX11         XAutoRep
+ 00000000 T _XAutoRepeatOff      libX11         XAutoRep
+ 00000000 T _XSetWindowBackground libX11         XBackgnd
+ 00000000 T _XSetWindowBorderWidth libX11         XBdrWidth
+ 00000000 T _XBell               libX11         XBell
+ 00000000 T _XSetWindowBorder    libX11         XBorder
+ 00000000 T _XEnableAccessControl libX11         XChAccCon
+ 00000000 T _XDisableAccessControl libX11         XChAccCon
+ 00000000 T _XSetAccessControl   libX11         XChAccCon
+ 00000000 T _XSetCloseDownMode   libX11         XChClMode
+ 00000000 T _XChangeActivePointerGrab libX11         XChActPGb
+ 00000000 T _XSetWindowColormap  libX11         XChCmap
+ 00000000 T _XChangeGC           libX11         XChGC
+ 00000000 T _XChangeKeyboardControl libX11         XChKeyCon
+ 00000000 T _XChangePointerControl libX11         XChPntCon
+ 00000000 T _XChangeProperty     libX11         XChProp
+ 00000000 T _XChangeSaveSet      libX11         XChSaveSet
+ 00000000 T _XAddToSaveSet       libX11         XChSaveSet
+ 00000000 T _XRemoveFromSaveSet  libX11         XChSaveSet
+ 00000000 T _XChangeWindowAttributes libX11         XChWAttrs
+ 00000000 T _XResizeWindow       libX11         XChWindow
+ 00000000 T _XCheckIfEvent       libX11         XChkIfEv
+ 00000000 T _XCheckMaskEvent     libX11         XChkMaskEv
+ 00000000 T _XCheckWindowEvent   libX11         XChkWinEv
+ 00000000 T _XCheckTypedEvent    libX11         XChkTypEv
+ 00000000 T _XCheckTypedWindowEvent libX11         XChkTypWEv
+ 00000000 T _XCirculateSubwindows libX11         XCirWin
+ 00000000 T _XCirculateSubwindowsDown libX11         XCirWinDn
+ 00000000 T _XCirculateSubwindowsUp libX11         XCirWinUp
+ 00000000 T _XCloseDisplay       libX11         XClDisplay
+ 00000000 T _XClearWindow        libX11         XClear
+ 00000000 T _XClearArea          libX11         XClearArea
+ 00000000 T _XMoveResizeWindow   libX11         XConfWind
+ 00000000 T __XConnectDisplay    libX11         XConnDis
+ 00000000 T __XDisconnectDisplay libX11         XConnDis
+ 00000000 T __XWaitForWritable   libX11         XConnDis
+ 00000000 T __XWaitForReadable   libX11         XConnDis
+ 00000000 T __XSendClientPrefix  libX11         XConnDis
+ 00000000 T _XSetAuthorization   libX11         XConnDis
+ 00000000 T _XConvertSelection   libX11         XConvSel
+ 00000000 T _XCopyArea           libX11         XCopyArea
+ 00000000 T _XCopyColormapAndFree libX11         XCopyCmap
+ 00000000 T _XCopyGC             libX11         XCopyGC
+ 00000000 T _XCopyPlane          libX11         XCopyPlane
+ 00000000 T _XCreateBitmapFromData libX11         XCrBFData
+ 00000000 T _XCreateColormap     libX11         XCrCmap
+ 00000000 T _XCreatePixmapCursor libX11         XCrCursor
+ 00000000 T _XCreateGC           libX11         XCrGC
+ 00000000 T __XUpdateGCCache     libX11         XCrGC
+ 00000000 T __XFlushGCCache      libX11         XCrGC
+ 00000000 T _XFlushGC            libX11         XCrGC
+ 00000000 T _XGContextFromGC     libX11         XCrGC
+ 00000000 T _XCreateGlyphCursor  libX11         XCrGlCur
+ 00000000 T _XCreatePixmapFromBitmapData libX11         XCrPFBData
+ 00000000 T _XCreatePixmap       libX11         XCrPixmap
+ 00000000 T _XCreateSimpleWindow libX11         XCrWindow
+ 00000000 T _XCreateFontCursor   libX11         XCursor
+ 00000000 T _XDefineCursor       libX11         XDefCursor
+ 00000000 T _XDeleteProperty     libX11         XDelProp
+ 00000000 T _XDestroySubwindows  libX11         XDestSubs
+ 00000000 T _XDestroyWindow      libX11         XDestWind
+ 00000000 T _XDisplayName        libX11         XDisName
+ 00000000 T _XDrawArc            libX11         XDrArc
+ 00000000 T _XDrawArcs           libX11         XDrArcs
+ 00000000 T _XDrawLine           libX11         XDrLine
+ 00000000 T _XDrawLines          libX11         XDrLines
+ 00000000 T _XDrawPoint          libX11         XDrPoint
+ 00000000 T _XDrawPoints         libX11         XDrPoints
+ 00000000 T _XDrawRectangle      libX11         XDrRect
+ 00000000 T _XDrawRectangles     libX11         XDrRects
+ 00000000 T _XDrawSegments       libX11         XDrSegs
+ 00000000 T _XGetErrorText       libX11         XErrDes
+ 00000000 T _XGetErrorDatabaseText libX11         XErrDes
+ 00000000 T _XSetErrorHandler    libX11         XErrHndlr
+ 00000000 T _XSetIOErrorHandler  libX11         XErrHndlr
+ 00000000 T __XEventToWire       libX11         XEvToWire
+ 00000000 T _XFetchName          libX11         XFetchName
+ 00000000 T _XGetIconName        libX11         XFetchName
+ 00000000 T _XFillArc            libX11         XFillArc
+ 00000000 T _XFillArcs           libX11         XFillArcs
+ 00000000 T _XFillPolygon        libX11         XFillPoly
+ 00000000 T _XFillRectangle      libX11         XFillRect
+ 00000000 T _XFillRectangles     libX11         XFillRects
+ 00000000 T _XFlush              libX11         XFlush
+ 00000000 T _XLoadQueryFont      libX11         XFont
+ 00000000 T _XFreeFont           libX11         XFont
+ 00000000 T _XQueryFont          libX11         XFont
+ 00000000 T _XListFonts          libX11         XFontNames
+ 00000000 T _XFreeFontNames      libX11         XFontNames
+ 00000000 T _XListFontsWithInfo  libX11         XFontInfo
+ 00000000 T _XFreeFontInfo       libX11         XFontInfo
+ 00000000 T _XFreeColormap       libX11         XFreeCmap
+ 00000000 T _XFreeColors         libX11         XFreeCols
+ 00000000 T _XFreeCursor         libX11         XFreeCurs
+ 00000000 T __XFreeExtData       libX11         XFreeEData
+ 00000000 T _XFreeGC             libX11         XFreeGC
+ 00000000 T _XFreePixmap         libX11         XFreePix
+ 00000000 T _XActivateScreenSaver libX11         XFSSaver
+ 00000000 T _XResetScreenSaver   libX11         XFSSaver
+ 00000000 T _XForceScreenSaver   libX11         XFSSaver
+ 00000000 T _XSetArcMode         libX11         XGCMisc
+ 00000000 T _XSetFillRule        libX11         XGCMisc
+ 00000000 T _XSetFillStyle       libX11         XGCMisc
+ 00000000 T _XSetGraphicsExposures libX11         XGCMisc
+ 00000000 T _XSetSubwindowMode   libX11         XGCMisc
+ 00000000 T _XGeometry           libX11         XGeom
+ 00000000 T _XGetAtomName        libX11         XGetAtomNm
+ 00000000 T _XAllocNamedColor    libX11         XGetColor
+ 00000000 T _XGetDefault         libX11         XGetDflt
+ 00000000 T _XGetFontPath        libX11         XGetFPath
+ 00000000 T _XFreeFontPath       libX11         XGetFPath
+ 00000000 T _XGetFontProperty    libX11         XGetFProp
+ 00000000 T _XGetGeometry        libX11         XGetGeom
+ 00000000 T _XAllocColor         libX11         XGetHColor
+ 00000000 T _XGetSizeHints       libX11         XGetHints
+ 00000000 T _XGetWMHints         libX11         XGetHints
+ 00000000 T _XGetZoomHints       libX11         XGetHints
+ 00000000 T _XGetNormalHints     libX11         XGetHints
+ 00000000 T _XGetIconSizes       libX11         XGetHints
+ 00000000 T _XGetCommand         libX11         XGetHints
+ 00000000 T _XGetTransientForHint libX11         XGetHints
+ 00000000 T _XGetClassHint       libX11         XGetHints
+ 00000000 T _XGetInputFocus      libX11         XGetIFocus
+ 00000000 T _XGetImage           libX11         XGetImage
+ 00000000 T _XGetSubImage        libX11         XGetImage
+ 00000000 T _XGetKeyboardControl libX11         XGetKCnt
+ 00000000 T _XGetMotionEvents    libX11         XGetMoEv
+ 00000000 T _XGetPointerControl  libX11         XGetPCnt
+ 00000000 T _XGetPointerMapping  libX11         XGetPntMap
+ 00000000 T _XGetKeyboardMapping libX11         XGetPntMap
+ 00000000 T _XGetWindowProperty  libX11         XGetProp
+ 00000000 T _XGetSelectionOwner  libX11         XGetSOwner
+ 00000000 T _XGetScreenSaver     libX11         XGetSSaver
+ 00000000 T _XGetStandardColormap libX11         XGetStCmap
+ 00000000 T _XGetWindowAttributes libX11         XGetWAttrs
+ 00000000 T _XGrabButton         libX11         XGrButton
+ 00000000 T _XGrabKey            libX11         XGrKey
+ 00000000 T _XGrabKeyboard       libX11         XGrKeybd
+ 00000000 T _XGrabPointer        libX11         XGrPointer
+ 00000000 T _XGrabServer         libX11         XGrServer
+ 00000000 T _XAddHost            libX11         XHost
+ 00000000 T _XRemoveHost         libX11         XHost
+ 00000000 T _XAddHosts           libX11         XHost
+ 00000000 T _XRemoveHosts        libX11         XHost
+ 00000000 T _XIfEvent            libX11         XIfEvent
+ 00000000 T __XGetScanlinePad    libX11         XImUtil
+ 00000000 T __XGetBitsPerPixel   libX11         XImUtil
+ 00000000 T _XCreateImage        libX11         XImUtil
+ 00000000 T __XSetImage          libX11         XImUtil
+ 00000000 T __XInitImageFuncPtrs libX11         XImUtil
+ 00000000 T _XDrawImageString    libX11         XImText
+ 00000000 T _XDrawImageString16  libX11         XImText16
+ 00000000 T _XInitExtension      libX11         XInitExt
+ 00000000 T _XAddExtension       libX11         XInitExt
+ 00000000 T _XEHeadOfExtensionList libX11         XInitExt
+ 00000000 T _XAddToExtensionList libX11         XInitExt
+ 00000000 T _XFindOnExtensionList libX11         XInitExt
+ 00000000 T _XESetCreateGC       libX11         XInitExt
+ 00000000 T _XESetCopyGC         libX11         XInitExt
+ 00000000 T _XESetFlushGC        libX11         XInitExt
+ 00000000 T _XESetFreeGC         libX11         XInitExt
+ 00000000 T _XESetCreateFont     libX11         XInitExt
+ 00000000 T _XESetFreeFont       libX11         XInitExt
+ 00000000 T _XESetCloseDisplay   libX11         XInitExt
+ 00000000 T _XESetWireToEvent    libX11         XInitExt
+ 00000000 T _XESetEventToWire    libX11         XInitExt
+ 00000000 T _XESetWireToError    libX11         XInitExt
+ 00000000 T _XESetError          libX11         XInitExt
+ 00000000 T _XESetErrorString    libX11         XInitExt
+ 00000000 T _XESetPrintErrorValues libX11         XInitExt
+ 00000000 T _XInstallColormap    libX11         XInsCmap
+ 00000000 T _XInternAtom         libX11         XIntAtom
+ 00000000 T _XKeycodeToKeysym    libX11         XKeyBind
+ 00000000 T _XKeysymToKeycode    libX11         XKeyBind
+ 00000000 T _XLookupKeysym       libX11         XKeyBind
+ 00000000 T _XRefreshKeyboardMapping libX11         XKeyBind
+ 00000000 T _XLookupString       libX11         XKeyBind
+ 00000000 T _XRebindKeysym       libX11         XKeyBind
+ 00000000 T _XKeysymToString     libX11         XKeysymStr
+ 00000000 T _XKillClient         libX11         XKillCl
+ 00000000 T _XListHosts          libX11         XLiHosts
+ 00000000 T _XListInstalledColormaps libX11         XLiICmaps
+ 00000000 T _XListProperties     libX11         XLiProps
+ 00000000 T _XListExtensions     libX11         XListExt
+ 00000000 T _XFreeExtensionList  libX11         XListExt
+ 00000000 T _XLoadFont           libX11         XLoadFont
+ 00000000 T _XLookupColor        libX11         XLookupCol
+ 00000000 T _XLowerWindow        libX11         XLowerWin
+ 00000000 T _XConnectionNumber   libX11         XMacros
+ 00000000 T _XRootWindow         libX11         XMacros
+ 00000000 T _XDefaultScreen      libX11         XMacros
+ 00000000 T _XDefaultRootWindow  libX11         XMacros
+ 00000000 T _XDefaultVisual      libX11         XMacros
+ 00000000 T _XDefaultGC          libX11         XMacros
+ 00000000 T _XBlackPixel         libX11         XMacros
+ 00000000 T _XWhitePixel         libX11         XMacros
+ 00000000 T _XAllPlanes          libX11         XMacros
+ 00000000 T _XQLength            libX11         XMacros
+ 00000000 T _XDisplayWidth       libX11         XMacros
+ 00000000 T _XDisplayHeight      libX11         XMacros
+ 00000000 T _XDisplayWidthMM     libX11         XMacros
+ 00000000 T _XDisplayHeightMM    libX11         XMacros
+ 00000000 T _XDisplayPlanes      libX11         XMacros
+ 00000000 T _XDisplayCells       libX11         XMacros
+ 00000000 T _XScreenCount        libX11         XMacros
+ 00000000 T _XServerVendor       libX11         XMacros
+ 00000000 T _XProtocolVersion    libX11         XMacros
+ 00000000 T _XProtocolRevision   libX11         XMacros
+ 00000000 T _XVendorRelease      libX11         XMacros
+ 00000000 T _XDisplayString      libX11         XMacros
+ 00000000 T _XDefaultDepth       libX11         XMacros
+ 00000000 T _XDefaultColormap    libX11         XMacros
+ 00000000 T _XBitmapUnit         libX11         XMacros
+ 00000000 T _XBitmapBitOrder     libX11         XMacros
+ 00000000 T _XBitmapPad          libX11         XMacros
+ 00000000 T _XImageByteOrder     libX11         XMacros
+ 00000000 T _XNextRequest        libX11         XMacros
+ 00000000 T _XLastKnownRequestProcessed libX11         XMacros
+ 00000000 T _XScreenOfDisplay    libX11         XMacros
+ 00000000 T _XDefaultScreenOfDisplay libX11         XMacros
+ 00000000 T _XDisplayOfScreen    libX11         XMacros
+ 00000000 T _XRootWindowOfScreen libX11         XMacros
+ 00000000 T _XBlackPixelOfScreen libX11         XMacros
+ 00000000 T _XWhitePixelOfScreen libX11         XMacros
+ 00000000 T _XDefaultColormapOfScreen libX11         XMacros
+ 00000000 T _XDefaultDepthOfScreen libX11         XMacros
+ 00000000 T _XDefaultGCOfScreen  libX11         XMacros
+ 00000000 T _XDefaultVisualOfScreen libX11         XMacros
+ 00000000 T _XWidthOfScreen      libX11         XMacros
+ 00000000 T _XHeightOfScreen     libX11         XMacros
+ 00000000 T _XWidthMMOfScreen    libX11         XMacros
+ 00000000 T _XHeightMMOfScreen   libX11         XMacros
+ 00000000 T _XPlanesOfScreen     libX11         XMacros
+ 00000000 T _XCellsOfScreen      libX11         XMacros
+ 00000000 T _XMinCmapsOfScreen   libX11         XMacros
+ 00000000 T _XMaxCmapsOfScreen   libX11         XMacros
+ 00000000 T _XDoesSaveUnders     libX11         XMacros
+ 00000000 T _XDoesBackingStore   libX11         XMacros
+ 00000000 T _XEventMaskOfScreen  libX11         XMacros
+ 00000000 T _XScreenNumberOfScreen libX11         XMacros
+ 00000000 T _XDestroyImage       libX11         XMacros
+ 00000000 T _XGetPixel           libX11         XMacros
+ 00000000 T _XPutPixel           libX11         XMacros
+ 00000000 T _XSubImage           libX11         XMacros
+ 00000000 T _XAddPixel           libX11         XMacros
+ 00000000 T _XNoOp               libX11         XMacros
+ 00000000 T _XMapRaised          libX11         XMapRaised
+ 00000000 T _XMapSubwindows      libX11         XMapSubs
+ 00000000 T _XMapWindow          libX11         XMapWindow
+ 00000000 T _XMaskEvent          libX11         XMaskEvent
+ 00000000 T _XMaxRequestSize     libX11         XMisc
+ 00000000 T _XResourceManagerString libX11         XMisc
+ 00000000 T _XDisplayMotionBufferSize libX11         XMisc
+ 00000000 T _XDisplayKeycodes    libX11         XMisc
+ 00000000 T _XVisualIDFromVisual libX11         XMisc
+ 00000000 T _XGetModifierMapping libX11         XModMap
+ 00000000 T _XSetModifierMapping libX11         XModMap
+ 00000000 T _XNewModifiermap     libX11         XModMap
+ 00000000 T _XFreeModifiermap    libX11         XModMap
+ 00000000 T _XInsertModifiermapEntry libX11         XModMap
+ 00000000 T _XDeleteModifiermapEntry libX11         XModMap
+ 00000000 T _XMoveWindow         libX11         XMoveWin
+ 00000000 T _XNextEvent          libX11         XNextEvent
+ 00000000 T _XOpenDisplay        libX11         XOpenDis
+ 00000000 T __XFreeDisplayStructure libX11         XOpenDis
+ 00000000 T _XParseColor         libX11         XParseCol
+ 00000000 T _XParseGeometry      libX11         XParseGeom
+ 00000000 T _XPeekEvent          libX11         XPeekEvent
+ 00000000 T _XPeekIfEvent        libX11         XPeekIfEv
+ 00000000 T _XEventsQueued       libX11         XPending
+ 00000000 T _XPending            libX11         XPending
+ 00000000 T _XSetWindowBackgroundPixmap libX11         XPmapBgnd
+ 00000000 T _XSetWindowBorderPixmap libX11         XPmapBord
+ 00000000 T _XPolygonRegion      libX11         XPolyReg
+ 00000000 T _XDrawText           libX11         XPolyTxt
+ 00000000 T _XDrawText16         libX11         XPolyTxt16
+ 00000000 T _XPutBackEvent       libX11         XPutBEvent
+ 00000000 T __XReverse_Bytes     libX11         XPutImage
+ 00000000 T _XPutImage           libX11         XPutImage
+ 00000000 T _XQueryBestSize      libX11         XQuBest
+ 00000000 T _XQueryColor         libX11         XQuColor
+ 00000000 T _XQueryColors        libX11         XQuColors
+ 00000000 T _XQueryBestCursor    libX11         XQuCurShp
+ 00000000 T _XQueryExtension     libX11         XQuExt
+ 00000000 T _XQueryKeymap        libX11         XQuKeybd
+ 00000000 T _XQueryPointer       libX11         XQuPntr
+ 00000000 T _XQueryBestStipple   libX11         XQuStipShp
+ 00000000 T _XQueryTextExtents16 libX11         XQuTextE16
+ 00000000 T _XQueryTextExtents   libX11         XQuTextExt
+ 00000000 T _XQueryBestTile      libX11         XQuTileShp
+ 00000000 T _XQueryTree          libX11         XQuTree
+ 00000000 T _XRaiseWindow        libX11         XRaiseWin
+ 00000000 T _XReadBitmapFile     libX11         XRdBitF
+ 00000000 T _XRecolorCursor      libX11         XRecolorC
+ 00000000 T _XConfigureWindow    libX11         XReconfWin
+ 00000000 T _XCreateRegion       libX11         XRegion
+ 00000000 T _XClipBox            libX11         XRegion
+ 00000000 T _XUnionRectWithRegion libX11         XRegion
+ 00000000 T _XSetRegion          libX11         XRegion
+ 00000000 T _XDestroyRegion      libX11         XRegion
+ 00000000 T _XOffsetRegion       libX11         XRegion
+ 00000000 T _XShrinkRegion       libX11         XRegion
+ 00000000 T _XIntersectRegion    libX11         XRegion
+ 00000000 T _XUnionRegion        libX11         XRegion
+ 00000000 T _XSubtractRegion     libX11         XRegion
+ 00000000 T _XXorRegion          libX11         XRegion
+ 00000000 T _XEmptyRegion        libX11         XRegion
+ 00000000 T _XEqualRegion        libX11         XRegion
+ 00000000 T _XPointInRegion      libX11         XRegion
+ 00000000 T _XRectInRegion       libX11         XRegion
+ 00000000 T _XReparentWindow     libX11         XRepWindow
+ 00000000 T _XRestackWindows     libX11         XRestackWs
+ 00000000 T _XRotateWindowProperties libX11         XRotProp
+ 00000000 T _XScreenResourceString libX11         XScrResStr
+ 00000000 T _XSelectInput        libX11         XSelInput
+ 00000000 T _XSendEvent          libX11         XSendEvent
+ 00000000 T _XSetBackground      libX11         XSetBack
+ 00000000 T _XSetClipRectangles  libX11         XSetCRects
+ 00000000 T __XSetClipRectangles libX11         XSetCRects
+ 00000000 T _XSetClipMask        libX11         XSetClMask
+ 00000000 T _XSetClipOrigin      libX11         XSetClOrig
+ 00000000 T _XSetDashes          libX11         XSetDashes
+ 00000000 T _XSetFontPath        libX11         XSetFPath
+ 00000000 T _XSetFont            libX11         XSetFont
+ 00000000 T _XSetForeground      libX11         XSetFore
+ 00000000 T _XSetFunction        libX11         XSetFunc
+ 00000000 T _XSetSizeHints       libX11         XSetHints
+ 00000000 T _XSetWMHints         libX11         XSetHints
+ 00000000 T _XSetZoomHints       libX11         XSetHints
+ 00000000 T _XSetNormalHints     libX11         XSetHints
+ 00000000 T _XSetIconSizes       libX11         XSetHints
+ 00000000 T _XSetCommand         libX11         XSetHints
+ 00000000 T _XSetStandardProperties libX11         XSetHints
+ 00000000 T _XSetTransientForHint libX11         XSetHints
+ 00000000 T _XSetClassHint       libX11         XSetHints
+ 00000000 T _XSetInputFocus      libX11         XSetIFocus
+ 00000000 T _XSetLineAttributes  libX11         XSetLStyle
+ 00000000 T _XSetPlaneMask       libX11         XSetPMask
+ 00000000 T _XSetPointerMapping  libX11         XSetPntMap
+ 00000000 T _XChangeKeyboardMapping libX11         XSetPntMap
+ 00000000 T _XSetSelectionOwner  libX11         XSetSOwner
+ 00000000 T _XSetScreenSaver     libX11         XSetSSaver
+ 00000000 T _XSetState           libX11         XSetState
+ 00000000 T _XSetStipple         libX11         XSetStip
+ 00000000 T _XSetStandardColormap libX11         XSetStCmap
+ 00000000 T _XSetTile            libX11         XSetTile
+ 00000000 T _XSetTSOrigin        libX11         XSetTSOrig
+ 00000000 T _XRotateBuffers      libX11         XStBytes
+ 00000000 T _XFetchBuffer        libX11         XStBytes
+ 00000000 T _XFetchBytes         libX11         XStBytes
+ 00000000 T _XStoreBuffer        libX11         XStBytes
+ 00000000 T _XStoreBytes         libX11         XStBytes
+ 00000000 T _XStoreColor         libX11         XStColor
+ 00000000 T _XStoreColors        libX11         XStColors
+ 00000000 T _XStoreNamedColor    libX11         XStNColor
+ 00000000 T _XStoreName          libX11         XStName
+ 00000000 T _XSetIconName        libX11         XStName
+ 00000000 T __XInitKeysymDB      libX11         XStrKeysym
+ 00000000 T _XStringToKeysym     libX11         XStrKeysym
+ 00000000 T _XSync               libX11         XSync
+ 00000000 T __XSyncFunction      libX11         XSynchro
+ 00000000 T _XSynchronize        libX11         XSynchro
+ 00000000 T _XSetAfterFunction   libX11         XSynchro
+ 00000000 T _XDrawString         libX11         XText
+ 00000000 T _XDrawString16       libX11         XText16
+ 00000000 T _XTextExtents        libX11         XTextExt
+ 00000000 T _XTextWidth          libX11         XTextExt
+ 00000000 T _XTextExtents16      libX11         XTextExt16
+ 00000000 T _XTextWidth16        libX11         XTextExt16
+ 00000000 T _XTranslateCoordinates libX11         XTrCoords
+ 00000000 T _XUndefineCursor     libX11         XUndefCurs
+ 00000000 T _XUngrabButton       libX11         XUngrabBut
+ 00000000 T _XUngrabKeyboard     libX11         XUngrabKbd
+ 00000000 T _XUngrabKey          libX11         XUngrabKey
+ 00000000 T _XUngrabPointer      libX11         XUngrabPtr
+ 00000000 T _XUngrabServer       libX11         XUngrabSvr
+ 00000000 T _XUninstallColormap  libX11         XUninsCmap
+ 00000000 T _XUnloadFont         libX11         XUnldFont
+ 00000000 T _XUnmapSubwindows    libX11         XUnmapSubs
+ 00000000 T _XUnmapWindow        libX11         XUnmapWin
+ 00000000 T _XGetVisualInfo      libX11         XVisUtil
+ 00000000 T _XMatchVisualInfo    libX11         XVisUtil
+ 00000000 T _XWarpPointer        libX11         XWarpPtr
+ 00000000 T _XWindowEvent        libX11         XWinEvent
+ 00000000 T _XCreateWindow       libX11         XWindow
+ 00000000 T __XProcessWindowAttributes libX11         XWindow
+ 00000000 T _XWriteBitmapFile    libX11         XWrBitF
+ 00000000 T __XFlush             libX11         XlibInt
+ 00000000 T __XEventsQueued      libX11         XlibInt
+ 00000000 T __XReadEvents        libX11         XlibInt
+ 00000000 T __XRead              libX11         XlibInt
+ 00000000 T __XReadPad           libX11         XlibInt
+ 00000000 T __XSend              libX11         XlibInt
+ 00000000 T __XAllocID           libX11         XlibInt
+ 00000000 T __XSetLastRequestRead libX11         XlibInt
+ 00000000 T __XReply             libX11         XlibInt
+ 00000000 T __XEatData           libX11         XlibInt
+ 00000000 T __XEnq               libX11         XlibInt
+ 00000000 T __XUnknownWireEvent  libX11         XlibInt
+ 00000000 T __XUnknownNativeEvent libX11         XlibInt
+ 00000000 T __XWireToEvent       libX11         XlibInt
+ 00000000 T __XDefaultIOError    libX11         XlibInt
+ 00000000 T __XDefaultError      libX11         XlibInt
+ 00000000 T __XDefaultWireError  libX11         XlibInt
+ 00000000 T __XError             libX11         XlibInt
+ 00000000 T __XIOError           libX11         XlibInt
+ 00000000 T __XAllocScratch      libX11         XlibInt
+ 00000000 T __XVIDtoVisual       libX11         XlibInt
+ 00000000 T _XFree               libX11         XlibInt
+ 00000000 T __XFreeQ             libX11         XlibInt
+ 00000000 T __XGetHostname       libX11         XlibInt
+ 00000000 T __XScreenOfWindow    libX11         XlibInt
+ 00000000 T __XANYSET            libX11         XlibInt
+ 00000000 T _XrmInitialize       libX11         Xrm
+ 00000000 T _XrmGetDatabase      libX11         Xrm
+ 00000000 T _XrmSetDatabase      libX11         Xrm
+ 00000000 T _XrmStringToQuarkList libX11         Xrm
+ 00000000 T _XrmStringToBindingQuarkList libX11         Xrm
+ 00000000 T _XrmCombineDatabase  libX11         Xrm
+ 00000000 T _XrmMergeDatabases   libX11         Xrm
+ 00000000 T _XrmQPutResource     libX11         Xrm
+ 00000000 T _XrmPutResource      libX11         Xrm
+ 00000000 T _XrmQPutStringResource libX11         Xrm
+ 00000000 T _XrmPutStringResource libX11         Xrm
+ 00000000 T _XrmPutLineResource  libX11         Xrm
+ 00000000 T _XrmGetStringDatabase libX11         Xrm
+ 00000000 T _XrmGetFileDatabase  libX11         Xrm
+ 00000000 T _XrmCombineFileDatabase libX11         Xrm
+ 00000000 T _XrmEnumerateDatabase libX11         Xrm
+ 00000000 T _XrmPutFileDatabase  libX11         Xrm
+ 00000000 T _XrmQGetSearchList   libX11         Xrm
+ 00000000 T _XrmQGetSearchResource libX11         Xrm
+ 00000000 T _XrmQGetResource     libX11         Xrm
+ 00000000 T _XrmGetResource      libX11         Xrm
+ 00000000 T _XrmLocaleOfDatabase libX11         Xrm
+ 00000000 T _XrmDestroyDatabase  libX11         Xrm
+ 00000000 T _XGetGCValues        libX11         GetGCVals
+ 00000000 T _XGetWMSizeHints     libX11         GetNrmHint
+ 00000000 T _XGetWMNormalHints   libX11         GetNrmHint
+ 00000000 T _XGetRGBColormaps    libX11         GetRGBCMap
+ 00000000 T _XGetTextProperty    libX11         GetTxtProp
+ 00000000 T _XGetWMName          libX11         GetTxtProp
+ 00000000 T _XGetWMIconName      libX11         GetTxtProp
+ 00000000 T _XGetWMClientMachine libX11         GetTxtProp
+ 00000000 T _XGetWMColormapWindows libX11         GetWMCMapW
+ 00000000 T _XGetWMProtocols     libX11         GetWMProto
+ 00000000 T _XIconifyWindow      libX11         Iconify
+ 00000000 T _XListPixmapFormats  libX11         PixFormats
+ 00000000 T _XAllocSizeHints     libX11         PropAlloc
+ 00000000 T _XAllocStandardColormap libX11         PropAlloc
+ 00000000 T _XAllocWMHints       libX11         PropAlloc
+ 00000000 T _XAllocClassHint     libX11         PropAlloc
+ 00000000 T _XAllocIconSize      libX11         PropAlloc
+ 00000000 T _XReconfigureWMWindow libX11         ReconfWM
+ 00000000 T _XSetWMSizeHints     libX11         SetNrmHint
+ 00000000 T _XSetWMNormalHints   libX11         SetNrmHint
+ 00000000 T _XSetRGBColormaps    libX11         SetRGBCMap
+ 00000000 T _XSetTextProperty    libX11         SetTxtProp
+ 00000000 T _XSetWMName          libX11         SetTxtProp
+ 00000000 T _XSetWMIconName      libX11         SetTxtProp
+ 00000000 T _XSetWMClientMachine libX11         SetTxtProp
+ 00000000 T _XSetWMColormapWindows libX11         SetWMCMapW
+ 00000000 T _XSetWMProperties    libX11         SetWMProps
+ 00000000 T _XSetWMProtocols     libX11         SetWMProto
+ 00000000 T _XStringListToTextProperty libX11         StrToText
+ 00000000 T _XTextPropertyToStringList libX11         TextToStr
+ 00000000 T _XFreeStringList     libX11         TextToStr
+ 00000000 T _XWMGeometry         libX11         WMGeom
+ 00000000 T _XWithdrawWindow     libX11         Withdraw
+ 00000000 T _XauDisposeAuth      libX11         AuDispose
+ 00000000 T _XauGetBestAuthByAddr libX11         AuGetBest
+ 00000000 T _XauFileName         libX11         AuFileName
+ 00000000 T _XauReadAuth         libX11         AuRead
+ 00000000 T _XcmsCIELab_ValidSpec libX11         CIELab
+ 00000000 T _XcmsCIELabToCIEXYZ  libX11         CIELab
+ 00000000 T _XcmsCIEXYZToCIELab  libX11         CIELab
+ 00000000 T _XcmsCIELabClipab    libX11         CIELabGcC
+ 00000000 T _XcmsCIELabClipL     libX11         CIELabGcL
+ 00000000 T _XcmsCIELabClipLab   libX11         CIELabGcLC
+ 00000000 T _XcmsCIELabQueryMinL libX11         CIELabMnL
+ 00000000 T _XcmsCIELabQueryMaxC libX11         CIELabMxC
+ 00000000 T _XcmsCIELabQueryMaxL libX11         CIELabMxL
+ 00000000 T __XcmsCIELabQueryMaxLCRGB libX11         CIELabMxLC
+ 00000000 T _XcmsCIELabQueryMaxLC libX11         CIELabMxLC
+ 00000000 T _XcmsCIELabWhiteShiftColors libX11         CIELabWpAj
+ 00000000 T _XcmsCIELuv_ValidSpec libX11         CIELuv
+ 00000000 T _XcmsCIELuvToCIEuvY  libX11         CIELuv
+ 00000000 T _XcmsCIEuvYToCIELuv  libX11         CIELuv
+ 00000000 T _XcmsCIELuvClipuv    libX11         CIELuvGcC
+ 00000000 T _XcmsCIELuvClipL     libX11         CIELuvGcL
+ 00000000 T _XcmsCIELuvClipLuv   libX11         CIELuvGcLC
+ 00000000 T _XcmsCIELuvQueryMinL libX11         CIELuvMnL
+ 00000000 T _XcmsCIELuvQueryMaxC libX11         CIELuvMxC
+ 00000000 T _XcmsCIELuvQueryMaxL libX11         CIELuvMxL
+ 00000000 T __XcmsCIELuvQueryMaxLCRGB libX11         CIELuvMxLC
+ 00000000 T _XcmsCIELuvQueryMaxLC libX11         CIELuvMxLC
+ 00000000 T _XcmsCIELuvWhiteShiftColors libX11         CIELuvWpAj
+ 00000000 T _XcmsCIEXYZ_ValidSpec libX11         CIEXYZ
+ 00000000 T _XcmsCIEuvY_ValidSpec libX11         CIEuvY
+ 00000000 T _XcmsCIEuvYToCIEXYZ  libX11         CIEuvY
+ 00000000 T _XcmsCIEXYZToCIEuvY  libX11         CIEuvY
+ 00000000 T _XcmsCIExyY_ValidSpec libX11         CIExyY
+ 00000000 T _XcmsCIExyYToCIEXYZ  libX11         CIExyY
+ 00000000 T _XcmsCIEXYZToCIExyY  libX11         CIExyY
+ 00000000 T _XcmsTekHVC_ValidSpec libX11         TekHVC
+ 00000000 T _XcmsTekHVCToCIEuvY  libX11         TekHVC
+ 00000000 T _XcmsCIEuvYToTekHVC  libX11         TekHVC
+ 00000000 T __XcmsTekHVC_CheckModify libX11         TekHVC
+ 00000000 T _XcmsTekHVCClipC     libX11         TekHVCGcC
+ 00000000 T _XcmsTekHVCClipV     libX11         TekHVCGcV
+ 00000000 T _XcmsTekHVCClipVC    libX11         TekHVCGcVC
+ 00000000 T _XcmsTekHVCQueryMinV libX11         TekHVCMnV
+ 00000000 T _XcmsTekHVCQueryMaxC libX11         TekHVCMxC
+ 00000000 T _XcmsTekHVCQueryMaxV libX11         TekHVCMxV
+ 00000000 T __XcmsTekHVCQueryMaxVCRGB libX11         TekHVCMxVC
+ 00000000 T _XcmsTekHVCQueryMaxVC libX11         TekHVCMxVC
+ 00000000 T _XcmsTekHVCQueryMaxVSamples libX11         TekHVCMxVs
+ 00000000 T _XcmsTekHVCWhiteShiftColors libX11         TekHVCWpAj
+ 00000000 T _XcmsAddColorSpace   libX11         XcmsAddDIC
+ 00000000 T _XcmsAddFunctionSet  libX11         XcmsAddSF
+ 00000000 T _XcmsAllocNamedColor libX11         XcmsAlNCol
+ 00000000 T _XcmsAllocColor      libX11         XcmsAllCol
+ 00000000 T _XcmsCreateCCC       libX11         XcmsCCC
+ 00000000 T _XcmsDefaultCCC      libX11         XcmsCCC
+ 00000000 T _XcmsFreeCCC         libX11         XcmsCCC
+ 00000000 T __XcmsAddCmapRec     libX11         XcmsCmap
+ 00000000 T __XcmsCopyCmapRecAndFree libX11         XcmsCmap
+ 00000000 T __XcmsDeleteCmapRec  libX11         XcmsCmap
+ 00000000 T _XcmsCCCOfColormap   libX11         XcmsCmap
+ 00000000 T _XcmsFreeColorDB     libX11         XcmsColNm
+ 00000000 T __XcmsCopyISOLatin1Lowered libX11         XcmsColNm
+ 00000000 T __XcmsResolveColorString libX11         XcmsColNm
+ 00000000 T __XcmsConvertColorsWithWhitePt libX11         XcmsCvColW
+ 00000000 T __XcmsEqualWhitePts  libX11         XcmsCvCols
+ 00000000 T __XcmsDIConvertColors libX11         XcmsCvCols
+ 00000000 T __XcmsDDConvertColors libX11         XcmsCvCols
+ 00000000 T _XcmsConvertColors   libX11         XcmsCvCols
+ 00000000 T __XcmsRegFormatOfPrefix libX11         XcmsCvCols
+ 00000000 T _XcmsFormatOfPrefix  libX11         XcmsIdOfPr
+ 00000000 T __XcmsCopyPointerArray libX11         XcmsInt
+ 00000000 T __XcmsFreePointerArray libX11         XcmsInt
+ 00000000 T __XcmsPushPointerArray libX11         XcmsInt
+ 00000000 T __XcmsInitDefaultCCCs libX11         XcmsInt
+ 00000000 T __XcmsInitScrnInfo   libX11         XcmsInt
+ 00000000 T __XcmsFreeIntensityMaps libX11         XcmsInt
+ 00000000 T __XcmsGetIntensityMap libX11         XcmsInt
+ 00000000 T __XcmsGetTableType0  libX11         XcmsLRGB
+ 00000000 T __XcmsGetTableType1  libX11         XcmsLRGB
+ 00000000 T __XcmsValueCmp       libX11         XcmsLRGB
+ 00000000 T __XcmsIntensityCmp   libX11         XcmsLRGB
+ 00000000 T __XcmsValueInterpolation libX11         XcmsLRGB
+ 00000000 T __XcmsIntensityInterpolation libX11         XcmsLRGB
+ 00000000 T __XcmsTableSearch    libX11         XcmsLRGB
+ 00000000 T __XcmsMatVec         libX11         XcmsLRGB
+ 00000000 T _XcmsLRGB_RGB_ParseString libX11         XcmsLRGB
+ 00000000 T _XcmsLRGB_RGBi_ParseString libX11         XcmsLRGB
+ 00000000 T _XcmsCIEXYZToRGBi    libX11         XcmsLRGB
+ 00000000 T _XcmsRGBiToCIEXYZ    libX11         XcmsLRGB
+ 00000000 T _XcmsRGBiToRGB       libX11         XcmsLRGB
+ 00000000 T _XcmsRGBToRGBi       libX11         XcmsLRGB
+ 00000000 T __XcmsLRGB_InitScrnDefault libX11         XcmsLRGB
+ 00000000 T _XcmsLookupColor     libX11         XcmsLkCol
+ 00000000 T __XcmsCubeRoot       libX11         XcmsMath
+ 00000000 T __XcmsSquareRoot     libX11         XcmsMath
+ 00000000 T _XcmsDisplayOfCCC    libX11         XcmsOfCCC
+ 00000000 T _XcmsVisualOfCCC     libX11         XcmsOfCCC
+ 00000000 T _XcmsScreenNumberOfCCC libX11         XcmsOfCCC
+ 00000000 T _XcmsScreenWhitePointOfCCC libX11         XcmsOfCCC
+ 00000000 T _XcmsClientWhitePointOfCCC libX11         XcmsOfCCC
+ 00000000 T _XcmsPrefixOfFormat  libX11         XcmsPrOfId
+ 00000000 T __XcmsGetElement     libX11         XcmsProp
+ 00000000 T __XcmsGetProperty    libX11         XcmsProp
+ 00000000 T _XcmsQueryBlack      libX11         XcmsQBlack
+ 00000000 T _XcmsQueryBlue       libX11         XcmsQBlue
+ 00000000 T _XcmsQueryGreen      libX11         XcmsQGreen
+ 00000000 T _XcmsQueryRed        libX11         XcmsQRed
+ 00000000 T _XcmsQueryWhite      libX11         XcmsQWhite
+ 00000000 T _XcmsQueryColor      libX11         XcmsQuCol
+ 00000000 T _XcmsQueryColors     libX11         XcmsQuCols
+ 00000000 T _XcmsSetWhitePoint   libX11         XcmsSetCCC
+ 00000000 T _XcmsSetCompressionProc libX11         XcmsSetCCC
+ 00000000 T _XcmsSetWhiteAdjustProc libX11         XcmsSetCCC
+ 00000000 T __XcmsSetGetColors   libX11         XcmsSetGet
+ 00000000 T _XcmsStoreColor      libX11         XcmsStCol
+ 00000000 T _XcmsStoreColors     libX11         XcmsStCols
+ 00000000 T __XcmsCosine         libX11         XcmsTrig
+ 00000000 T __XcmsSine           libX11         XcmsTrig
+ 00000000 T __XcmsArcTangent     libX11         XcmsTrig
+ 00000000 T __XcmsRGB_to_XColor  libX11         XcmsXRGB
+ 00000000 T __XColor_to_XcmsRGB  libX11         XcmsXRGB
+ 00000000 T __XcmsResolveColor   libX11         XcmsXRGB
+ 00000000 T __XcmsUnresolveColor libX11         XcmsXRGB
+ 00000000 T __XUnresolveColor    libX11         XcmsXRGB
+ 00000000 T __XParseBaseFontNameList libX11         XFSWrap
+ 00000000 T _XCreateFontSet      libX11         XFSWrap
+ 00000000 T _XFontsOfFontSet     libX11         XFSWrap
+ 00000000 T _XBaseFontNameListOfFontSet libX11         XFSWrap
+ 00000000 T _XLocaleOfFontSet    libX11         XFSWrap
+ 00000000 T _XContextDependentDrawing libX11         XFSWrap
+ 00000000 T _XExtentsOfFontSet   libX11         XFSWrap
+ 00000000 T _XFreeFontSet        libX11         XFSWrap
+ 00000000 T _XVaCreateNestedList libX11         XICWrap
+ 00000000 T _XGetIMValues        libX11         XICWrap
+ 00000000 T _XCreateIC           libX11         XICWrap
+ 00000000 T _XDestroyIC          libX11         XICWrap
+ 00000000 T _XGetICValues        libX11         XICWrap
+ 00000000 T _XSetICValues        libX11         XICWrap
+ 00000000 T _XSetICFocus         libX11         XICWrap
+ 00000000 T _XUnsetICFocus       libX11         XICWrap
+ 00000000 T _XIMOfIC             libX11         XICWrap
+ 00000000 T _XmbResetIC          libX11         XICWrap
+ 00000000 T _XwcResetIC          libX11         XICWrap
+ 00000000 T _XmbLookupString     libX11         XICWrap
+ 00000000 T _XwcLookupString     libX11         XICWrap
+ 00000000 T __XIMCompileResourceList libX11         XIMWrap
+ 00000000 T __XCopyToArg         libX11         XIMWrap
+ 00000000 T _XOpenIM             libX11         XIMWrap
+ 00000000 T _XCloseIM            libX11         XIMWrap
+ 00000000 T _XDisplayOfIM        libX11         XIMWrap
+ 00000000 T _XLocaleOfIM         libX11         XIMWrap
+ 00000000 T _XSetLocaleModifiers libX11         XlcWrap
+ 00000000 T _XSupportsLocale     libX11         XlcWrap
+ 00000000 T __XlcValidModSyntax  libX11         XlcWrap
+ 00000000 T __XlcDefaultMapModifiers libX11         XlcWrap
+ 00000000 T __XlcAddLoader       libX11         XlcWrap
+ 00000000 T __XlcCurrentLC       libX11         XlcWrap
+ 00000000 T _XmbSetWMProperties  libX11         XmbWMProps
+ 00000000 T _XmbDrawText         libX11         XmbWrap
+ 00000000 T _XmbDrawString       libX11         XmbWrap
+ 00000000 T _XmbDrawImageString  libX11         XmbWrap
+ 00000000 T _XmbTextEscapement   libX11         XmbWrap
+ 00000000 T _XmbTextExtents      libX11         XmbWrap
+ 00000000 T _XmbTextPerCharExtents libX11         XmbWrap
+ 00000000 T _XwcDrawText         libX11         XwcWrap
+ 00000000 T _XwcDrawString       libX11         XwcWrap
+ 00000000 T _XwcDrawImageString  libX11         XwcWrap
+ 00000000 T _XwcTextEscapement   libX11         XwcWrap
+ 00000000 T _XwcTextExtents      libX11         XwcWrap
+ 00000000 T _XwcTextPerCharExtents libX11         XwcWrap
+ 00000000 T _XFilterEvent        libX11         XFilterEv
+ 00000000 T __XRegisterFilterByMask libX11         XRegstFlt
+ 00000000 T __XRegisterFilterByType libX11         XRegstFlt
+ 00000000 T __XUnregisterFilter  libX11         XRegstFlt
+ 00000000 T __XlcMapOSLocaleName libX11         XSetLocale
+ 00000000 T __XipSetICFocus      libX11         XICFocus
+ 00000000 T __XipUnsetICFocus    libX11         XICFocus
+ 00000000 T __XipICGetValues     libX11         XICGetVal
+ 00000000 T __XipReceiveICValues libX11         XICGetVal
+ 00000000 T __XipGetICValues     libX11         XICGetVal
+ 00000000 T __XipCallCallbacks   libX11         ProtoFlt
+ 00000000 T __XipBackEndFilter   libX11         ProtoFlt
+ 00000000 T __XConvertCTToWC     libX11         XCnvCTToWC
+ 00000000 T __XConvertWCToCT     libX11         XCnvCTToWC
+ 00000000 T __XctIsExtendSegment libX11         XCnvCTToWC
+ 00000000 T __XConvertMBToCT     libX11         XCnvMBToCT
+ 00000000 T __XConvertCTToMB     libX11         XCnvMBToCT
+ 00000000 T __XConvertMBToWC     libX11         XCnvWCToMB
+ 00000000 T __XConvertWCToMB     libX11         XCnvWCToMB
+ 00000000 T _XDefaultString      libX11         XCnvToStr
+ 00000000 T __XConvertWCToString libX11         XCnvToStr
+ 00000000 T __XConvertMBToString libX11         XCnvToStr
+ 00000000 T __XipConnectIM       libX11         XConnIM
+ 00000000 T __XipDisconnectIM    libX11         XConnIM
+ 00000000 T __XsiCreateFontSet   libX11         XCrFntSet
+ 00000000 T __XsiQueryFontSetFromId libX11         XCrFntSet
+ 00000000 T __XipDestroyIC       libX11         XCrIC
+ 00000000 T __XipReadRdb         libX11         XCrIC
+ 00000000 T __XipCreateDefIC     libX11         XCrIC
+ 00000000 T __XipCreateIC        libX11         XCrIC
+ 00000000 T __XipwcResetIC       libX11         XCrIC
+ 00000000 T __XipmbResetIC       libX11         XCrIC
+ 00000000 T __XipGetIMValues     libX11         XGetIMVal
+ 00000000 T __XipICSetAttrValues libX11         XICSetVal
+ 00000000 T __XipICSetValues     libX11         XICSetVal
+ 00000000 T __XipSendICValues    libX11         XICSetVal
+ 00000000 T __XipSetICValues     libX11         XICSetVal
+ 00000000 T __XipwcLookupString  libX11         XIMKeyBind
+ 00000000 T __XipmbLookupString  libX11         XIMKeyBind
+ 00000000 T __XipctLookupString  libX11         XIMKeyBind
+ 00000000 T __XipSetIOErrorHandler libX11         XIMProto
+ 00000000 T __XipFlushToIM       libX11         XIMProto
+ 00000000 T __XipWriteToIM       libX11         XIMProto
+ 00000000 T __XipReadFromIM      libX11         XIMProto
+ 00000000 T __XipTypeOfNextICQueue libX11         XIMQueue
+ 00000000 T __XipStateOfNextICQueue libX11         XIMQueue
+ 00000000 T __XipKeySymOfNextICQueue libX11         XIMQueue
+ 00000000 T __XipStringOfNextICQueue libX11         XIMQueue
+ 00000000 T __XipFreeNextICQueue libX11         XIMQueue
+ 00000000 T __XipPutICQueue      libX11         XIMQueue
+ 00000000 T __XipGetNextICQueue  libX11         XIMQueue
+ 00000000 T __XipFreeAllICQueue  libX11         XIMQueue
+ 00000000 T __XipSaveOverflowICQueue libX11         XIMQueue
+ 00000000 T __XipGetOverflowICQueue libX11         XIMQueue
+ 00000000 T __XInitCTEncoding    libX11         XInitCT
+ 00000000 T __XRegisterCharSet   libX11         XInitCT
+ 00000000 T __XctisGLdsg         libX11         XInitCT
+ 00000000 T __XcwNameGetGLorGRId libX11         XInitCT
+ 00000000 T __XcwNameGetAll      libX11         XInitCT
+ 00000000 T __XcwEscSetStatus    libX11         XInitCT
+ 00000000 T __XcwGetWoffset      libX11         XInitCT
+ 00000000 T __XcwGetWoffsetFromLocale libX11         XInitCT
+ 00000000 T __XcwGetAll          libX11         XInitCT
+ 00000000 T __XcwGetLength       libX11         XInitCT
+ 00000000 T __XcwCheckDefaultState libX11         XInitCT
+ 00000000 T __XcwIdCheck         libX11         XInitCT
+ 00000000 T __XcwIdGetAll        libX11         XInitCT
+ 00000000 T __XcwIdGetLength     libX11         XInitCT
+ 00000000 T __XcwIdGetEncoding   libX11         XInitCT
+ 00000000 T __XcwGetDefaultEncoding libX11         XInitCT
+ 00000000 T __XcwIdGetWoffset    libX11         XInitCT
+ 00000000 T __XcwIdGetISOState   libX11         XInitCT
+ 00000000 T __XipLocalOpenIM     libX11         XLocalIM
+ 00000000 T __XipLocalCallCallbacks libX11         XLocalIM
+ 00000000 T __XipLocalBackEndFilter libX11         XLocalIM
+ 00000000 T __XipLocalDestroyIC  libX11         XLocalIM
+ 00000000 T __XipLocalCreateIC   libX11         XLocalIM
+ 00000000 T __XipLocalwcResetIC  libX11         XLocalIM
+ 00000000 T __XipLocalmbResetIC  libX11         XLocalIM
+ 00000000 T __XipLocalGetIMValues libX11         XLocalIM
+ 00000000 T __XipLocalSetICFocus libX11         XLocalIM
+ 00000000 T __XipLocalUnsetICFocus libX11         XLocalIM
+ 00000000 T __XipLocalGetICValues libX11         XLocalIM
+ 00000000 T __XipLocalSetICValues libX11         XLocalIM
+ 00000000 T __XipOpenIM          libX11         XOpenIM
+ 00000000 T __XParseISOEncoding  libX11         XParseCT
+ 00000000 T __Xmbmsbon           libX11         XlcAccess
+ 00000000 T __Xmbctid            libX11         XlcAccess
+ 00000000 T __Xmbctidtocsid      libX11         XlcAccess
+ 00000000 T __Xmbcsid            libX11         XlcAccess
+ 00000000 T __XmbSetCsid         libX11         XlcAccess
+ 00000000 T __XmbctGLorGR        libX11         XlcAccess
+ 00000000 T __Xmbfscs            libX11         XlcAccess
+ 00000000 T __Xmbfsname          libX11         XlcAccess
+ 00000000 T __Xmblen             libX11         XlcAccess
+ 00000000 T __Xmbfslen           libX11         XlcAccess
+ 00000000 T __Xmbctocsc          libX11         XlcAccess
+ 00000000 T __Xcsctombc          libX11         XlcAccess
+ 00000000 T __Xmbdsg             libX11         XlcAccess
+ 00000000 T __Xmbfsdsg           libX11         XlcAccess
+ 00000000 T __Xmbfswf            libX11         XlcAccess
+ 00000000 T __Xmbdlen            libX11         XlcAccess
+ 00000000 T __XmbCheck           libX11         XlcAccess
+ 00000000 T __XmbGetDefaultEncoding libX11         XlcAccess
+ 00000000 T __XlcDefaultLoader   libX11         XlcDefLd
+ 00000000 T __XlcListLocale      libX11         XlcLoad
+ 00000000 T __XlcMakeLocale      libX11         XlcLoad
+ 00000000 T __XlcDupLocale       libX11         XlcLoad
+ 00000000 T __XFallBackConvert   libX11         XlcLoad
+ 00000000 T __XrmInitParseInfo   libX11         XlcLoad
+ 00000000 T __XmbDecomposeGlyphCharset libX11         XmbDeGlyph
+ 00000000 T _XmbTextPropertyToTextList libX11         XmbPrpText
+ 00000000 T __XsimbDrawString    libX11         XmbText
+ 00000000 T __XsimbDrawImageString libX11         XmbText
+ 00000000 T __Xsimb8DrawString   libX11         XmbText
+ 00000000 T __Xsimb8DrawImageString libX11         XmbText
+ 00000000 T __XsimbTextEscapement libX11         XmbTextExt
+ 00000000 T __XsimbTextExtents   libX11         XmbTextExt
+ 00000000 T __Xsimb8TextEscapement libX11         XmbTextExt
+ 00000000 T __Xsimb8TextExtents  libX11         XmbTextExt
+ 00000000 T __XsimbTextPerCharExtents libX11         XmbTextPer
+ 00000000 T _XmbTextListToTextProperty libX11         XmbTextPrp
+ 00000000 T __XwcDecomposeGlyphCharset libX11         XwcDeGlyph
+ 00000000 T _XwcTextPropertyToTextList libX11         XwcPrpText
+ 00000000 T _XwcFreeStringList   libX11         XwcPrpText
+ 00000000 T __Xsiwcstombs        libX11         XwcText
+ 00000000 T __XsiwcDrawString    libX11         XwcText
+ 00000000 T __XsiwcDrawImageString libX11         XwcText
+ 00000000 T __XsiwcTextEscapement libX11         XwcTextExt
+ 00000000 T __XsiwcTextExtents   libX11         XwcTextExt
+ 00000000 T __XsiwcTextPerCharExtents libX11         XwcTextPer
+ 00000000 T _XwcTextListToTextProperty libX11         XwcTextPrp
diff -c /dev/null mit/lib/X/jump_ignore:1.1
*** /dev/null	Sat Mar 12 00:37:21 1994
--- mit/lib/X/jump_ignore	Sat Mar 12 00:37:23 1994
***************
*** 0 ****
--- 1 ----
+ # $XFree86: mit/lib/X/jump_ignore,v 1.1 1993/04/17 02:36:56 dawes Exp $
diff -c /dev/null mit/lib/X/jump_vars:1.1
*** /dev/null	Sat Mar 12 00:37:23 1994
--- mit/lib/X/jump_vars	Sat Mar 12 00:37:23 1994
***************
*** 0 ****
--- 1,36 ----
+ # $XFree86: mit/lib/X/jump_vars,v 1.1 1993/04/16 14:20:04 dawes Exp $
+ #
+ 00008000 K __XkeyTable          libX11         XStrKeysym
+ 00000100 K __Xevent_to_mask     libX11         evtomask
+ 00000004 D __qfree              libX11         globals
+ 00000004 D __qfreeFlag          libX11         globals
+ 00000004 D __qfreePtr           libX11         globals
+ 00000004 C __XIOErrorFunction   libX11         globals
+ 00000004 C __XErrorFunction     libX11         globals
+ 00000004 C __Xdebug             libX11         globals
+ 00000004 C __XHeadOfDisplayList libX11         globals
+ 00000040 D _XcmsCIELabColorSpace libX11         CIELab
+ 00000040 D _XcmsCIELuvColorSpace libX11         CIELuv
+ 00000040 D _XcmsCIEXYZColorSpace libX11         CIEXYZ
+ 00000040 D _XcmsCIEuvYColorSpace libX11         CIEuvY
+ 00000040 D _XcmsCIExyYColorSpace libX11         CIExyY
+ 00000040 D _XcmsTekHVCColorSpace libX11         TekHVC
+ 00000040 D _XcmsUNDEFINEDColorSpace libX11         UNDEFINED
+ 00000040 D __XcmsDIColorSpacesInit libX11         XcmsGlobls
+ 00000004 D __XcmsDIColorSpaces  libX11         XcmsGlobls
+ 00000020 D __XcmsDDColorSpacesInit libX11         XcmsGlobls
+ 00000004 D __XcmsDDColorSpaces  libX11         XcmsGlobls
+ 00000010 D __XcmsSCCFuncSetsInit libX11         XcmsGlobls
+ 00000004 D __XcmsSCCFuncSets    libX11         XcmsGlobls
+ 00000010 D _XcmsCIEXYZ_prefix   libX11         XcmsGlobls
+ 00000010 D _XcmsCIEuvY_prefix   libX11         XcmsGlobls
+ 00000010 D _XcmsCIExyY_prefix   libX11         XcmsGlobls
+ 00000010 D _XcmsCIELab_prefix   libX11         XcmsGlobls
+ 00000010 D _XcmsCIELuv_prefix   libX11         XcmsGlobls
+ 00000010 D _XcmsTekHVC_prefix   libX11         XcmsGlobls
+ 00000010 D _XcmsRGBi_prefix     libX11         XcmsGlobls
+ 00000010 D _XcmsRGB_prefix      libX11         XcmsGlobls
+ 00000080 D __XcmsRegColorSpaces libX11         XcmsGlobls
+ 00000040 D _XcmsRGBiColorSpace  libX11         XcmsLRGB
+ 00000040 D _XcmsRGBColorSpace   libX11         XcmsLRGB
+ 00000020 D _XcmsLinearRGBFunctionSet libX11         XcmsLRGB
diff -c /dev/null mit/lib/X/libX11.c:1.4
*** /dev/null	Sat Mar 12 00:37:23 1994
--- mit/lib/X/libX11.c	Sat Mar 12 00:37:24 1994
***************
*** 0 ****
--- 1,121 ----
+ /* libX11 : libX11.c
+  * exported data
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/X/libX11.c,v 1.4 1993/05/22 06:42:58 dawes Exp $
+  */
+ 
+ #ifdef SVR3SHLIB
+ 
+ #define VoidInit(var) void *var = 0
+ 
+ VoidInit(_libX11__ctype);
+ VoidInit(_libX11__filbuf);
+ VoidInit(_libX11__flsbuf);
+ VoidInit(_libX11__iob);
+ VoidInit(_libX11_access);
+ VoidInit(_libX11_alarm);
+ VoidInit(_libX11_atoi);
+ VoidInit(_libX11_calloc);
+ VoidInit(_libX11_close);
+ VoidInit(_libX11_connect);
+ VoidInit(_libX11_errno);
+ VoidInit(_libX11_exit);
+ VoidInit(_libX11_fclose);
+ VoidInit(_libX11_fcntl);
+ VoidInit(_libX11_fgets);
+ VoidInit(_libX11_fopen);
+ VoidInit(_libX11_fprintf);
+ VoidInit(_libX11_fputs);
+ VoidInit(_libX11_fread);
+ VoidInit(_libX11_free);
+ VoidInit(_libX11_fwrite);
+ VoidInit(_libX11_getenv);
+ VoidInit(_libX11_gethostbyname);
+ VoidInit(_libX11_uname);
+ VoidInit(_libX11_getmsg);
+ VoidInit(_libX11_getpid);
+ VoidInit(_libX11_getpwnam);
+ VoidInit(_libX11_getpwuid);
+ VoidInit(_libX11_getuid);
+ VoidInit(_libX11_grantpt);
+ VoidInit(_libX11_htons);
+ VoidInit(_libX11_inet_addr);
+ VoidInit(_libX11_ioctl);
+ VoidInit(_libX11_malloc);
+ VoidInit(_libX11_memset);
+ VoidInit(_libX11_ntohl);
+ VoidInit(_libX11_ntohs);
+ VoidInit(_libX11_open);
+ VoidInit(_libX11_ptsname);
+ VoidInit(_libX11_putmsg);
+ VoidInit(_libX11_qsort);
+ VoidInit(_libX11_read);
+ VoidInit(_libX11_realloc);
+ VoidInit(_libX11_rewind);
+ VoidInit(_libX11_select);
+ VoidInit(_libX11_setsockopt);
+ VoidInit(_libX11_signal);
+ VoidInit(_libX11_sleep);
+ VoidInit(_libX11_socket);
+ VoidInit(_libX11_sprintf);
+ VoidInit(_libX11_sscanf);
+ VoidInit(_libX11_stat);
+ VoidInit(_libX11_strcat);
+ VoidInit(_libX11_strchr);
+ VoidInit(_libX11_strcmp);
+ VoidInit(_libX11_strcpy);
+ VoidInit(_libX11_strncmp);
+ VoidInit(_libX11_strncpy);
+ VoidInit(_libX11_strrchr);
+ VoidInit(_libX11_strtok);
+ VoidInit(_libX11_sys_errlist);
+ VoidInit(_libX11_sys_nerr);
+ VoidInit(_libX11_tolower);
+ VoidInit(_libX11_unlockpt);
+ VoidInit(_libX11_write);
+ VoidInit(_libX11_writev);
+ VoidInit(_libX11_XauDisposeAuth);
+ VoidInit(_libX11_XauFileName);
+ VoidInit(_libX11_XauGetBestAuthByAddr);
+ VoidInit(_libX11_XauReadAuth);
+ VoidInit(_libX11__Xevent_to_mask);
+ VoidInit(_libX11__XdmcpAuthSetup);
+ VoidInit(_libX11__XdmcpAuthDoIt);
+ VoidInit(_libX11_XdmcpWrap);
+ VoidInit(_libX11_getsockname);
+ VoidInit(_libX11_time);
+ 
+ 
+ #ifndef __GNUC__
+ /*
+  * If we are working with floating point aritmetic, stock AT&T cc generates
+  * an unresolved reference to __fltused. But we want to make a shared lib from
+  * this here and don't want to reference /lib/libc_s.a, just define this sym as
+  * (shared lib) static.
+  * The trick is that while building the shared lib all references to this
+  * symbol are resolved internally. But the symbol will be outside only visible
+  * as a static one, so preventing a name conflict with other shared libs.
+  */
+ long __fltused = 0;
+ #endif
+ 
+ /* A dummy function for free branchtab-slots.
+  * This would be a great place for an error-check mechanism for shared libs.
+  * (Print error message if not existent function is called.)
+  */
+ extern void _libX11_dummy(){};
+ 
+ #ifndef HASXDMAUTH
+ extern void _no_des_dummy1(){};
+ extern void _no_des_dummy2(){};
+ extern void _no_des_dummy3(){};
+ #endif
+ 
+ 
+ #endif
+ 
+ 
diff -c /dev/null mit/lib/X/libX11.def:1.6
*** /dev/null	Sat Mar 12 00:37:24 1994
--- mit/lib/X/libX11.def	Sat Mar 12 00:37:24 1994
***************
*** 0 ****
--- 1,1326 ----
+ /* libX11 : libX11.def
+  * shared library description file
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/X/libX11.def,v 1.6 1993/05/22 06:43:01 dawes Exp $
+  */
+ 
+ /**/#address .text 0xB0000000
+ /**/#address .data 0xB0400000
+ 
+ 
+ 
+ /**/#branch
+ XActivateScreenSaver 1
+ XAddExtension 2
+ XAddHost 3
+ XAddHosts 4
+ XAddPixel 5
+ XAddToExtensionList 6
+ XAddToSaveSet 7
+ XAllPlanes 8
+ XAllocClassHint 9
+ XAllocColor 10
+ XAllocColorCells 11
+ XAllocColorPlanes 12
+ XAllocIconSize 13
+ XAllocNamedColor 14
+ XAllocSizeHints 15
+ XAllocStandardColormap 16
+ XAllocWMHints 17
+ XAllowEvents 18
+ XAutoRepeatOff 19
+ XAutoRepeatOn 20
+ XBaseFontNameListOfFontSet 21
+ XBell 22
+ XBitmapBitOrder 23
+ XBitmapPad 24
+ XBitmapUnit 25
+ XBlackPixel 26
+ XBlackPixelOfScreen 27
+ XCellsOfScreen 28
+ XChangeActivePointerGrab 29
+ XChangeGC 30
+ XChangeKeyboardControl 31
+ XChangeKeyboardMapping 32
+ XChangePointerControl 33
+ XChangeProperty 34
+ XChangeSaveSet 35
+ XChangeWindowAttributes 36
+ XCheckIfEvent 37
+ XCheckMaskEvent 38
+ XCheckTypedEvent 39
+ XCheckTypedWindowEvent 40
+ XCheckWindowEvent 41
+ XCirculateSubwindows 42
+ XCirculateSubwindowsDown 43
+ XCirculateSubwindowsUp 44
+ XClearArea 45
+ XClearWindow 46
+ XClipBox 47
+ XCloseDisplay 48
+ XCloseIM 49
+ XConfigureWindow 50
+ XConnectionNumber 51
+ XContextDependentDrawing 52
+ XConvertSelection 53
+ XCopyArea 54
+ XCopyColormapAndFree 55
+ XCopyGC 56
+ XCopyPlane 57
+ XCreateBitmapFromData 58
+ XCreateColormap 59
+ XCreateFontCursor 60
+ XCreateFontSet 61
+ XCreateGC 62
+ XCreateGlyphCursor 63
+ XCreateIC 64
+ XCreateImage 65
+ XCreatePixmap 66
+ XCreatePixmapCursor 67
+ XCreatePixmapFromBitmapData 68
+ XCreateRegion 69
+ XCreateSimpleWindow 70
+ XCreateWindow 71
+ XDefaultColormap 72
+ XDefaultColormapOfScreen 73
+ XDefaultDepth 74
+ XDefaultDepthOfScreen 75
+ XDefaultGC 76
+ XDefaultGCOfScreen 77
+ XDefaultRootWindow 78
+ XDefaultScreen 79
+ XDefaultScreenOfDisplay 80
+ XDefaultString 81
+ XDefaultVisual 82
+ XDefaultVisualOfScreen 83
+ XDefineCursor 84
+ XDeleteContext 85
+ XDeleteModifiermapEntry 86
+ XDeleteProperty 87
+ XDestroyIC 88
+ XDestroyImage 89
+ XDestroyRegion 90
+ XDestroySubwindows 91
+ XDestroyWindow 92
+ XDisableAccessControl 93
+ XDisplayCells 94
+ XDisplayHeight 95
+ XDisplayHeightMM 96
+ XDisplayKeycodes 97
+ XDisplayMotionBufferSize 98
+ XDisplayName 99
+ XDisplayOfIM 100
+ XDisplayOfScreen 101
+ XDisplayPlanes 102
+ XDisplayString 103
+ XDisplayWidth 104
+ XDisplayWidthMM 105
+ XDoesBackingStore 106
+ XDoesSaveUnders 107
+ XDrawArc 108
+ XDrawArcs 109
+ XDrawImageString 110
+ XDrawImageString16 111
+ XDrawLine 112
+ XDrawLines 113
+ XDrawPoint 114
+ XDrawPoints 115
+ XDrawRectangle 116
+ XDrawRectangles 117
+ XDrawSegments 118
+ XDrawString 119
+ XDrawString16 120
+ XDrawText 121
+ XDrawText16 122
+ XEHeadOfExtensionList 123
+ XESetCloseDisplay 124
+ XESetCopyGC 125
+ XESetCreateFont 126
+ XESetCreateGC 127
+ XESetError 128
+ XESetErrorString 129
+ XESetEventToWire 130
+ XESetFlushGC 131
+ XESetFreeFont 132
+ XESetFreeGC 133
+ XESetPrintErrorValues 134
+ XESetWireToError 135
+ XESetWireToEvent 136
+ XEmptyRegion 137
+ XEnableAccessControl 138
+ XEqualRegion 139
+ XEventMaskOfScreen 140
+ XEventsQueued 141
+ XExtentsOfFontSet 142
+ XFetchBuffer 143
+ XFetchBytes 144
+ XFetchName 145
+ XFillArc 146
+ XFillArcs 147
+ XFillPolygon 148
+ XFillRectangle 149
+ XFillRectangles 150
+ XFilterEvent 151
+ XFindContext 152
+ XFindOnExtensionList 153
+ XFlush 154
+ XFlushGC 155
+ XFontsOfFontSet 156
+ XForceScreenSaver 157
+ XFree 158
+ XFreeColormap 159
+ XFreeColors 160
+ XFreeCursor 161
+ XFreeExtensionList 162
+ XFreeFont 163
+ XFreeFontInfo 164
+ XFreeFontNames 165
+ XFreeFontPath 166
+ XFreeFontSet 167
+ XFreeGC 168
+ XFreeModifiermap 169
+ XFreePixmap 170
+ XFreeStringList 171
+ XGContextFromGC 172
+ XGeometry 173
+ XGetAtomName 174
+ XGetClassHint 175
+ XGetCommand 176
+ XGetDefault 177
+ XGetErrorDatabaseText 178
+ XGetErrorText 179
+ XGetFontPath 180
+ XGetFontProperty 181
+ XGetGCValues 182
+ XGetGeometry 183
+ XGetICValues 184
+ XGetIMValues 185
+ XGetIconName 186
+ XGetIconSizes 187
+ XGetImage 188
+ XGetInputFocus 189
+ XGetKeyboardControl 190
+ XGetKeyboardMapping 191
+ XGetModifierMapping 192
+ XGetMotionEvents 193
+ XGetNormalHints 194
+ XGetPixel 195
+ XGetPointerControl 196
+ XGetPointerMapping 197
+ XGetRGBColormaps 198
+ XGetScreenSaver 199
+ XGetSelectionOwner 200
+ XGetSizeHints 201
+ XGetStandardColormap 202
+ XGetSubImage 203
+ XGetTextProperty 204
+ XGetTransientForHint 205
+ XGetVisualInfo 206
+ XGetWMClientMachine 207
+ XGetWMColormapWindows 208
+ XGetWMHints 209
+ XGetWMIconName 210
+ XGetWMName 211
+ XGetWMNormalHints 212
+ XGetWMProtocols 213
+ XGetWMSizeHints 214
+ XGetWindowAttributes 215
+ XGetWindowProperty 216
+ XGetZoomHints 217
+ XGrabButton 218
+ XGrabKey 219
+ XGrabKeyboard 220
+ XGrabPointer 221
+ XGrabServer 222
+ XHeightMMOfScreen 223
+ XHeightOfScreen 224
+ XIMOfIC 225
+ XIconifyWindow 226
+ XIfEvent 227
+ XImageByteOrder 228
+ XInitExtension 229
+ XInsertModifiermapEntry 230
+ XInstallColormap 231
+ XInternAtom 232
+ XIntersectRegion 233
+ XKeycodeToKeysym 234
+ XKeysymToKeycode 235
+ XKeysymToString 236
+ XKillClient 237
+ XLastKnownRequestProcessed 238
+ XListDepths 239
+ XListExtensions 240
+ XListFonts 241
+ XListFontsWithInfo 242
+ XListHosts 243
+ XListInstalledColormaps 244
+ XListPixmapFormats 245
+ XListProperties 246
+ XLoadFont 247
+ XLoadQueryFont 248
+ XLocaleOfFontSet 249
+ XLocaleOfIM 250
+ XLookupColor 251
+ XLookupKeysym 252
+ XLookupString 253
+ XLowerWindow 254
+ XMapRaised 255
+ XMapSubwindows 256
+ XMapWindow 257
+ XMaskEvent 258
+ XMatchVisualInfo 259
+ XMaxCmapsOfScreen 260
+ XMaxRequestSize 261
+ XMinCmapsOfScreen 262
+ XMoveResizeWindow 263
+ XMoveWindow 264
+ XNewModifiermap 265
+ XNextEvent 266
+ XNextRequest 267
+ XNoOp 268
+ XOffsetRegion 269
+ XOpenDisplay 270
+ XOpenIM 271
+ XParseColor 272
+ XParseGeometry 273
+ XPeekEvent 274
+ XPeekIfEvent 275
+ XPending 276
+ XPlanesOfScreen 277
+ XPointInRegion 278
+ XPolygonRegion 279
+ XProtocolRevision 280
+ XProtocolVersion 281
+ XPutBackEvent 282
+ XPutImage 283
+ XPutPixel 284
+ XQLength 285
+ XQueryBestCursor 286
+ XQueryBestSize 287
+ XQueryBestStipple 288
+ XQueryBestTile 289
+ XQueryColor 290
+ XQueryColors 291
+ XQueryExtension 292
+ XQueryFont 293
+ XQueryKeymap 294
+ XQueryPointer 295
+ XQueryTextExtents 296
+ XQueryTextExtents16 297
+ XQueryTree 298
+ XRaiseWindow 299
+ XReadBitmapFile 300
+ XRebindKeysym 301
+ XRecolorCursor 302
+ XReconfigureWMWindow 303
+ XRectInRegion 304
+ XRefreshKeyboardMapping 305
+ XRemoveFromSaveSet 306
+ XRemoveHost 307
+ XRemoveHosts 308
+ XReparentWindow 309
+ XResetScreenSaver 310
+ XResizeWindow 311
+ XResourceManagerString 312
+ XRestackWindows 313
+ XRootWindow 314
+ XRootWindowOfScreen 315
+ XRotateBuffers 316
+ XRotateWindowProperties 317
+ XSaveContext 318
+ XScreenCount 319
+ XScreenNumberOfScreen 320
+ XScreenOfDisplay 321
+ XScreenResourceString 322
+ XSelectInput 323
+ XSendEvent 324
+ XServerVendor 325
+ XSetAccessControl 326
+ XSetAfterFunction 327
+ XSetArcMode 328
+ XSetAuthorization 329
+ XSetBackground 330
+ XSetClassHint 331
+ XSetClipMask 332
+ XSetClipOrigin 333
+ XSetClipRectangles 334
+ XSetCloseDownMode 335
+ XSetCommand 336
+ XSetDashes 337
+ XSetErrorHandler 338
+ XSetFillRule 339
+ XSetFillStyle 340
+ XSetFont 341
+ XSetFontPath 342
+ XSetForeground 343
+ XSetFunction 344
+ XSetGraphicsExposures 345
+ XSetICFocus 346
+ XSetICValues 347
+ XSetIOErrorHandler 348
+ XSetIconName 349
+ XSetIconSizes 350
+ XSetInputFocus 351
+ XSetLineAttributes 352
+ XSetLocaleModifiers 353
+ XSetModifierMapping 354
+ XSetNormalHints 355
+ XSetPlaneMask 356
+ XSetPointerMapping 357
+ XSetRGBColormaps 358
+ XSetRegion 359
+ XSetScreenSaver 360
+ XSetSelectionOwner 361
+ XSetSizeHints 362
+ XSetStandardColormap 363
+ XSetStandardProperties 364
+ XSetState 365
+ XSetStipple 366
+ XSetSubwindowMode 367
+ XSetTSOrigin 368
+ XSetTextProperty 369
+ XSetTile 370
+ XSetTransientForHint 371
+ XSetWMClientMachine 372
+ XSetWMColormapWindows 373
+ XSetWMHints 374
+ XSetWMIconName 375
+ XSetWMName 376
+ XSetWMNormalHints 377
+ XSetWMProperties 378
+ XSetWMProtocols 379
+ XSetWMSizeHints 380
+ XSetWindowBackground 381
+ XSetWindowBackgroundPixmap 382
+ XSetWindowBorder 383
+ XSetWindowBorderPixmap 384
+ XSetWindowBorderWidth 385
+ XSetWindowColormap 386
+ XSetZoomHints 387
+ XShrinkRegion 388
+ XStoreBuffer 389
+ XStoreBytes 390
+ XStoreColor 391
+ XStoreColors 392
+ XStoreName 393
+ XStoreNamedColor 394
+ XStringListToTextProperty 395
+ XStringToKeysym 396
+ XSubImage 397
+ XSubtractRegion 398
+ XSupportsLocale 399
+ XSync 400
+ XSynchronize 401
+ XTextExtents 402
+ XTextExtents16 403
+ XTextPropertyToStringList 404
+ XTextWidth 405
+ XTextWidth16 406
+ XTranslateCoordinates 407
+ XUndefineCursor 408
+ XUngrabButton 409
+ XUngrabKey 410
+ XUngrabKeyboard 411
+ XUngrabPointer 412
+ XUngrabServer 413
+ XUninstallColormap 414
+ XUnionRectWithRegion 415
+ XUnionRegion 416
+ XUnloadFont 417
+ XUnmapSubwindows 418
+ XUnmapWindow 419
+ XUnsetICFocus 420
+ XVaCreateNestedList 421
+ XVendorRelease 422
+ XVisualIDFromVisual 423
+ XWMGeometry 424
+ XWarpPointer 425
+ XWhitePixel 426
+ XWhitePixelOfScreen 427
+ XWidthMMOfScreen 428
+ XWidthOfScreen 429
+ XWindowEvent 430
+ XWithdrawWindow 431
+ XWriteBitmapFile 432
+ XXorRegion 433
+ XauDisposeAuth 434
+ XauFileName 435
+ XauGetBestAuthByAddr 436
+ XauReadAuth 437
+ XcmsAddColorSpace 438
+ XcmsAddFunctionSet 439
+ XcmsAllocColor 440
+ XcmsAllocNamedColor 441
+ XcmsCCCOfColormap 442
+ XcmsCIELabClipL 443
+ XcmsCIELabClipLab 444
+ XcmsCIELabClipab 445
+ XcmsCIELabQueryMaxC 446
+ XcmsCIELabQueryMaxL 447
+ XcmsCIELabQueryMaxLC 448
+ XcmsCIELabQueryMinL 449
+ XcmsCIELabToCIEXYZ 450
+ XcmsCIELabWhiteShiftColors 451
+ XcmsCIELab_ValidSpec 452
+ XcmsCIELuvClipL 453
+ XcmsCIELuvClipLuv 454
+ XcmsCIELuvClipuv 455
+ XcmsCIELuvQueryMaxC 456
+ XcmsCIELuvQueryMaxL 457
+ XcmsCIELuvQueryMaxLC 458
+ XcmsCIELuvQueryMinL 459
+ XcmsCIELuvToCIEuvY 460
+ XcmsCIELuvWhiteShiftColors 461
+ XcmsCIELuv_ValidSpec 462
+ XcmsCIEXYZToCIELab 463
+ XcmsCIEXYZToCIEuvY 464
+ XcmsCIEXYZToCIExyY 465
+ XcmsCIEXYZToRGBi 466
+ XcmsCIEXYZ_ValidSpec 467
+ XcmsCIEuvYToCIELuv 468
+ XcmsCIEuvYToCIEXYZ 469
+ XcmsCIEuvYToTekHVC 470
+ XcmsCIEuvY_ValidSpec 471
+ XcmsCIExyYToCIEXYZ 472
+ XcmsCIExyY_ValidSpec 473
+ XcmsClientWhitePointOfCCC 474
+ XcmsConvertColors 475
+ XcmsCreateCCC 476
+ XcmsDefaultCCC 477
+ XcmsDisplayOfCCC 478
+ XcmsFormatOfPrefix 479
+ XcmsFreeCCC 480
+ XcmsFreeColorDB 481
+ XcmsLRGB_RGB_ParseString 482
+ XcmsLRGB_RGBi_ParseString 483
+ XcmsLookupColor 484
+ XcmsPrefixOfFormat 485
+ XcmsQueryBlack 486
+ XcmsQueryBlue 487
+ XcmsQueryColor 488
+ XcmsQueryColors 489
+ XcmsQueryGreen 490
+ XcmsQueryRed 491
+ XcmsQueryWhite 492
+ XcmsRGBToRGBi 493
+ XcmsRGBiToCIEXYZ 494
+ XcmsRGBiToRGB 495
+ XcmsScreenNumberOfCCC 496
+ XcmsScreenWhitePointOfCCC 497
+ XcmsSetCompressionProc 498
+ XcmsSetWhiteAdjustProc 499
+ XcmsSetWhitePoint 500
+ XcmsStoreColor 501
+ XcmsStoreColors 502
+ XcmsTekHVCClipC 503
+ XcmsTekHVCClipV 504
+ XcmsTekHVCClipVC 505
+ XcmsTekHVCQueryMaxC 506
+ XcmsTekHVCQueryMaxV 507
+ XcmsTekHVCQueryMaxVC 508
+ XcmsTekHVCQueryMaxVSamples 509
+ XcmsTekHVCQueryMinV 510
+ XcmsTekHVCToCIEuvY 511
+ XcmsTekHVCWhiteShiftColors 512
+ XcmsTekHVC_ValidSpec 513
+ XcmsVisualOfCCC 514
+ XmbDrawImageString 515
+ XmbDrawString 516
+ XmbDrawText 517
+ XmbLookupString 518
+ XmbResetIC 519
+ XmbSetWMProperties 520
+ XmbTextEscapement 521
+ XmbTextExtents 522
+ XmbTextListToTextProperty 523
+ XmbTextPerCharExtents 524
+ XmbTextPropertyToTextList 525
+ Xpermalloc 526
+ XrmCombineDatabase 527
+ XrmCombineFileDatabase 528
+ XrmDestroyDatabase 529
+ XrmEnumerateDatabase 530
+ XrmGetDatabase 531
+ XrmGetFileDatabase 532
+ XrmGetResource 533
+ XrmGetStringDatabase 534
+ XrmInitialize 535
+ XrmLocaleOfDatabase 536
+ XrmMergeDatabases 537
+ XrmParseCommand 538
+ XrmPermStringToQuark 539
+ XrmPutFileDatabase 540
+ XrmPutLineResource 541
+ XrmPutResource 542
+ XrmPutStringResource 543
+ XrmQGetResource 544
+ XrmQGetSearchList 545
+ XrmQGetSearchResource 546
+ XrmQPutResource 547
+ XrmQPutStringResource 548
+ XrmQuarkToString 549
+ XrmSetDatabase 550
+ XrmStringToBindingQuarkList 551
+ XrmStringToQuark 552
+ XrmStringToQuarkList 553
+ XrmUniqueQuark 554
+ XwcDrawImageString 555
+ XwcDrawString 556
+ XwcDrawText 557
+ XwcFreeStringList 558
+ XwcLookupString 559
+ XwcResetIC 560
+ XwcTextEscapement 561
+ XwcTextExtents 562
+ XwcTextListToTextProperty 563
+ XwcTextPerCharExtents 564
+ XwcTextPropertyToTextList 565
+ _XAllocID 566
+ _XAllocScratch 567
+ _XColor_to_XcmsRGB 568
+ _XConnectDisplay 569
+ _XConvertCTToMB 570
+ _XConvertCTToWC 571
+ _XConvertMBToCT 572
+ _XConvertMBToString 573
+ _XConvertMBToWC 574
+ _XConvertWCToCT 575
+ _XConvertWCToMB 576
+ _XConvertWCToString 577
+ _XCopyToArg 578
+ _XDefaultError 579
+ _XDefaultIOError 580
+ _XDefaultWireError 581
+ _XDisconnectDisplay 582
+ _XEatData 583
+ _XEnq 584
+ _XError 585
+ _XEventToWire 586
+ _XEventsQueued 587
+ _XFallBackConvert 588
+ _XFlush 589
+ _XFlushGCCache 590
+ _XFreeDisplayStructure 591
+ _XFreeExtData 592
+ _XFreeQ 593
+ _XGetBitsPerPixel 594
+ _XGetHostname 595
+ _XGetScanlinePad 596
+ _XIMCompileResourceList 597
+ _XIOError 598
+ _XInitCTEncoding 599
+ _XInitImageFuncPtrs 600
+ _XInitKeysymDB 601
+ _XParseBaseFontNameList 602
+ _XParseISOEncoding 603
+ _XProcessWindowAttributes 604
+ _XRead 605
+ _XReadEvents 606
+ _XReadPad 607
+ _XReadV 608
+ _XRegisterCharSet 609
+ _XRegisterFilterByMask 610
+ _XRegisterFilterByType 611
+ _XReply 612
+ _XReverse_Bytes 613
+ _XScreenOfWindow 614
+ _XSend 615
+ _XSendClientPrefix 616
+ _XSetClipRectangles 617
+ _XSetImage 618
+ _XSetLastRequestRead 619
+ _XSyncFunction 620
+ _XUnknownNativeEvent 621
+ _XUnknownWireEvent 622
+ _XUnregisterFilter 623
+ _XUnresolveColor 624
+ _XUpdateGCCache 625
+ _XVIDtoVisual 626
+ _XWaitForReadable 627
+ _XWaitForWritable 628
+ _XWireToEvent 629
+ _Xbcopy 630
+ _XcmsAddCmapRec 631
+ _XcmsArcTangent 632
+ _XcmsCIELabQueryMaxLCRGB 633
+ _XcmsCIELuvQueryMaxLCRGB 634
+ _XcmsConvertColorsWithWhitePt 635
+ _XcmsCopyCmapRecAndFree 636
+ _XcmsCopyISOLatin1Lowered 637
+ _XcmsCopyPointerArray 638
+ _XcmsCosine 639
+ _XcmsCubeRoot 640
+ _XcmsDDConvertColors 641
+ _XcmsDIConvertColors 642
+ _XcmsDeleteCmapRec 643
+ _XcmsEqualWhitePts 644
+ _XcmsFreeIntensityMaps 645
+ _XcmsFreePointerArray 646
+ _XcmsGetElement 647
+ _XcmsGetIntensityMap 648
+ _XcmsGetProperty 649
+ _XcmsGetTableType0 650
+ _XcmsGetTableType1 651
+ _XcmsInitDefaultCCCs 652
+ _XcmsInitScrnInfo 653
+ _XcmsIntensityCmp 654
+ _XcmsIntensityInterpolation 655
+ _XcmsLRGB_InitScrnDefault 656
+ _XcmsMatVec 657
+ _XcmsPushPointerArray 658
+ _XcmsRGB_to_XColor 659
+ _XcmsRegFormatOfPrefix 660
+ _XcmsResolveColor 661
+ _XcmsResolveColorString 662
+ _XcmsSetGetColors 663
+ _XcmsSine 664
+ _XcmsSquareRoot 665
+ _XcmsTableSearch 666
+ _XcmsTekHVCQueryMaxVCRGB 667
+ _XcmsTekHVC_CheckModify 668
+ _XcmsUnresolveColor 669
+ _XcmsValueCmp 670
+ _XcmsValueInterpolation 671
+ _Xcsctombc 672
+ _XctIsExtendSegment 673
+ _XctisGLdsg 674
+ _XcwCheckDefaultState 675
+ _XcwEscSetStatus 676
+ _XcwGetAll 677
+ _XcwGetDefaultEncoding 678
+ _XcwGetLength 679
+ _XcwGetWoffset 680
+ _XcwGetWoffsetFromLocale 681
+ _XcwIdCheck 682
+ _XcwIdGetAll 683
+ _XcwIdGetEncoding 684
+ _XcwIdGetISOState 685
+ _XcwIdGetLength 686
+ _XcwIdGetWoffset 687
+ _XcwNameGetAll 688
+ _XcwNameGetGLorGRId 689
+ _XipBackEndFilter 690
+ _XipCallCallbacks 691
+ _XipConnectIM 692
+ _XipCreateDefIC 693
+ _XipCreateIC 694
+ _XipDestroyIC 695
+ _XipDisconnectIM 696
+ _XipFlushToIM 697
+ _XipFreeAllICQueue 698
+ _XipFreeNextICQueue 699
+ _XipGetICValues 700
+ _XipGetIMValues 701
+ _XipGetNextICQueue 702
+ _XipGetOverflowICQueue 703
+ _XipICGetValues 704
+ _XipICSetAttrValues 705
+ _XipICSetValues 706
+ _XipKeySymOfNextICQueue 707
+ _XipLocalBackEndFilter 708
+ _XipLocalCallCallbacks 709
+ _XipLocalCreateIC 710
+ _XipLocalDestroyIC 711
+ _XipLocalGetICValues 712
+ _XipLocalGetIMValues 713
+ _XipLocalOpenIM 714
+ _XipLocalSetICFocus 715
+ _XipLocalSetICValues 716
+ _XipLocalUnsetICFocus 717
+ _XipLocalmbResetIC 718
+ _XipLocalwcResetIC 719
+ _XipOpenIM 720
+ _XipPutICQueue 721
+ _XipReadFromIM 722
+ _XipReadRdb 723
+ _XipReceiveICValues 724
+ _XipSaveOverflowICQueue 725
+ _XipSendICValues 726
+ _XipSetICFocus 727
+ _XipSetICValues 728
+ _XipSetIOErrorHandler 729
+ _XipStateOfNextICQueue 730
+ _XipStringOfNextICQueue 731
+ _XipTypeOfNextICQueue 732
+ _XipUnsetICFocus 733
+ _XipWriteToIM 734
+ _XipctLookupString 735
+ _XipmbLookupString 736
+ _XipmbResetIC 737
+ _XipwcLookupString 738
+ _XipwcResetIC 739
+ _XlcAddLoader 740
+ _XlcCurrentLC 741
+ _XlcDefaultLoader 742
+ _XlcDefaultMapModifiers 743
+ _XlcDupLocale 744
+ _XlcListLocale 745
+ _XlcMakeLocale 746
+ _XlcValidModSyntax 747
+ _XmbCheck 748
+ _XmbDecomposeGlyphCharset 749
+ _XmbGetDefaultEncoding 750
+ _XmbSetCsid 751
+ _Xmbcsid 752
+ _XmbctGLorGR 753
+ _Xmbctid 754
+ _Xmbctidtocsid 755
+ _Xmbctocsc 756
+ _Xmbdlen 757
+ _Xmbdsg 758
+ _Xmbfscs 759
+ _Xmbfsdsg 760
+ _Xmbfslen 761
+ _Xmbfsname 762
+ _Xmbfswf 763
+ _Xmblen 764
+ _Xmbmsbon 765
+ _XrmInitParseInfo 766
+ _XrmInternalStringToQuark 767
+ _Xsetlocale 768
+ _XsiCreateFontSet 769
+ _XsiQueryFontSetFromId 770
+ _Xsimb8DrawImageString 771
+ _Xsimb8DrawString 772
+ _Xsimb8TextEscapement 773
+ _Xsimb8TextExtents 774
+ _XsimbDrawImageString 775
+ _XsimbDrawString 776
+ _XsimbTextEscapement 777
+ _XsimbTextExtents 778
+ _XsimbTextPerCharExtents 779
+ _XsiwcDrawImageString 780
+ _XsiwcDrawString 781
+ _XsiwcTextEscapement 782
+ _XsiwcTextExtents 783
+ _XsiwcTextPerCharExtents 784
+ _XwcDecomposeGlyphCharset 785
+ #ifdef HASXDMAUTH
+ _XdmcpAuthSetup 786
+ _XdmcpAuthDoIt 787
+ XdmcpWrap 788
+ _XdmcpWrapperToOddParity 789
+ #else
+ _no_des_dummy1 786
+ _no_des_dummy2 787
+ _no_des_dummy3 788
+ _libX11_dummy 789
+ #endif
+ 
+ 
+ _libX11_dummy 790-850
+ 
+ 
+ /**/#objects
+ DOWN/globals.o  /* All objects with global data must be come at first!*/
+ DOWN/CIELab.o
+ DOWN/CIELuv.o
+ DOWN/CIEXYZ.o
+ DOWN/CIEuvY.o
+ DOWN/CIExyY.o
+ DOWN/TekHVC.o
+ DOWN/UNDEFINED.o
+ DOWN/XcmsGlobls.o
+ DOWN/evtomask.o
+ DOWN/XStrKeysym.o
+ DOWN/XcmsLRGB.o
+ 
+ DOWN/AuDispose.o
+ DOWN/AuFileName.o
+ DOWN/AuGetBest.o
+ DOWN/AuRead.o
+ DOWN/CIELabGcC.o
+ DOWN/CIELabGcL.o
+ DOWN/CIELabGcLC.o
+ DOWN/CIELabMnL.o
+ DOWN/CIELabMxC.o
+ DOWN/CIELabMxL.o
+ DOWN/CIELabMxLC.o
+ DOWN/CIELabWpAj.o
+ DOWN/CIELuvGcC.o
+ DOWN/CIELuvGcL.o
+ DOWN/CIELuvGcLC.o
+ DOWN/CIELuvMnL.o
+ DOWN/CIELuvMxC.o
+ DOWN/CIELuvMxL.o
+ DOWN/CIELuvMxLC.o
+ DOWN/CIELuvWpAj.o
+ DOWN/Context.o
+ DOWN/Depths.o
+ DOWN/GetGCVals.o
+ DOWN/GetNrmHint.o
+ DOWN/GetRGBCMap.o
+ DOWN/GetTxtProp.o
+ DOWN/GetWMCMapW.o
+ DOWN/GetWMProto.o
+ DOWN/Iconify.o
+ DOWN/ParseCmd.o
+ DOWN/PixFormats.o
+ DOWN/PropAlloc.o
+ DOWN/ProtoFlt.o
+ DOWN/Quarks.o
+ DOWN/ReconfWM.o
+ DOWN/SetNrmHint.o
+ DOWN/SetRGBCMap.o
+ DOWN/SetTxtProp.o
+ DOWN/SetWMCMapW.o
+ DOWN/SetWMProps.o
+ DOWN/SetWMProto.o
+ DOWN/StrToText.o
+ DOWN/TekHVCGcC.o
+ DOWN/TekHVCGcV.o
+ DOWN/TekHVCGcVC.o
+ DOWN/TekHVCMnV.o
+ DOWN/TekHVCMxC.o
+ DOWN/TekHVCMxV.o
+ DOWN/TekHVCMxVC.o
+ DOWN/TekHVCMxVs.o
+ DOWN/TekHVCWpAj.o
+ DOWN/TextToStr.o
+ DOWN/WMGeom.o
+ DOWN/Withdraw.o
+ DOWN/XAllCells.o
+ DOWN/XAllPlanes.o
+ DOWN/XAllowEv.o
+ DOWN/XAutoRep.o
+ DOWN/XBackgnd.o
+ DOWN/XBdrWidth.o
+ DOWN/XBell.o
+ DOWN/XBorder.o
+ DOWN/XChAccCon.o
+ DOWN/XChActPGb.o
+ DOWN/XChClMode.o
+ DOWN/XChCmap.o
+ DOWN/XChGC.o
+ DOWN/XChKeyCon.o
+ DOWN/XChPntCon.o
+ DOWN/XChProp.o
+ DOWN/XChSaveSet.o
+ DOWN/XChWAttrs.o
+ DOWN/XChWindow.o
+ DOWN/XChkIfEv.o
+ DOWN/XChkMaskEv.o
+ DOWN/XChkTypEv.o
+ DOWN/XChkTypWEv.o
+ DOWN/XChkWinEv.o
+ DOWN/XCirWin.o
+ DOWN/XCirWinDn.o
+ DOWN/XCirWinUp.o
+ DOWN/XClDisplay.o
+ DOWN/XClear.o
+ DOWN/XClearArea.o
+ DOWN/XCnvCTToWC.o
+ DOWN/XCnvMBToCT.o
+ DOWN/XCnvToStr.o
+ DOWN/XCnvWCToMB.o
+ DOWN/XConfWind.o
+ DOWN/XConnDis.o
+ DOWN/XConnIM.o
+ DOWN/XConvSel.o
+ DOWN/XCopyArea.o
+ DOWN/XCopyCmap.o
+ DOWN/XCopyGC.o
+ DOWN/XCopyPlane.o
+ DOWN/XCrBFData.o
+ DOWN/XCrCmap.o
+ DOWN/XCrCursor.o
+ DOWN/XCrFntSet.o
+ DOWN/XCrGC.o
+ DOWN/XCrGlCur.o
+ DOWN/XCrIC.o
+ DOWN/XCrPFBData.o
+ DOWN/XCrPixmap.o
+ DOWN/XCrWindow.o
+ DOWN/XCursor.o
+ DOWN/XDefCursor.o
+ DOWN/XDelProp.o
+ DOWN/XDestSubs.o
+ DOWN/XDestWind.o
+ DOWN/XDisName.o
+ DOWN/XDrArc.o
+ DOWN/XDrArcs.o
+ DOWN/XDrLine.o
+ DOWN/XDrLines.o
+ DOWN/XDrPoint.o
+ DOWN/XDrPoints.o
+ DOWN/XDrRect.o
+ DOWN/XDrRects.o
+ DOWN/XDrSegs.o
+ DOWN/XErrDes.o
+ DOWN/XErrHndlr.o
+ DOWN/XEvToWire.o
+ DOWN/XFSSaver.o
+ DOWN/XFSWrap.o
+ DOWN/XFetchName.o
+ DOWN/XFillArc.o
+ DOWN/XFillArcs.o
+ DOWN/XFillPoly.o
+ DOWN/XFillRect.o
+ DOWN/XFillRects.o
+ DOWN/XFilterEv.o
+ DOWN/XFlush.o
+ DOWN/XFont.o
+ DOWN/XFontInfo.o
+ DOWN/XFontNames.o
+ DOWN/XFreeCmap.o
+ DOWN/XFreeCols.o
+ DOWN/XFreeCurs.o
+ DOWN/XFreeEData.o
+ DOWN/XFreeGC.o
+ DOWN/XFreePix.o
+ DOWN/XGCMisc.o
+ DOWN/XGeom.o
+ DOWN/XGetAtomNm.o
+ DOWN/XGetColor.o
+ DOWN/XGetDflt.o
+ DOWN/XGetFPath.o
+ DOWN/XGetFProp.o
+ DOWN/XGetGeom.o
+ DOWN/XGetHColor.o
+ DOWN/XGetHints.o
+ DOWN/XGetIFocus.o
+ DOWN/XGetIMVal.o
+ DOWN/XGetImage.o
+ DOWN/XGetKCnt.o
+ DOWN/XGetMoEv.o
+ DOWN/XGetPCnt.o
+ DOWN/XGetPntMap.o
+ DOWN/XGetProp.o
+ DOWN/XGetSOwner.o
+ DOWN/XGetSSaver.o
+ DOWN/XGetStCmap.o
+ DOWN/XGetWAttrs.o
+ DOWN/XGrButton.o
+ DOWN/XGrKey.o
+ DOWN/XGrKeybd.o
+ DOWN/XGrPointer.o
+ DOWN/XGrServer.o
+ DOWN/XHost.o
+ DOWN/XICFocus.o
+ DOWN/XICGetVal.o
+ DOWN/XICSetVal.o
+ DOWN/XICWrap.o
+ DOWN/XIMKeyBind.o
+ DOWN/XIMProto.o
+ DOWN/XIMQueue.o
+ DOWN/XIMWrap.o
+ DOWN/XIfEvent.o
+ DOWN/XImText.o
+ DOWN/XImText16.o
+ DOWN/XImUtil.o
+ DOWN/XInitCT.o
+ DOWN/XInitExt.o
+ DOWN/XInsCmap.o
+ DOWN/XIntAtom.o
+ DOWN/XKeyBind.o
+ DOWN/XKeysymStr.o
+ DOWN/XKillCl.o
+ DOWN/XLiHosts.o
+ DOWN/XLiICmaps.o
+ DOWN/XLiProps.o
+ DOWN/XListExt.o
+ DOWN/XLoadFont.o
+ DOWN/XLocalIM.o
+ DOWN/XLookupCol.o
+ DOWN/XLowerWin.o
+ DOWN/XMacros.o
+ DOWN/XMapRaised.o
+ DOWN/XMapSubs.o
+ DOWN/XMapWindow.o
+ DOWN/XMaskEvent.o
+ DOWN/XMisc.o
+ DOWN/XModMap.o
+ DOWN/XMoveWin.o
+ DOWN/XNextEvent.o
+ DOWN/XOpenDis.o
+ DOWN/XOpenIM.o
+ DOWN/XParseCT.o
+ DOWN/XParseCol.o
+ DOWN/XParseGeom.o
+ DOWN/XPeekEvent.o
+ DOWN/XPeekIfEv.o
+ DOWN/XPending.o
+ DOWN/XPmapBgnd.o
+ DOWN/XPmapBord.o
+ DOWN/XPolyReg.o
+ DOWN/XPolyTxt.o
+ DOWN/XPolyTxt16.o
+ DOWN/XPutBEvent.o
+ DOWN/XPutImage.o
+ DOWN/XQuBest.o
+ DOWN/XQuColor.o
+ DOWN/XQuColors.o
+ DOWN/XQuCurShp.o
+ DOWN/XQuExt.o
+ DOWN/XQuKeybd.o
+ DOWN/XQuPntr.o
+ DOWN/XQuStipShp.o
+ DOWN/XQuTextE16.o
+ DOWN/XQuTextExt.o
+ DOWN/XQuTileShp.o
+ DOWN/XQuTree.o
+ DOWN/XRaiseWin.o
+ DOWN/XRdBitF.o
+ DOWN/XRecolorC.o
+ DOWN/XReconfWin.o
+ DOWN/XRegion.o
+ DOWN/XRegstFlt.o
+ DOWN/XRepWindow.o
+ DOWN/XRestackWs.o
+ DOWN/XRotProp.o
+ DOWN/XScrResStr.o
+ DOWN/XSelInput.o
+ DOWN/XSendEvent.o
+ DOWN/XSetBack.o
+ DOWN/XSetCRects.o
+ DOWN/XSetClMask.o
+ DOWN/XSetClOrig.o
+ DOWN/XSetDashes.o
+ DOWN/XSetFPath.o
+ DOWN/XSetFont.o
+ DOWN/XSetFore.o
+ DOWN/XSetFunc.o
+ DOWN/XSetHints.o
+ DOWN/XSetIFocus.o
+ DOWN/XSetLStyle.o
+ DOWN/XSetLocale.o
+ DOWN/XSetPMask.o
+ DOWN/XSetPntMap.o
+ DOWN/XSetSOwner.o
+ DOWN/XSetSSaver.o
+ DOWN/XSetStCmap.o
+ DOWN/XSetState.o
+ DOWN/XSetStip.o
+ DOWN/XSetTSOrig.o
+ DOWN/XSetTile.o
+ DOWN/XStBytes.o
+ DOWN/XStColor.o
+ DOWN/XStColors.o
+ DOWN/XStNColor.o
+ DOWN/XStName.o
+ DOWN/XSync.o
+ DOWN/XSynchro.o
+ DOWN/XText.o
+ DOWN/XText16.o
+ DOWN/XTextExt.o
+ DOWN/XTextExt16.o
+ DOWN/XTrCoords.o
+ DOWN/XUndefCurs.o
+ DOWN/XUngrabBut.o
+ DOWN/XUngrabKbd.o
+ DOWN/XUngrabKey.o
+ DOWN/XUngrabPtr.o
+ DOWN/XUngrabSvr.o
+ DOWN/XUninsCmap.o
+ DOWN/XUnldFont.o
+ DOWN/XUnmapSubs.o
+ DOWN/XUnmapWin.o
+ DOWN/XVisUtil.o
+ DOWN/XWarpPtr.o
+ DOWN/XWinEvent.o
+ DOWN/XWindow.o
+ DOWN/XWrBitF.o
+ DOWN/XcmsAddDIC.o
+ DOWN/XcmsAddSF.o
+ DOWN/XcmsAlNCol.o
+ DOWN/XcmsAllCol.o
+ DOWN/XcmsCCC.o
+ DOWN/XcmsCmap.o
+ DOWN/XcmsColNm.o
+ DOWN/XcmsCvColW.o
+ DOWN/XcmsCvCols.o
+ DOWN/XcmsIdOfPr.o
+ DOWN/XcmsInt.o
+ DOWN/XcmsLkCol.o
+ DOWN/XcmsMath.o
+ DOWN/XcmsOfCCC.o
+ DOWN/XcmsPrOfId.o
+ DOWN/XcmsProp.o
+ DOWN/XcmsQBlack.o
+ DOWN/XcmsQBlue.o
+ DOWN/XcmsQGreen.o
+ DOWN/XcmsQRed.o
+ DOWN/XcmsQWhite.o
+ DOWN/XcmsQuCol.o
+ DOWN/XcmsQuCols.o
+ DOWN/XcmsSetCCC.o
+ DOWN/XcmsSetGet.o
+ DOWN/XcmsStCol.o
+ DOWN/XcmsStCols.o
+ DOWN/XcmsTrig.o
+ DOWN/XcmsXRGB.o
+ DOWN/XlcAccess.o
+ DOWN/XlcDefLd.o
+ DOWN/XlcLoad.o
+ DOWN/XlcWrap.o
+ DOWN/XlibInt.o
+ DOWN/XmbDeGlyph.o
+ DOWN/XmbPrpText.o
+ DOWN/XmbText.o
+ DOWN/XmbTextExt.o
+ DOWN/XmbTextPer.o
+ DOWN/XmbTextPrp.o
+ DOWN/XmbWMProps.o
+ DOWN/XmbWrap.o
+ DOWN/Xrm.o
+ DOWN/Xstreams.o
+ DOWN/XwcDeGlyph.o
+ DOWN/XwcPrpText.o
+ DOWN/XwcText.o
+ DOWN/XwcTextExt.o
+ DOWN/XwcTextPer.o
+ DOWN/XwcTextPrp.o
+ DOWN/XwcWrap.o
+ #ifdef HASXDMAUTH
+ DOWN/Wraphelp.o
+ DOWN/Wrap.o
+ #endif
+ 
+ 
+ /* init section
+  */
+ 
+ /**/#init globals.o
+ _libX11__ctype  _ctype
+ _libX11__iob  _iob
+ _libX11_atoi  atoi
+ _libX11_calloc  calloc
+ _libX11_close  close
+ _libX11_connect  connect
+ _libX11_errno  errno
+ _libX11_exit  exit
+ _libX11_fclose  fclose
+ _libX11_fgets  fgets
+ _libX11_fopen  fopen
+ _libX11_fprintf  fprintf
+ _libX11_fputs  fputs
+ _libX11_free  free
+ _libX11_getenv  getenv
+ _libX11_gethostbyname  gethostbyname
+ _libX11_getpid  getpid
+ _libX11_getpwuid  getpwuid
+ _libX11_getuid  getuid
+ _libX11_htons  htons
+ _libX11_ioctl  ioctl
+ _libX11_malloc  malloc
+ _libX11_memset  memset
+ _libX11_open  open
+ _libX11_read  read
+ _libX11_realloc  realloc
+ _libX11_select  select
+ _libX11_socket  socket
+ _libX11_sprintf  sprintf
+ _libX11_sscanf  sscanf
+ _libX11_stat  stat
+ _libX11_strcat  strcat
+ _libX11_strchr  strchr
+ _libX11_strcmp  strcmp
+ _libX11_strcpy  strcpy
+ _libX11_strncmp  strncmp
+ _libX11_strncpy  strncpy
+ _libX11_strrchr  strrchr
+ _libX11_write  write
+ #ifndef SCO
+ _libX11_writev  writev
+ #else
+ _libX11_writev  _XWriteV
+ #endif
+ _libX11_XauDisposeAuth  XauDisposeAuth
+ _libX11_XauFileName  XauFileName
+ _libX11_XauGetBestAuthByAddr  XauGetBestAuthByAddr
+ _libX11_XauReadAuth  XauReadAuth
+ _libX11__Xevent_to_mask  _Xevent_to_mask
+ _libX11_ntohl  ntohl
+ _libX11_ntohs  ntohs
+ #ifndef HASXDMAUTH
+ _libX11__XdmcpAuthSetup  _no_des_dummy1
+ _libX11__XdmcpAuthDoIt  _no_des_dummy2
+ _libX11_XdmcpWrap  _no_des_dummy3
+ #endif
+ 
+ /**/#init AuGetBest.o
+ _libX11_access  access
+ 
+ /**/#init AuRead.o
+ _libX11_fread  fread
+ 
+ /**/#init XConnDis.o
+ _libX11_alarm  alarm
+ _libX11_fcntl  fcntl
+ _libX11_getmsg  getmsg
+ _libX11_grantpt  grantpt
+ _libX11_inet_addr  inet_addr
+ _libX11_ptsname  ptsname
+ _libX11_putmsg  putmsg
+ _libX11_setsockopt  setsockopt
+ _libX11_signal  signal
+ _libX11_sleep  sleep
+ _libX11_unlockpt  unlockpt
+ _libX11_strtok  strtok
+ _libX11_getsockname  getsockname
+ _libX11_time  time
+ #ifdef HASXDMAUTH
+ _libX11_XdmcpWrap  XdmcpWrap
+ #endif
+ 
+ /**/#init XCrFntSet.o
+ _libX11_tolower  tolower
+ 
+ /**/#init XGetDflt.o
+ _libX11_getpwnam  getpwnam
+ 
+ /**/#init XOpenDis.o
+ _libX11_fwrite  fwrite
+ 
+ /**/#init XRdBitF.o
+ _libX11__filbuf  _filbuf
+ 
+ /**/#init XcmsColNm.o
+ _libX11_qsort  qsort
+ _libX11_rewind  rewind
+ 
+ /**/#init XlibInt.o
+ _libX11_uname  uname
+ _libX11_sys_errlist  sys_errlist
+ _libX11_sys_nerr  sys_nerr
+ 
+ /**/#init Xrm.o
+ _libX11__flsbuf  _flsbuf
+ 
+ #ifdef HASXDMAUTH
+ /**/#init Wrap.o
+ _libX11__XdmcpAuthSetup  _XdmcpAuthSetup
+ _libX11__XdmcpAuthDoIt  _XdmcpAuthDoIt
+ #endif
+ 
+ 
+ 
+ /**/#libraries
+ /* Here can objects be specified, which will extracted from
+  * an specified archive library and then linked to the shared
+  * library. This can avoid unwanted referencing of other
+  * shared libraries.
+  * NOTE: this objects must be listed also under #objects!
+  * e.g.:
+ /lib/libc.a memcpy.o
+  * or e.g.:
+ #ifdef __GNUC__
+ GNULIB  _fixdfsi.o
+ #endif
+  *
+  * NOT USED YET
+  *
+  */
+ 
+ /**/#externals
+ /* Here you can specify objects which will only linked to the
+  * host shared library.
+  * That are e.g. objects which contain only big data you want
+  * to seperate from the text section. (See mit/util/mksv3shlib/README.)
+  */
+ 
+ /* There must be a comment as last line */
diff -c mit/lib/X/Ximp/XimpLCUtil.c:1.1.1.4 mit/lib/X/Ximp/XimpLCUtil.c:1.2
*** mit/lib/X/Ximp/XimpLCUtil.c:1.1.1.4	Sat Mar 12 00:37:36 1994
--- mit/lib/X/Ximp/XimpLCUtil.c	Sat Mar 12 00:37:36 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/X/Ximp/XimpLCUtil.c,v 1.2 1993/04/09 11:27:51 dawes Exp $ */
  /* $XConsortium: XimpLCUtil.c,v 1.8 92/10/19 19:24:49 rws Exp $ */
  /*
   * Copyright 1990, 1991, 1992 by TOSHIBA Corp.
***************
*** 226,231 ****
--- 227,237 ----
  	    return fd;
      }
  #endif
+     if (dir = getenv("XWINHOME")) {
+ 	sprintf(buf, "%s/lib/X11/%s", dir, locale_file);
+ 	if (fd = fopen(buf, "r"))
+ 	    return fd;
+     }
      sprintf(buf, "%s/%s", XLIBI18N_PATH, locale_file);
  
      return fopen(buf, "r");
diff -c mit/lib/X/Xsi/XConnIM.c:1.1.1.3 mit/lib/X/Xsi/XConnIM.c:1.4
*** mit/lib/X/Xsi/XConnIM.c:1.1.1.3	Sat Mar 12 00:37:39 1994
--- mit/lib/X/Xsi/XConnIM.c	Sat Mar 12 00:37:39 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/Xsi/XConnIM.c,v 1.4 1993/03/21 06:17:58 dawes Exp $
   * $XConsortium: XConnIM.c,v 1.18 92/07/29 13:55:35 rws Exp $
   */
  
***************
*** 32,45 ****
  /*
   * This is an OS dependent file. this should work on 4.3BSD.
   */
  #include "Xlibint.h"
  #include "Xlibnet.h"
  #include "Xi18nint.h"
  #include "XIMlibint.h"
! #include <X11/Xos.h>
! #ifdef TCPCONN
  #include <sys/socket.h>
  #endif
  
  #ifdef	UNIXCONN
  #include <sys/un.h>
--- 33,49 ----
  /*
   * This is an OS dependent file. this should work on 4.3BSD.
   */
+ #include <X11/Xos.h>
  #include "Xlibint.h"
  #include "Xlibnet.h"
  #include "Xi18nint.h"
  #include "XIMlibint.h"
! #if (defined(TCPCONN) && !defined(_MINIX)) || defined(UNIXCONN)
  #include <sys/socket.h>
  #endif
+ #ifdef AMTCPCONN
+ #include <server/ip/hton.h>
+ #endif
  
  #ifdef	UNIXCONN
  #include <sys/un.h>
***************
*** 70,76 ****
  #ifdef	UNIXCONN
      struct sockaddr_un	saddr;		/* UNIX domain socket address */
  #endif	/* UNIXCONN */
! #ifdef TCPCONN
      struct sockaddr_in	saddr_in;	/* INET domain socket address */
      struct hostent	*hp;
      unsigned short	port;
--- 74,80 ----
  #ifdef	UNIXCONN
      struct sockaddr_un	saddr;		/* UNIX domain socket address */
  #endif	/* UNIXCONN */
! #if defined(TCPCONN) && !defined(_MINIX)
      struct sockaddr_in	saddr_in;	/* INET domain socket address */
      struct hostent	*hp;
      unsigned short	port;
***************
*** 97,103 ****
  		       &byte_after, &prop);
      bcopy((char *)prop, im_hostname, hname_size);
      bcopy((char *)(prop + offset_of_portnumber), (char *)&s, portnumber_size);
! #ifdef TCPCONN
      port = ntohs(s);
  #endif
      bcopy((char *)(prop + offset_of_version), (char *)&i, version_size);
--- 101,107 ----
  		       &byte_after, &prop);
      bcopy((char *)prop, im_hostname, hname_size);
      bcopy((char *)(prop + offset_of_portnumber), (char *)&s, portnumber_size);
! #if defined(TCPCONN) && !defined(_MINIX)
      port = ntohs(s);
  #endif
      bcopy((char *)(prop + offset_of_version), (char *)&i, version_size);
***************
*** 108,114 ****
      if (im->major_version != XIM_MAJOR_VERSION) return(False);
      if (!(im->minor_version >= XIM_MINOR_VERSION)) return(False);
  
! #ifdef TCPCONN
      /*
       * Attempts to open INET domain socket.
       */
--- 112,118 ----
      if (im->major_version != XIM_MAJOR_VERSION) return(False);
      if (!(im->minor_version >= XIM_MINOR_VERSION)) return(False);
  
! #if defined(TCPCONN) && !defined(_MINIX)
      /*
       * Attempts to open INET domain socket.
       */
***************
*** 118,124 ****
  	saddr_in.sin_family = AF_INET;
  	saddr_in.sin_port = htons(port);
  	if ((sd = socket(AF_INET, SOCK_STREAM, 0)) >= 0) {
! 	    if (connect(sd, &saddr_in, sizeof(saddr_in)) >= 0) {
  		inet_ok = 1;
  	    } else {
  		close(sd);
--- 122,129 ----
  	saddr_in.sin_family = AF_INET;
  	saddr_in.sin_port = htons(port);
  	if ((sd = socket(AF_INET, SOCK_STREAM, 0)) >= 0) {
! 	    if (connect(sd, (struct sockaddr *)&saddr_in, sizeof(saddr_in))
!                 >= 0) {
  		inet_ok = 1;
  	    } else {
  		close(sd);
***************
*** 137,143 ****
  	if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
  	    return(False);
  	}
! 	if (connect(sd, &saddr, strlen(saddr.sun_path)+sizeof(saddr.sun_family)) < 0) {
  	    close(sd);
  	    return(False);
  	}
--- 142,149 ----
  	if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
  	    return(False);
  	}
! 	if (connect(sd, (struct sockaddr *)&saddr,
!                     strlen(saddr.sun_path)+sizeof(saddr.sun_family)) < 0) {
  	    close(sd);
  	    return(False);
  	}
diff -c mit/lib/X/Xsi/XLocalIM.c:1.1.1.5 mit/lib/X/Xsi/XLocalIM.c:1.2
*** mit/lib/X/Xsi/XLocalIM.c:1.1.1.5	Sat Mar 12 00:37:41 1994
--- mit/lib/X/Xsi/XLocalIM.c	Sat Mar 12 00:37:41 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/Xsi/XLocalIM.c,v 1.2 1993/04/09 11:28:06 dawes Exp $
   * $XConsortium: XLocalIM.c,v 1.11 92/10/22 14:26:20 rws Exp $
   */
  
***************
*** 528,539 ****
      char	*path;
      char	*dir;
      char	*env;
  
      if ((env = getenv("XNLSPATH")) == NULL) {
! 	env = XNLSPATHDEFAULT;
      }
      path = nlspath;
!     strcpy(path, env);
      while (1) {
  	if (path == NULL) {
  	    fprintf(stderr, "%s \"%s\".\n%s%s%s.\n",
--- 529,549 ----
      char	*path;
      char	*dir;
      char	*env;
+     char	*xwinhome = NULL;
  
      if ((env = getenv("XNLSPATH")) == NULL) {
! 	if ((xwinhome = getenv("XWINHOME")) == NULL) {
! 	    env = XNLSPATHDEFAULT;
! 	}
      }
      path = nlspath;
!     if (xwinhome) {
! 	strcpy(path, xwinhome);
! 	strcat(path, "/lib/X11/nls");
!     }
!     else {
! 	strcpy(path, env);
!     }
      while (1) {
  	if (path == NULL) {
  	    fprintf(stderr, "%s \"%s\".\n%s%s%s.\n",
diff -c mit/lib/X/Xsi/XOpenIM.c:1.1.1.2 mit/lib/X/Xsi/XOpenIM.c:1.4
*** mit/lib/X/Xsi/XOpenIM.c:1.1.1.2	Sat Mar 12 00:37:42 1994
--- mit/lib/X/Xsi/XOpenIM.c	Sat Mar 12 00:37:42 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/Xsi/XOpenIM.c,v 1.4 1993/05/24 12:36:48 dawes Exp $
   * $XConsortium: XOpenIM.c,v 1.19 92/07/28 17:52:13 rws Exp $
   */
  
***************
*** 29,34 ****
--- 30,39 ----
   *				kuwa%omron.co.jp@uunet.uu.net
   */				
  
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
+ 
  #include "Xlibint.h"
  #include "Xi18nint.h"
  #include "XIMlibint.h"
***************
*** 38,44 ****
--- 43,51 ----
  extern char *getenv();
  #endif
  #ifdef X_NOT_POSIX
+ #ifndef SCO324
  extern int getuid();
+ #endif
  #endif
  
  #if __STDC__ && !defined(NORCONST)
diff -c mit/lib/X/Xsi/XlcLoad.c:1.1.1.5 mit/lib/X/Xsi/XlcLoad.c:2.0
*** mit/lib/X/Xsi/XlcLoad.c:1.1.1.5	Sat Mar 12 00:37:42 1994
--- mit/lib/X/Xsi/XlcLoad.c	Sat Mar 12 00:37:42 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/X/Xsi/XlcLoad.c,v 2.0 1994/02/10 21:23:39 dawes Exp $
   * $XConsortium: XlcLoad.c,v 1.44 92/12/14 09:22:48 rws Exp $
   */
  
***************
*** 38,43 ****
--- 39,48 ----
  #include "Xi18nint.h"
  #include <X11/Xos.h>
  
+ #if (BSD >= 199103)
+ #define fgetline Xfgetline
+ #endif
+ 
  #if __STDC__ && !defined(NORCONST)
  #define RConst const
  #else
***************
*** 792,797 ****
--- 797,803 ----
      char 	       *path;
      char	       *dir;
      char 	       *env;
+     char 	       *xwinhome = NULL;
  
      LockMutex(&lock);
      if (NLSDir != NULL) {
***************
*** 799,808 ****
  	return;
      }
      if ((env = getenv("XNLSPATH")) == NULL) {
! 	env = XNLSPATHDEFAULT;
      }
      path = nlspath;
!     strcpy(path, env);
  
      while (1) {
  	if (path == NULL) {
--- 805,822 ----
  	return;
      }
      if ((env = getenv("XNLSPATH")) == NULL) {
! 	if ((xwinhome = getenv("XWINHOME")) == NULL) {
! 	    env = XNLSPATHDEFAULT;
! 	}
      }
      path = nlspath;
!     if (xwinhome) {
! 	strcpy(path, xwinhome);
! 	strcat(path, "/lib/X11/nls");
!     }
!     else {
! 	strcpy(path, env);
!     }
  
      while (1) {
  	if (path == NULL) {
diff -c mit/lib/Xau/AuDispose.c:1.1.1.1 mit/lib/Xau/AuDispose.c:1.3
*** mit/lib/Xau/AuDispose.c:1.1.1.1	Sat Mar 12 00:37:45 1994
--- mit/lib/Xau/AuDispose.c	Sat Mar 12 00:37:45 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * Xau - X Authorization Database Library
   *
+  * $XFree86: mit/lib/Xau/AuDispose.c,v 1.3 1993/03/27 09:15:03 dawes Exp $
   * $XConsortium: AuDispose.c,v 1.3 91/01/08 15:08:21 gildea Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 19,24 ****
--- 20,29 ----
   */
  
  #include <X11/Xauth.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef XauDisposeAuth
+ #endif
  
  void
  XauDisposeAuth (auth)
diff -c mit/lib/Xau/AuFileName.c:1.1.1.1 mit/lib/Xau/AuFileName.c:1.3
*** mit/lib/Xau/AuFileName.c:1.1.1.1	Sat Mar 12 00:37:46 1994
--- mit/lib/Xau/AuFileName.c	Sat Mar 12 00:37:46 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * Xau - X Authorization Database Library
   *
+  * $XFree86: mit/lib/Xau/AuFileName.c,v 1.3 1993/03/27 09:15:05 dawes Exp $
   * $XConsortium: AuFileName.c,v 1.2 91/01/08 15:09:00 gildea Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 20,30 ****
  
  #include <X11/Xauth.h>
  
  char *
  XauFileName ()
  {
!     char    *name, *malloc (), *getenv ();
!     char    *strcat (), *strcpy ();
      static char	*buf;
      static int	bsize;
      int	    size;
--- 21,35 ----
  
  #include <X11/Xauth.h>
  
+ #ifdef SVR3SHLIB
+ #undef XauFileName
+ #endif
+ 
  char *
  XauFileName ()
  {
!     char    *name; extern char *malloc (), *getenv ();
!     extern char    *strcat (), *strcpy ();
      static char	*buf;
      static int	bsize;
      int	    size;
diff -c mit/lib/Xau/AuGetBest.c:1.1.1.1 mit/lib/Xau/AuGetBest.c:1.3
*** mit/lib/Xau/AuGetBest.c:1.1.1.1	Sat Mar 12 00:37:46 1994
--- mit/lib/Xau/AuGetBest.c	Sat Mar 12 00:37:46 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * Xau - X Authorization Database Library
   *
+  * $XFree86: mit/lib/Xau/AuGetBest.c,v 1.3 1993/03/27 09:15:06 dawes Exp $
   * $XConsortium: AuGetBest.c,v 1.4 91/01/08 15:09:20 gildea Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 20,25 ****
--- 21,30 ----
  
  #include <X11/Xauth.h>
  #include <X11/Xos.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef XauGetBestAuthByAddr
+ #endif
  
  static
  binaryEqual (a, b, len)
diff -c mit/lib/Xau/AuRead.c:1.1.1.1 mit/lib/Xau/AuRead.c:1.3
*** mit/lib/Xau/AuRead.c:1.1.1.1	Sat Mar 12 00:37:47 1994
--- mit/lib/Xau/AuRead.c	Sat Mar 12 00:37:47 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * Xau - X Authorization Database Library
   *
+  * $XFree86: mit/lib/Xau/AuRead.c,v 1.3 1993/03/27 09:15:07 dawes Exp $
   * $XConsortium: AuRead.c,v 1.5 91/01/08 15:09:31 gildea Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 20,25 ****
--- 21,30 ----
  
  #include <X11/Xauth.h>
  
+ #ifdef SVR3SHLIB
+ #undef XauReadAuth
+ #endif
+ 
  static
  read_short (shortp, file)
  unsigned short	*shortp;
***************
*** 40,46 ****
  FILE	*file;
  {
      unsigned short  len;
!     char	    *data, *malloc ();
  
      if (read_short (&len, file) == 0)
  	return 0;
--- 45,51 ----
  FILE	*file;
  {
      unsigned short  len;
!     char	    *data;   extern char *malloc ();
  
      if (read_short (&len, file) == 0)
  	return 0;
***************
*** 66,72 ****
  {
      Xauth   local;
      Xauth   *ret;
!     char    *malloc ();
  
      if (read_short (&local.family, auth_file) == 0)
  	return 0;
--- 71,77 ----
  {
      Xauth   local;
      Xauth   *ret;
!     extern char    *malloc ();
  
      if (read_short (&local.family, auth_file) == 0)
  	return 0;
diff -c mit/lib/Xau/Imakefile:1.1.1.1 mit/lib/Xau/Imakefile:1.4
*** mit/lib/Xau/Imakefile:1.1.1.1	Sat Mar 12 00:37:47 1994
--- mit/lib/Xau/Imakefile	Sat Mar 12 00:37:47 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/lib/Xau/Imakefile,v 1.4 1993/03/27 09:15:09 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.18 91/07/16 22:53:38 gildea Exp $
  #define DoNormalLib NormalLibXau
  #define DoSharedLib SharedLibXau
***************
*** 34,39 ****
--- 35,42 ----
  
  LintLibraryTarget(Xau,$(SRCS))
  InstallLintLibrary(Xau,$(LINTLIBDIR))
+ 
+ InstallLinkKitLibrary(Xau,$(LINKKITDIR)/lib)
  
  BuildIncludes($(HEADERS),.,.)
  InstallMultiple($(HEADERS),$(INCDIR))
diff -c mit/lib/Xaw/AllWidgets.c:1.1.1.1 mit/lib/Xaw/AllWidgets.c:1.3
*** mit/lib/Xaw/AllWidgets.c:1.1.1.1	Sat Mar 12 00:37:54 1994
--- mit/lib/Xaw/AllWidgets.c	Sat Mar 12 00:37:54 1994
***************
*** 2,7 ****
--- 2,8 ----
   * This file is generated by the genlist.sh script and contains an array of
   * all the widgets in Athena widget set.
   *
+  * $XFree86: mit/lib/Xaw/AllWidgets.c,v 1.3 1993/03/27 09:09:31 dawes Exp $
   * $XConsortium: AllWidgets.c,v 1.4 90/03/02 15:34:13 jim Exp $
   */
  #include <X11/IntrinsicP.h>
***************
*** 51,56 ****
--- 52,58 ----
  extern WidgetClass viewportWidgetClass;
  extern WidgetClass wmShellWidgetClass;
  
+ #ifndef SVR3SHLIB
  XmuWidgetNode XawWidgetArray[] = {
  { "applicationShell", &applicationShellWidgetClass },
  { "asciiSink", &asciiSinkObjectClass },
***************
*** 98,101 ****
--- 100,159 ----
  };
  
  int XawWidgetCount = XtNumber(XawWidgetArray);
+ 
+ #else /* SVR3SHLIB */
+ 
+ /* WidgetClass pointer will be initialized during runtime */
+ 
+ XmuWidgetNode XawWidgetArray[] = {
+ { "applicationShell" },
+ { "asciiSink" },
+ { "asciiSrc" },
+ { "asciiText" },
+ { "box" },
+ { "clock" },
+ { "command" },
+ { "composite" },
+ { "constraint" },
+ { "core" },
+ { "dialog" },
+ { "form" },
+ { "grip" },
+ { "label" },
+ { "list" },
+ { "logo" },
+ { "mailbox" },
+ { "menuButton" },
+ { "object" },
+ { "overrideShell" },
+ { "paned" },
+ { "panner" },
+ { "porthole" },
+ { "rect" },
+ { "repeater" },
+ { "scrollbar" },
+ { "shell" },
+ { "simpleMenu" },
+ { "simple" },
+ { "smeBSB" },
+ { "smeLine" },
+ { "sme" },
+ { "stripChart" },
+ { "textSink" },
+ { "textSrc" },
+ { "text" },
+ { "toggle" },
+ { "topLevelShell" },
+ { "transientShell" },
+ { "tree" },
+ { "vendorShell" },
+ { "viewport" },
+ { "wmShell" },
+ };
+ 
+ XmuWidgetNode __arr__[FUTURE_WIDGET_COUNT] = {0};
+ 
+ int XawWidgetCount = XtNumber(XawWidgetArray);
+ 
+ #endif
  
diff -c mit/lib/Xaw/AsciiSink.c:1.1.1.1 mit/lib/Xaw/AsciiSink.c:1.3
*** mit/lib/Xaw/AsciiSink.c:1.1.1.1	Sat Mar 12 00:37:55 1994
--- mit/lib/Xaw/AsciiSink.c	Sat Mar 12 00:37:55 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/AsciiSink.c,v 1.3 1993/03/27 09:09:35 dawes Exp $ */
  /* $XConsortium: AsciiSink.c,v 1.57 91/07/21 20:35:00 converse Exp $ */
  
  /***********************************************************
***************
*** 58,64 ****
--- 59,69 ----
  };
  #undef offset
  
+ #ifndef SVR3SHLIB
  #define SuperClass		(&textSinkClassRec)
+ #else
+ #define SuperClass		NULL
+ #endif
  AsciiSinkClassRec asciiSinkClassRec = {
    {
  /* core_class fields */	
***************
*** 113,120 ****
      /* unused			*/	0
    }
  };
! 
  WidgetClass asciiSinkObjectClass = (WidgetClass)&asciiSinkClassRec;
  
  /* Utilities */
  
--- 118,129 ----
      /* unused			*/	0
    }
  };
! #ifndef SVR3SHLIB
  WidgetClass asciiSinkObjectClass = (WidgetClass)&asciiSinkClassRec;
+ #else
+ extern WidgetClass asciiSinkObjectClass;
+ #define _XtInherit  (*_libXt__XtInherit)
+ #endif
  
  /* Utilities */
  
diff -c mit/lib/Xaw/AsciiSrc.c:1.1.1.1 mit/lib/Xaw/AsciiSrc.c:2.0
*** mit/lib/Xaw/AsciiSrc.c:1.1.1.1	Sat Mar 12 00:37:56 1994
--- mit/lib/Xaw/AsciiSrc.c	Sat Mar 12 00:37:56 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/AsciiSrc.c,v 2.0 1993/11/07 14:06:48 dawes Exp $ */
  /* $XConsortium: AsciiSrc.c,v 1.55 91/07/25 18:09:27 rws Exp $ */
  
  /*
***************
*** 91,100 ****
  static void ClassInitialize(), Initialize(), Destroy(), GetValuesHook();
  static String MyStrncpy(), StorePiecesInString();
  static Boolean SetValues(), WriteToFile();
! extern int errno, sys_nerr;
  extern char* sys_errlist[];
  
  #define superclass		(&textSrcClassRec)
  AsciiSrcClassRec asciiSrcClassRec = {
    {
  /* core_class fields */	
--- 92,110 ----
  static void ClassInitialize(), Initialize(), Destroy(), GetValuesHook();
  static String MyStrncpy(), StorePiecesInString();
  static Boolean SetValues(), WriteToFile();
! extern int errno;
! #ifndef X_NO_STRERROR
! #include <string.h>
! #else
! extern int sys_nerr;
  extern char* sys_errlist[];
+ #endif
  
+ #ifndef SVR3SHLIB
  #define superclass		(&textSrcClassRec)
+ #else
+ #define superclass		NULL
+ #endif
  AsciiSrcClassRec asciiSrcClassRec = {
    {
  /* core_class fields */	
***************
*** 142,152 ****
    },
  /* asciiSrc_class fields */
    {
!     /* Keep the compiler happy */       NULL
    }
  };
! 
  WidgetClass asciiSrcObjectClass = (WidgetClass)&asciiSrcClassRec;
  
  /************************************************************
   *
--- 152,165 ----
    },
  /* asciiSrc_class fields */
    {
!     /* Keep the compiler happy */       0
    }
  };
! #ifndef SVR3SHLIB
  WidgetClass asciiSrcObjectClass = (WidgetClass)&asciiSrcClassRec;
+ #else
+ extern WidgetClass asciiSrcObjectClass;
+ #endif
  
  /************************************************************
   *
***************
*** 991,996 ****
--- 1004,1012 ----
  	    char msg[11];
  	    
  	    params[0] = src->ascii_src.string;
+ #ifndef X_NO_STRERROR
+ 	    params[1] = strerror(errno);
+ #else
  	    if (errno <= sys_nerr)
  		params[1] = sys_errlist[errno];
  	    else {
***************
*** 997,1002 ****
--- 1013,1019 ----
  		sprintf(msg, "errno=%.4d", errno);
  		params[1] = msg;
  	    }
+ #endif
  	    XtAppWarningMsg(XtWidgetToApplicationContext((Widget)src),
  			    "openError", "asciiSourceCreate", "XawWarning",
  			    "Cannot open file %s; %s", params, &num_params);
diff -c mit/lib/Xaw/AsciiText.c:1.1.1.1 mit/lib/Xaw/AsciiText.c:1.3
*** mit/lib/Xaw/AsciiText.c:1.1.1.1	Sat Mar 12 00:37:57 1994
--- mit/lib/Xaw/AsciiText.c	Sat Mar 12 00:37:57 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/AsciiText.c,v 1.3 1993/03/27 09:09:37 dawes Exp $ */
  /* $XConsortium: AsciiText.c,v 1.44 91/07/12 11:27:23 converse Exp $ */
  
  /*
***************
*** 59,65 ****
--- 60,70 ----
  
  AsciiTextClassRec asciiTextClassRec = {
    { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass       */      (WidgetClass) &textClassRec,
+ #else
+     /* superclass       */      NULL,
+ #endif
      /* class_name       */      "Text",
      /* widget_size      */      sizeof(AsciiRec),
      /* class_initialize */      XawInitializeWidgetSet,
***************
*** 100,107 ****
      /* empty            */      0
    }
  };
! 
  WidgetClass asciiTextWidgetClass = (WidgetClass)&asciiTextClassRec;
  
  
  static void
--- 105,115 ----
      /* empty            */      0
    }
  };
! #ifndef SVR3SHLIB
  WidgetClass asciiTextWidgetClass = (WidgetClass)&asciiTextClassRec;
+ #else
+ extern WidgetClass asciiTextWidgetClass;
+ #endif
  
  
  static void
diff -c mit/lib/Xaw/Box.c:1.1.1.1 mit/lib/Xaw/Box.c:1.3
*** mit/lib/Xaw/Box.c:1.1.1.1	Sat Mar 12 00:37:57 1994
--- mit/lib/Xaw/Box.c	Sat Mar 12 00:37:57 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Box.c,v 1.3 1993/03/27 09:09:40 dawes Exp $ */
  /* $XConsortium: Box.c,v 1.45 90/12/31 10:22:09 gildea Exp $ */
  
  /***********************************************************
***************
*** 72,78 ****
--- 73,83 ----
  BoxClassRec boxClassRec = {
    {
  /* core_class fields      */
+ #ifndef SVR3SHLIB
      /* superclass         */    (WidgetClass) &compositeClassRec,
+ #else
+     /* superclass         */    NULL,
+ #endif
      /* class_name         */    "Box",
      /* widget_size        */    sizeof(BoxRec),
      /* class_initialize   */    ClassInitialize,
***************
*** 117,123 ****
--- 122,132 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass boxWidgetClass = (WidgetClass)&boxClassRec;
+ #else
+ extern WidgetClass boxWidgetClass;
+ #endif
  
  
  /****************************************************************
diff -c /dev/null mit/lib/Xaw/ChkShlibRev.c:1.2
*** /dev/null	Sat Mar 12 00:37:58 1994
--- mit/lib/Xaw/ChkShlibRev.c	Sat Mar 12 00:37:58 1994
***************
*** 0 ****
--- 1,34 ----
+ /* libXaw: ChkShlibRev.c
+  *
+  * This code is linked to the clients and is called by their .init sections.
+  * It checks the SVR3 target shared library revision.
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/ChkShlibRev.c,v 1.2 1993/03/27 09:09:42 dawes Exp $
+  */
+ 
+ #include <stdio.h>
+ 
+ #ifdef SVR3SHLIB
+ #ifdef __STDC__
+ #define Const const
+ #else
+ #define Const /**/
+ #endif
+ 
+ extern Const char *_shared_libXaw_version;
+ 
+ void __check_libXaw_rev_()
+ {
+ 
+   /* check revision
+    */
+ 
+   if(strcmp(_shared_libXaw_version, SOXAWREV))
+ 	fprintf(stderr, "Warning: %s has other revision (%s) than expected"
+ 			" %s\n", TARGET, _shared_libXaw_version, SOXAWREV);
+ 
+ }
+ #endif
+ 
diff -c mit/lib/Xaw/Clock.c:1.1.1.1 mit/lib/Xaw/Clock.c:1.3
*** mit/lib/Xaw/Clock.c:1.1.1.1	Sat Mar 12 00:37:58 1994
--- mit/lib/Xaw/Clock.c	Sat Mar 12 00:37:59 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Clock.c,v 1.3 1993/03/27 09:09:44 dawes Exp $ */
  /* $XConsortium: Clock.c,v 1.65 91/08/14 12:12:56 rws Exp $ */
  
  /***********************************************************
***************
*** 103,109 ****
--- 104,114 ----
  
  ClockClassRec clockClassRec = {
      { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass		*/	(WidgetClass) &simpleClassRec,
+ #else
+     /* superclass		*/	NULL,
+ #endif
      /* class_name		*/	"Clock",
      /* widget_size		*/	sizeof(ClockRec),
      /* class_initialize		*/	ClassInitialize,
***************
*** 144,150 ****
--- 149,159 ----
      }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass clockWidgetClass = (WidgetClass) &clockClassRec;
+ #else
+ extern WidgetClass clockWidgetClass;
+ #endif
  
  /****************************************************************
   *
diff -c mit/lib/Xaw/Command.c:1.1.1.1 mit/lib/Xaw/Command.c:1.3
*** mit/lib/Xaw/Command.c:1.1.1.1	Sat Mar 12 00:37:59 1994
--- mit/lib/Xaw/Command.c	Sat Mar 12 00:37:59 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Command.c,v 1.3 1993/03/27 09:09:47 dawes Exp $ */
  /* $XConsortium: Command.c,v 1.76 91/05/04 19:29:00 converse Exp $ */
  
  /***********************************************************
***************
*** 84,94 ****
--- 85,103 ----
    {"unhighlight",	Unhighlight}
  };
  
+ #ifndef SVR3SHLIB
  #define SuperClass ((LabelWidgetClass)&labelClassRec)
+ #else
+ #define SuperClass ((LabelWidgetClass)labelWidgetClass)
+ #endif
  
  CommandClassRec commandClassRec = {
    {
+ #ifndef SVR3SHLIB
      (WidgetClass) SuperClass,		/* superclass		  */	
+ #else
+     NULL,				/* superclass		  */	
+ #endif
      "Command",				/* class_name		  */
      sizeof(CommandRec),			/* size			  */
      ClassInitialize,			/* class_initialize	  */
***************
*** 133,139 ****
--- 142,152 ----
  };
  
    /* for public consumption */
+ #ifndef SVR3SHLIB
  WidgetClass commandWidgetClass = (WidgetClass) &commandClassRec;
+ #else
+ extern WidgetClass commandWidgetClass;
+ #endif
  
  /****************************************************************
   *
diff -c mit/lib/Xaw/Dialog.c:1.1.1.1 mit/lib/Xaw/Dialog.c:1.3
*** mit/lib/Xaw/Dialog.c:1.1.1.1	Sat Mar 12 00:38:00 1994
--- mit/lib/Xaw/Dialog.c	Sat Mar 12 00:38:00 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Dialog.c,v 1.3 1993/03/27 09:09:49 dawes Exp $ */
  /* $XConsortium: Dialog.c,v 1.45 91/03/21 14:38:27 dave Exp $ */
  
  /***********************************************************
***************
*** 68,74 ****
--- 69,79 ----
  
  DialogClassRec dialogClassRec = {
    { /* core_class fields */
+ #ifndef SVR3SHLIB
      /* superclass         */    (WidgetClass) &formClassRec,
+ #else
+     /* superclass         */    NULL,
+ #endif
      /* class_name         */    "Dialog",
      /* widget_size        */    sizeof(DialogRec),
      /* class_initialize   */    XawInitializeWidgetSet,
***************
*** 125,131 ****
--- 130,140 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass dialogWidgetClass = (WidgetClass)&dialogClassRec;
+ #else
+ extern WidgetClass dialogWidgetClass;
+ #endif
  
  /* ARGSUSED */
  static void Initialize(request, new)
diff -c mit/lib/Xaw/Form.c:1.1.1.1 mit/lib/Xaw/Form.c:1.3
*** mit/lib/Xaw/Form.c:1.1.1.1	Sat Mar 12 00:38:00 1994
--- mit/lib/Xaw/Form.c	Sat Mar 12 00:38:01 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Form.c,v 1.3 1993/03/27 09:09:52 dawes Exp $ */
  /* $XConsortium: Form.c,v 1.48 91/07/22 18:08:25 ackerman Exp $ */
  
  /***********************************************************
***************
*** 78,84 ****
--- 79,89 ----
  
  FormClassRec formClassRec = {
    { /* core_class fields */
+ #ifndef SVR3SHLIB
      /* superclass         */    (WidgetClass) &constraintClassRec,
+ #else
+     /* superclass         */    NULL,
+ #endif
      /* class_name         */    "Form",
      /* widget_size        */    sizeof(FormRec),
      /* class_initialize   */    ClassInitialize,
***************
*** 132,138 ****
--- 137,147 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass formWidgetClass = (WidgetClass)&formClassRec;
+ #else
+ extern WidgetClass formWidgetClass;
+ #endif
  
  /****************************************************************
   *
diff -c mit/lib/Xaw/Grip.c:1.1.1.1 mit/lib/Xaw/Grip.c:1.3
*** mit/lib/Xaw/Grip.c:1.1.1.1	Sat Mar 12 00:38:01 1994
--- mit/lib/Xaw/Grip.c	Sat Mar 12 00:38:01 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Grip.c,v 1.3 1993/03/27 09:09:54 dawes Exp $ */
  /* $XConsortium: Grip.c,v 1.31 91/07/21 18:53:29 gildea Exp $ */
  
  /***********************************************************
***************
*** 56,62 ****
--- 57,67 ----
    {"GripAction",      GripAction},
  };
  
+ #ifndef SVR3SHLIB
  #define SuperClass (&simpleClassRec)
+ #else
+ #define SuperClass NULL
+ #endif
  
  GripClassRec gripClassRec = {
     {
***************
*** 100,106 ****
--- 105,115 ----
     }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass gripWidgetClass = (WidgetClass) &gripClassRec;
+ #else
+ extern WidgetClass gripWidgetClass;
+ #endif
  
  static void GripAction( widget, event, params, num_params )
      Widget widget;
diff -c mit/lib/Xaw/Imakefile:1.1.1.1 mit/lib/Xaw/Imakefile:2.0
*** mit/lib/Xaw/Imakefile:1.1.1.1	Sat Mar 12 00:38:02 1994
--- mit/lib/Xaw/Imakefile	Sat Mar 12 00:38:02 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/lib/Xaw/Imakefile,v 2.0 1993/08/28 07:44:34 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.78 91/09/18 14:28:23 rws Exp $
  #define DoNormalLib NormalLibXaw
  #define DoSharedLib SharedLibXaw
***************
*** 121,127 ****
  	Vendor.c \
  	Viewport.c \
  	XawInit.c \
! 	sharedlib.c
  
  #if SharedDataSeparation
  UNSHAREDOBJS = AllWidgets.o sharedlib.o
--- 122,167 ----
  	Vendor.c \
  	Viewport.c \
  	XawInit.c \
! 	sharedlib.c \
! 	globals.c \
! 	InitLibStub.s \
! 	InitClnStub.s \
! 	InitLib.c \
! 	ChkShlibRev.c \
! 	dummyBind.c \
! 	pAsciiSink.c \
! 	pAsciiSrc.c \
! 	pAsciiText.c \
! 	pBox.c \
! 	pClock.c \
! 	pCommand.c \
! 	pDialog.c \
! 	pForm.c \
! 	pGrip.c \
! 	pLabel.c \
! 	pList.c \
! 	pLogo.c \
! 	pMailbox.c \
! 	pMenuBotton.c \
! 	pPaned.c \
! 	pPanner.c \
! 	pPorthole.c \
! 	pRepeater.c \
! 	pScrollbar.c \
! 	pSimple.c \
! 	pSimpleMenu.c \
! 	pSme.c \
! 	pSmeBSB.c \
! 	pSmeLine.c \
! 	pStripChart.c \
! 	pText.c \
! 	pTextSink.c \
! 	pTextSrc.c \
! 	pToggle.c \
! 	pTree.c \
! 	pVendor.c \
! 	pViewport.c \
! 	pFuture.c 
  
  #if SharedDataSeparation
  UNSHAREDOBJS = AllWidgets.o sharedlib.o
***************
*** 164,182 ****
  	Tree.o \
  	Vendor.o \
  	Viewport.o \
! 	XawInit.o 
  
  LibraryObjectRule()
  
  #if DoSharedLib && SharedDataSeparation
! SpecialObjectRule(sharedlib.o,,$(SHLIBDEF))
  #endif
  
  #if DoSharedLib
  #if DoNormalLib
  SharedLibraryTarget(Xaw,$(SOXAWREV),$(OBJS),shared,..)
  #else
  SharedLibraryTarget(Xaw,$(SOXAWREV),$(OBJS),.,.)
  #endif
  SharedLibraryDataTarget(Xaw,$(SOXAWREV),$(UNSHAREDOBJS))
  InstallSharedLibrary(Xaw,$(SOXAWREV),$(USRLIBDIR))
--- 204,279 ----
  	Tree.o \
  	Vendor.o \
  	Viewport.o \
! 	XawInit.o
  
+ #if defined(i386SVR3Architecture) && DoSharedLib
+ SVR3SHLIBOBJS = \
+ 	globals.o \
+ 	InitLibStub.o \
+ 	InitClnStub.o \
+ 	InitLib.o \
+ 	ChkShlibRev.o \
+ 	dummyBind.o \
+ 	pAsciiSink.o \
+ 	pAsciiSrc.o \
+ 	pAsciiText.o \
+ 	pBox.o \
+ 	pClock.o \
+ 	pCommand.o \
+ 	pDialog.o \
+ 	pForm.o \
+ 	pGrip.o \
+ 	pLabel.o \
+ 	pList.o \
+ 	pLogo.o \
+ 	pMailbox.o \
+ 	pMenuBotton.o \
+ 	pPaned.o \
+ 	pPanner.o \
+ 	pPorthole.o \
+ 	pRepeater.o \
+ 	pScrollbar.o \
+ 	pSimple.o \
+ 	pSimpleMenu.o \
+ 	pSme.o \
+ 	pSmeBSB.o \
+ 	pSmeLine.o \
+ 	pStripChart.o \
+ 	pText.o \
+ 	pTextSink.o \
+ 	pTextSrc.o \
+ 	pToggle.o \
+ 	pTree.o \
+ 	pVendor.o \
+ 	pViewport.o \
+ 	pFuture.o
+ #endif
+ 
  LibraryObjectRule()
  
+ #if defined(i386SVR3Architecture) && DoSharedLib
+ SpecialLibObjectRule(globals.o,$(ICONFIGFILES),-D_libXaw_import -DSOXAWREV=\"$(SOXAWREV)\")
+ SpecialLibObjectRule(ChkShlibRev.o,,-D_libXaw_import -DSOXAWREV=\"$(SOXAWREV)\" -DTARGET=\"$(LIBDIR)/shlib/libXaw.$(SOXAWREV)\")
+ SpecialLibObjectRule(InitLib.o,,-D_libXaw_import)
+ #endif
+ 
  #if DoSharedLib && SharedDataSeparation
! SpecialObjectRule(sharedlib.o,sharedlib.c,$(SHLIBDEF))
  #endif
  
  #if DoSharedLib
+ #ifndef i386SVR3Architecture
  #if DoNormalLib
  SharedLibraryTarget(Xaw,$(SOXAWREV),$(OBJS),shared,..)
  #else
  SharedLibraryTarget(Xaw,$(SOXAWREV),$(OBJS),.,.)
+ #endif
+ #else
+ #if DoNormalLib
+ SharedLibraryTarget(Xaw,$(SOXAWREV),$(OBJS) $(SVR3SHLIBOBJS),shared,..)
+ #else
+ SharedLibraryTarget(Xaw,$(SOXAWREV),$(OBJS) $(SVR3SHLIBOBJS),.,.)
+ #endif
  #endif
  SharedLibraryDataTarget(Xaw,$(SOXAWREV),$(UNSHAREDOBJS))
  InstallSharedLibrary(Xaw,$(SOXAWREV),$(USRLIBDIR))
diff -c /dev/null mit/lib/Xaw/InitClnStub.s:2.0
*** /dev/null	Sat Mar 12 00:38:02 1994
--- mit/lib/Xaw/InitClnStub.s	Sat Mar 12 00:38:02 1994
***************
*** 0 ****
--- 1,31 ----
+ 	.file	"InitClnStub.s"
+ 
+ /#####################################################################
+ /# InitClnStub.s						     #
+ /# ----------------------------------------------------------------- #
+ /# This stub goes to .init section of the client binary and calls    #
+ /# the code which binds the client to the library		     #
+ /# Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany       #
+ /# (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)		     #
+ /#####################################################################
+ 
+ /# $XFree86: mit/lib/Xaw/InitClnStub.s,v 2.0 1993/09/30 17:34:58 dawes Exp $
+ 
+ .section .init,"x" 
+ 
+ 	.align 4
+ 
+ 	.globl __bind_to_sv3shlib_
+ 
+ / bind client to library (init pointers in subclasses of the client)
+ / _bind_to_sv3shlib_() must be supplied by the client, otherwise
+ / an empty dummy function from the host shared library is linked to it
+ 
+ __bind_to_sv3shlib_:
+ 	pushl %ebp
+ 	movl %esp,%ebp
+ / call function in client
+ 	call _bind_to_sv3shlib_	
+ 	leave
+ 
+ 
diff -c /dev/null mit/lib/Xaw/InitLib.c:1.3
*** /dev/null	Sat Mar 12 00:38:02 1994
--- mit/lib/Xaw/InitLib.c	Sat Mar 12 00:38:03 1994
***************
*** 0 ****
--- 1,309 ----
+ /* libXaw: InitLib.c
+  * -----------------
+  * This code goes into .init section of the client binary.
+  * On archive libraries references like &widgetClassRec, &compositeClassRec
+  * and so on are unresolved. They will resolved during linking. So someone
+  * could define its own (e.g.) widgetClassRec and even the library code
+  * will use it gracefully (one example for this are the vendorShellClassRec's
+  * in the Toolkit, in the Athena Widgets and in the Motif widgets).
+  * On SVR3 shared lib such references are on fixed addresses. The library
+  * would never use a user defined (e.g.) vendorShellClassRec and the compiler
+  * would complain about multiply defined vendorShellClassRec.
+  * So we don't reference to (e.g.) vendorShellClassRec in the shared lib.
+  * Instead putting this code to client binary, which is resolved during
+  * linking and writes on runtime the needed addresses to the shared lib.
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/InitLib.c,v 1.3 1993/05/22 06:43:32 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xmu/WidgetNode.h>
+ #include <X11/Xaw/XawInit.h>
+ #include <X11/Xaw/AsciiSinkP.h>
+ #include <X11/Xaw/AsciiSrcP.h>
+ #include <X11/Xaw/AsciiTextP.h>
+ #include <X11/Xaw/BoxP.h>
+ #include <X11/Xaw/ClockP.h>
+ #include <X11/Xaw/CommandP.h>
+ #include <X11/Xaw/DialogP.h>
+ #include <X11/Xaw/FormP.h>
+ #include <X11/Xaw/GripP.h>
+ #include <X11/Xaw/LabelP.h>
+ #include <X11/Xaw/ListP.h>
+ #include <X11/Xaw/LogoP.h>
+ #include <X11/Xaw/MailboxP.h>
+ #include <X11/Xaw/MenuButtoP.h>
+ #include <X11/Xaw/PanedP.h>
+ #include <X11/Xaw/PannerP.h>
+ #include <X11/Xaw/PortholeP.h>
+ #include <X11/Xaw/RepeaterP.h>
+ #include <X11/Xaw/ScrollbarP.h>
+ #include <X11/Xaw/SimpleP.h>
+ #include <X11/Xaw/SimpleMenP.h>
+ #include <X11/Xaw/SmeP.h>
+ #include <X11/Xaw/SmeBSBP.h>
+ #include <X11/Xaw/SmeLineP.h>
+ #include <X11/Xaw/StripCharP.h>
+ #include <X11/Xaw/TextP.h>
+ #include <X11/Xaw/TextSinkP.h>
+ #include <X11/Xaw/TextSrcP.h>
+ #include <X11/Xaw/ToggleP.h>
+ #include <X11/Xaw/TreeP.h>
+ #include <X11/Shell.h>
+ #include <X11/ShellP.h>
+ #include <X11/Vendor.h>
+ #include <X11/VendorP.h>
+ #include <X11/Xaw/ViewportP.h>
+ 
+ #ifdef SVR3SHLIB
+ 
+ /* Check whether the named class is really from shared libXaw.
+  * It could also be user supplied. We don't know with what the user
+  * wants to initialize, so let it be in that case.
+  * 0xB1C00000 : address of libXaw's .data section
+  */
+ #define IsInLibXaw(ClassRec) ((unsigned)ClassRec & 0xFFC00000) == 0xB1C00000
+ 
+ extern WidgetClass __futureWidgetClass_0_;
+ extern WidgetClass __futureWidgetClass_1_;
+ extern WidgetClass __futureWidgetClass_2_;
+ extern WidgetClass __futureWidgetClass_3_;
+ extern WidgetClass __futureWidgetClass_4_;
+ extern WidgetClass __futureWidgetClass_5_;
+ extern WidgetClass __futureWidgetClass_6_;
+ extern WidgetClass __futureWidgetClass_7_;
+ extern WidgetClass __futureWidgetClass_8_;
+ extern WidgetClass __futureWidgetClass_9_;
+ extern WidgetClass __futureWidgetClass_10_;
+ extern WidgetClass __futureWidgetClass_11_;
+ extern WidgetClass __futureWidgetClass_12_;
+ extern WidgetClass __futureWidgetClass_13_;
+ extern WidgetClass __futureWidgetClass_14_;
+ extern WidgetClass __futureWidgetClass_15_;
+ extern WidgetClass __futureWidgetClass_16_;
+ extern WidgetClass __futureWidgetClass_17_;
+ extern WidgetClass __futureWidgetClass_18_;
+ extern WidgetClass __futureWidgetClass_19_;
+ 
+ static WidgetClass *__AllWidgets[] = {
+ &applicationShellWidgetClass,
+ &asciiSinkObjectClass,
+ &asciiSrcObjectClass,
+ &asciiTextWidgetClass,
+ &boxWidgetClass,
+ &clockWidgetClass,
+ &commandWidgetClass,
+ &compositeWidgetClass,
+ &constraintWidgetClass,
+ &coreWidgetClass,
+ &dialogWidgetClass,
+ &formWidgetClass,
+ &gripWidgetClass,
+ &labelWidgetClass,
+ &listWidgetClass,
+ &logoWidgetClass,
+ &mailboxWidgetClass,
+ &menuButtonWidgetClass,
+ &objectClass,
+ &overrideShellWidgetClass,
+ &panedWidgetClass,
+ &pannerWidgetClass,
+ &portholeWidgetClass,
+ &rectObjClass,
+ &repeaterWidgetClass,
+ &scrollbarWidgetClass,
+ &shellWidgetClass,
+ &simpleMenuWidgetClass,
+ &simpleWidgetClass,
+ &smeBSBObjectClass,
+ &smeLineObjectClass,
+ &smeObjectClass,
+ &stripChartWidgetClass,
+ &textSinkObjectClass,
+ &textSrcObjectClass,
+ &textWidgetClass,
+ &toggleWidgetClass,
+ &topLevelShellWidgetClass,
+ &transientShellWidgetClass,
+ &treeWidgetClass,
+ &vendorShellWidgetClass,
+ &viewportWidgetClass,
+ &wmShellWidgetClass,
+ /*
+  * additional widgetClass's will be on the same address like this
+  * dummy pointers, so the client will initialize them in XawWidgetArray
+  * too
+  */
+ &__futureWidgetClass_0_,
+ &__futureWidgetClass_1_,
+ &__futureWidgetClass_2_,
+ &__futureWidgetClass_3_,
+ &__futureWidgetClass_4_,
+ &__futureWidgetClass_5_,
+ &__futureWidgetClass_6_,
+ &__futureWidgetClass_7_,
+ &__futureWidgetClass_8_,
+ &__futureWidgetClass_9_,
+ &__futureWidgetClass_10_,
+ &__futureWidgetClass_11_,
+ &__futureWidgetClass_12_,
+ &__futureWidgetClass_13_,
+ &__futureWidgetClass_14_,
+ &__futureWidgetClass_15_,
+ &__futureWidgetClass_16_,
+ &__futureWidgetClass_17_,
+ &__futureWidgetClass_18_,
+ &__futureWidgetClass_19_
+ };
+ 
+ extern XmuWidgetNode XawWidgetArray[];
+ extern int XawWidgetCount;
+ extern XtActionsRec _XawTextActionsTable[];
+ 
+ void __libXaw_init_()
+ {
+   int i;
+ 
+   /* initialize XawWidgetArray at first */
+ 
+   for(i = 0 ; i < (XawWidgetCount+FUTURE_WIDGET_COUNT); i++)
+      XawWidgetArray[i].widget_class_ptr = __AllWidgets[i];
+ 
+   /* AsciiSink.c */
+   if(IsInLibXaw(asciiSinkObjectClass))
+      asciiSinkObjectClass->core_class.superclass = textSinkObjectClass;
+ 
+   /* AsciiSrc.c */
+   if(IsInLibXaw(asciiSrcObjectClass))
+      asciiSrcObjectClass->core_class.superclass = textSrcObjectClass;
+ 
+   /* AsciiText.c */
+   if(IsInLibXaw(asciiTextWidgetClass))
+      asciiTextWidgetClass->core_class.superclass = textWidgetClass;
+ 
+   /* Box.c */
+   if(IsInLibXaw(boxWidgetClass))
+      boxWidgetClass->core_class.superclass = compositeWidgetClass;
+ 
+   /* Clock.c */
+   if(IsInLibXaw(clockWidgetClass))
+      clockWidgetClass->core_class.superclass = simpleWidgetClass;
+ 
+   /* Command.c */ 
+   if(IsInLibXaw(commandWidgetClass))
+      commandWidgetClass->core_class.superclass = labelWidgetClass;
+ 
+   /* Dialog.c */
+   if(IsInLibXaw(dialogWidgetClass))
+      dialogWidgetClass->core_class.superclass = formWidgetClass;
+   
+   /* Form.c */
+   if(IsInLibXaw(formWidgetClass))
+      formWidgetClass->core_class.superclass = constraintWidgetClass;
+ 
+   /* Grip.c */
+   if(IsInLibXaw(gripWidgetClass))
+      gripWidgetClass->core_class.superclass = simpleWidgetClass;
+ 
+   /* Label.c */
+   if(IsInLibXaw(labelWidgetClass))
+      labelWidgetClass->core_class.superclass = simpleWidgetClass;
+ 
+   /* List.c */
+   if(IsInLibXaw(listWidgetClass))
+      listWidgetClass->core_class.superclass = simpleWidgetClass;
+ 
+   /* Logo.c */
+   if(IsInLibXaw(logoWidgetClass))
+      logoWidgetClass->core_class.superclass = simpleWidgetClass;
+ 
+   /* Mailbox.c */
+   if(IsInLibXaw(mailboxWidgetClass))
+      mailboxWidgetClass->core_class.superclass = simpleWidgetClass;
+ 
+   /* MenuBotton.c */
+   if(IsInLibXaw(menuButtonWidgetClass))
+      menuButtonWidgetClass->core_class.superclass = commandWidgetClass;
+ 
+   /* Paned.c */
+   if(IsInLibXaw(panedWidgetClass))
+      panedWidgetClass->core_class.superclass = constraintWidgetClass;
+ 
+   /* Panner.c */
+   if(IsInLibXaw(pannerWidgetClass))
+      pannerWidgetClass->core_class.superclass = simpleWidgetClass;
+ 
+   /* Porthole.c */
+   if(IsInLibXaw(portholeWidgetClass))
+      portholeWidgetClass->core_class.superclass = compositeWidgetClass;
+ 
+   /* Repeater.c */
+   if(IsInLibXaw(repeaterWidgetClass))
+      repeaterWidgetClass->core_class.superclass = commandWidgetClass;
+ 
+   /* Scrollbar.c */
+   if(IsInLibXaw(scrollbarWidgetClass))
+      scrollbarWidgetClass->core_class.superclass = simpleWidgetClass;
+ 
+   /* Simple.o */
+   if(IsInLibXaw(simpleWidgetClass))
+      simpleWidgetClass->core_class.superclass = widgetClass;
+ 
+   /* SimpleMenu.c */
+   if(IsInLibXaw(simpleMenuWidgetClass))
+      simpleMenuWidgetClass->core_class.superclass = overrideShellWidgetClass;
+ 
+   /* Sem.c */
+   if(IsInLibXaw(smeObjectClass))
+      smeObjectClass->core_class.superclass = rectObjClass;
+ 
+   /* SmeBSB.c */
+   if(IsInLibXaw(smeBSBObjectClass))
+      smeBSBObjectClass->core_class.superclass = smeObjectClass;
+ 
+   /* SmeLine.c */
+   if(IsInLibXaw(smeLineObjectClass))
+      smeLineObjectClass->core_class.superclass = smeObjectClass;
+ 
+   /* StripChart.c */
+   if(IsInLibXaw(stripChartWidgetClass))
+      stripChartWidgetClass->core_class.superclass = simpleWidgetClass;
+ 
+   /* Text.c */
+   if(IsInLibXaw(textWidgetClass)) {
+      textWidgetClass->core_class.superclass = simpleWidgetClass;
+      textWidgetClass->core_class.actions = _XawTextActionsTable; 
+   }
+   
+   /* TextSink.c */
+   if(IsInLibXaw(textSinkObjectClass))
+      textSinkObjectClass->core_class.superclass = objectClass;
+ 
+   /* TextSrc.c */
+   if(IsInLibXaw(textSrcObjectClass))
+      textSrcObjectClass->core_class.superclass = objectClass;
+ 
+   /* Toggle.c */
+   if(IsInLibXaw(toggleWidgetClass))
+      toggleWidgetClass->core_class.superclass = commandWidgetClass;
+ 
+   /* Tree.c */
+   if(IsInLibXaw(treeWidgetClass))
+      treeWidgetClass->core_class.superclass = constraintWidgetClass;
+ 
+   /* Vendor.c */
+   if(IsInLibXaw(vendorShellWidgetClass))
+      vendorShellWidgetClass->core_class.superclass = wmShellWidgetClass;
+ 
+   /* Viewport.c */
+   if(IsInLibXaw(viewportWidgetClass))
+      viewportWidgetClass->core_class.superclass = formWidgetClass;
+ 
+ 
+ }
+ #endif /* SVR3SHLIB */
+ 
+ 
diff -c /dev/null mit/lib/Xaw/InitLibStub.s:2.0
*** /dev/null	Sat Mar 12 00:38:03 1994
--- mit/lib/Xaw/InitLibStub.s	Sat Mar 12 00:38:04 1994
***************
*** 0 ****
--- 1,45 ----
+ 	.file	"InitLibStub.s"
+ 
+ /#####################################################################
+ /# InitLibStub.s						     #
+ /# ----------------------------------------------------------------- #
+ /# This stub goes to .init section of the client binary. It checks   #
+ /# the revision of the library and calls the init code for the       #
+ /# library							     #
+ /# Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany       #
+ /# (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)		     #
+ /#####################################################################
+ 
+ /# $XFree86: mit/lib/Xaw/InitLibStub.s,v 2.0 1993/08/22 12:35:58 dawes Exp $
+ 
+ .data
+ / create unresolved reference
+ 	.long __bind_to_sv3shlib_
+ 
+ .section .init,"x" 
+ 
+ 	.align 4
+ 	.globl __libXaw_init_stub_
+ 
+ __libXaw_init_stub_:
+ 
+ / check revision of target shared library
+ 
+         pushl %ebp
+         movl %esp,%ebp
+         call __check_libXaw_rev_
+         leave
+ 
+ / inititialize library
+ 
+         pushl %ebp
+         movl %esp,%ebp
+         call __default_libXaw_init_
+         leave
+ 
+         pushl %ebp
+         movl %esp,%ebp
+         call __libXaw_init_
+         leave
+ 
+ 
diff -c mit/lib/Xaw/Label.c:1.1.1.1 mit/lib/Xaw/Label.c:1.3
*** mit/lib/Xaw/Label.c:1.1.1.1	Sat Mar 12 00:38:05 1994
--- mit/lib/Xaw/Label.c	Sat Mar 12 00:38:05 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Label.c,v 1.3 1993/03/27 09:10:03 dawes Exp $ */
  /* $XConsortium: Label.c,v 1.92 91/07/24 16:56:28 converse Exp $ */
  
  /***********************************************************
***************
*** 91,97 ****
--- 92,102 ----
  LabelClassRec labelClassRec = {
    {
  /* core_class fields */	
+ #ifndef SVR3SHLIB
  #define superclass		(&simpleClassRec)
+ #else
+ #define superclass		NULL
+ #endif
      /* superclass	  	*/	(WidgetClass) superclass,
      /* class_name	  	*/	"Label",
      /* widget_size	  	*/	sizeof(LabelRec),
***************
*** 130,136 ****
--- 135,145 ----
      /* change_sensitive		*/	XtInheritChangeSensitive
    }
  };
+ #ifndef SVR3SHLIB
  WidgetClass labelWidgetClass = (WidgetClass)&labelClassRec;
+ #else
+ extern WidgetClass labelWidgetClass;
+ #endif
  /****************************************************************
   *
   * Private Procedures
diff -c mit/lib/Xaw/List.c:1.1.1.1 mit/lib/Xaw/List.c:1.3
*** mit/lib/Xaw/List.c:1.1.1.1	Sat Mar 12 00:38:05 1994
--- mit/lib/Xaw/List.c	Sat Mar 12 00:38:06 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/List.c,v 1.3 1993/03/27 09:10:06 dawes Exp $ */
  /* $XConsortium: List.c,v 1.34 91/09/27 18:35:07 converse Exp $ */
  
  /*
***************
*** 117,123 ****
--- 118,128 ----
  ListClassRec listClassRec = {
    {
  /* core_class fields */	
+ #ifndef SVR3SHLIB
  #define superclass		(&simpleClassRec)
+ #else
+ #define superclass		NULL
+ #endif
      /* superclass	  	*/	(WidgetClass) superclass,
      /* class_name	  	*/	"List",
      /* widget_size	  	*/	sizeof(ListRec),
***************
*** 155,161 ****
--- 160,170 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass listWidgetClass = (WidgetClass)&listClassRec;
+ #else
+ extern WidgetClass listWidgetClass;
+ #endif
  
  /****************************************************************
   *
diff -c mit/lib/Xaw/Logo.c:1.1.1.1 mit/lib/Xaw/Logo.c:1.3
*** mit/lib/Xaw/Logo.c:1.1.1.1	Sat Mar 12 00:38:06 1994
--- mit/lib/Xaw/Logo.c	Sat Mar 12 00:38:06 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Logo.c,v 1.3 1993/03/27 09:10:08 dawes Exp $ */
  /* $XConsortium: Logo.c,v 1.25 91/05/22 16:56:51 converse Exp $ */
  
  /*
***************
*** 36,42 ****
--- 37,47 ----
  
  LogoClassRec logoClassRec = {
      { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass		*/	(WidgetClass) &simpleClassRec,
+ #else
+     /* superclass		*/	NULL,
+ #endif
      /* class_name		*/	"Logo",
      /* widget_size		*/	sizeof(LogoRec),
      /* class_initialize		*/	XawInitializeWidgetSet,
***************
*** 77,83 ****
--- 82,92 ----
      }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass logoWidgetClass = (WidgetClass) &logoClassRec;
+ #else
+ extern WidgetClass logoWidgetClass;
+ #endif
  
  
  /*****************************************************************************
diff -c mit/lib/Xaw/Mailbox.c:1.1.1.1 mit/lib/Xaw/Mailbox.c:1.4
*** mit/lib/Xaw/Mailbox.c:1.1.1.1	Sat Mar 12 00:38:07 1994
--- mit/lib/Xaw/Mailbox.c	Sat Mar 12 00:38:07 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xaw/Mailbox.c,v 1.4 1993/05/04 14:59:55 dawes Exp $
   * $XConsortium: Mailbox.c,v 1.58 91/06/13 16:50:32 keith Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 22,27 ****
--- 23,35 ----
   *         XBiff*emptyPixmap:  mailempty
   */
  
+ #if defined(SVR3SHLIB) && defined(SCO)
+ extern int (*_libXaw_stat)();
+ #endif
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcpy
+ #endif
+ 
  #include <X11/IntrinsicP.h>		/* for toolkit stuff */
  #include <X11/StringDefs.h>		/* for useful atom names */
  #include <X11/cursorfont.h>		/* for cursor constants */
***************
*** 132,138 ****
--- 140,150 ----
  
  MailboxClassRec mailboxClassRec = {
      { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass		*/	(WidgetClass) &simpleClassRec,
+ #else
+     /* superclass		*/	NULL,
+ #endif
      /* class_name		*/	"Mailbox",
      /* widget_size		*/	sizeof(MailboxRec),
      /* class_initialize		*/	XawInitializeWidgetSet,
***************
*** 173,179 ****
--- 185,195 ----
      }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass mailboxWidgetClass = (WidgetClass) &mailboxClassRec;
+ #else
+ extern WidgetClass mailboxWidgetClass;
+ #endif
  
  
  /*
***************
*** 508,514 ****
  static void GetMailFile (w)
      MailboxWidget w;
  {
!     char *getlogin();
      char *username;
  
      username = getlogin ();
--- 524,530 ----
  static void GetMailFile (w)
      MailboxWidget w;
  {
!     extern char *getlogin();
      char *username;
  
      username = getlogin ();
diff -c mit/lib/Xaw/MailboxP.h:1.1.1.1 mit/lib/Xaw/MailboxP.h:2.1
*** mit/lib/Xaw/MailboxP.h:1.1.1.1	Sat Mar 12 00:38:07 1994
--- mit/lib/Xaw/MailboxP.h	Sat Mar 12 00:38:07 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xaw/MailboxP.h,v 2.1 1994/02/10 21:23:56 dawes Exp $
   * $XConsortium: MailboxP.h,v 1.20 91/07/19 21:52:57 rws Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 22,31 ****
  #include <X11/Xaw/Mailbox.h>
  #include <X11/Xaw/SimpleP.h>
  
  #ifdef SYSV
  #define MAILBOX_DIRECTORY "/usr/mail"
  #else
! #ifdef SVR4
  #define MAILBOX_DIRECTORY "/var/mail"
  #else
  #define MAILBOX_DIRECTORY "/usr/spool/mail"
--- 23,38 ----
  #include <X11/Xaw/Mailbox.h>
  #include <X11/Xaw/SimpleP.h>
  
+ #include <X11/Xos.h>
+ 
  #ifdef SYSV
+ #ifdef SCO
+ #define MAILBOX_DIRECTORY "/usr/spool/mail"
+ #else
  #define MAILBOX_DIRECTORY "/usr/mail"
+ #endif
  #else
! #if defined(SVR4) || (BSD >= 199103)
  #define MAILBOX_DIRECTORY "/var/mail"
  #else
  #define MAILBOX_DIRECTORY "/usr/spool/mail"
diff -c mit/lib/Xaw/MenuButton.c:1.1.1.1 mit/lib/Xaw/MenuButton.c:1.4
*** mit/lib/Xaw/MenuButton.c:1.1.1.1	Sat Mar 12 00:38:08 1994
--- mit/lib/Xaw/MenuButton.c	Sat Mar 12 00:38:08 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/MenuButton.c,v 1.4 1993/05/22 06:43:34 dawes Exp $ */
  /* $XConsortium: MenuButton.c,v 1.18 91/06/22 18:03:46 rws Exp $ */
  
  /*
***************
*** 52,58 ****
--- 53,63 ----
  static void ClassInitialize();
  static void PopupMenu();
  
+ #ifndef SVR3SHLIB
  #define superclass ((CommandWidgetClass)&commandClassRec)
+ #else
+ #define superclass NULL
+ #endif
  
  static char defaultTranslations[] = 
      "<EnterWindow>:     highlight()             \n\
***************
*** 130,136 ****
--- 135,145 ----
  };
  
    /* for public consumption */
+ #ifndef SVR3SHLIB
  WidgetClass menuButtonWidgetClass = (WidgetClass) &menuButtonClassRec;
+ #else
+ extern WidgetClass menuButtonWidgetClass;
+ #endif
  
  /****************************************************************
   *
diff -c mit/lib/Xaw/Paned.c:1.1.1.1 mit/lib/Xaw/Paned.c:1.3
*** mit/lib/Xaw/Paned.c:1.1.1.1	Sat Mar 12 00:38:09 1994
--- mit/lib/Xaw/Paned.c	Sat Mar 12 00:38:09 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Paned.c,v 1.3 1993/03/27 09:10:16 dawes Exp $ */
  /* $XConsortium: Paned.c,v 1.23 91/07/21 18:56:15 gildea Exp $ */
  
  /***********************************************************
***************
*** 177,188 ****
--- 178,197 ----
  static Boolean PopPaneStack();
  static void ClearPaneStack();
  
+ #ifndef SVR3SHLIB
  #define SuperClass ((ConstraintWidgetClass)&constraintClassRec)
+ #else
+ #define SuperClass ((ConstraintWidgetClass)constraintWidgetClass)
+ #endif
  
  PanedClassRec panedClassRec = {
     {
  /* core class fields */
+ #ifndef SVR3SHLIB
      /* superclass         */   (WidgetClass) SuperClass,
+ #else
+     /* superclass         */   NULL,
+ #endif
      /* class name         */   "Paned",
      /* size               */   sizeof(PanedRec),
      /* class_initialize   */   ClassInitialize,
***************
*** 233,239 ****
--- 242,252 ----
     }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass panedWidgetClass = (WidgetClass) &panedClassRec;
+ #else
+ extern WidgetClass panedWidgetClass;
+ #endif
  
  /* For compatibility. */
  WidgetClass vPanedWidgetClass = (WidgetClass) &panedClassRec;
diff -c mit/lib/Xaw/Panner.c:1.1.1.1 mit/lib/Xaw/Panner.c:2.0
*** mit/lib/Xaw/Panner.c:1.1.1.1	Sat Mar 12 00:38:10 1994
--- mit/lib/Xaw/Panner.c	Sat Mar 12 00:38:10 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xaw/Panner.c,v 2.0 1993/07/24 04:51:25 dawes Exp $
   * $XConsortium: Panner.c,v 1.45 92/03/03 13:52:26 converse Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 32,38 ****
  #include <ctype.h>			/* for isascii() etc. */
  #include <math.h>			/* for atof() */
  
! #if defined(ISC) && defined(SYSV) && defined(SYSV386) && __STDC__
  extern double atof(char *);
  #endif
  
--- 33,46 ----
  #include <ctype.h>			/* for isascii() etc. */
  #include <math.h>			/* for atof() */
  
! #if defined(ISC) && defined(__STDC__)
! #ifdef ISC30
! extern double atof(const char *);
! #else
! extern double atof();
! #endif
! #endif
! #if defined(SCO) && defined(__STDC__)
  extern double atof(char *);
  #endif
  
***************
*** 123,129 ****
--- 131,141 ----
  
  PannerClassRec pannerClassRec = {
    { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass		*/	(WidgetClass) &simpleClassRec,
+ #else
+     /* superclass		*/	NULL,
+ #endif
      /* class_name		*/	"Panner",
      /* widget_size		*/	sizeof(PannerRec),
      /* class_initialize		*/	XawInitializeWidgetSet,
***************
*** 164,170 ****
--- 176,186 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass pannerWidgetClass = (WidgetClass) &pannerClassRec;
+ #else
+ extern WidgetClass pannerWidgetClass;
+ #endif
  
  
  /*****************************************************************************
diff -c mit/lib/Xaw/Porthole.c:1.1.1.1 mit/lib/Xaw/Porthole.c:1.3
*** mit/lib/Xaw/Porthole.c:1.1.1.1	Sat Mar 12 00:38:11 1994
--- mit/lib/Xaw/Porthole.c	Sat Mar 12 00:38:11 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xaw/Porthole.c,v 1.3 1993/03/27 09:10:21 dawes Exp $
   * $XConsortium: Porthole.c,v 1.14 91/03/14 16:48:01 converse Exp $
   *
   * Copyright 1990 Massachusetts Institute of Technology
***************
*** 55,61 ****
--- 56,66 ----
  
  PortholeClassRec portholeClassRec = {
    { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass		*/	(WidgetClass) &compositeClassRec,
+ #else
+     /* superclass		*/	NULL,
+ #endif
      /* class_name		*/	"Porthole",
      /* widget_size		*/	sizeof(PortholeRec),
      /* class_initialize		*/	XawInitializeWidgetSet,
***************
*** 100,106 ****
--- 105,115 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass portholeWidgetClass = (WidgetClass) &portholeClassRec;
+ #else
+ extern WidgetClass portholeWidgetClass;
+ #endif
  
  
  /*****************************************************************************
diff -c mit/lib/Xaw/Repeater.c:1.1.1.1 mit/lib/Xaw/Repeater.c:1.3
*** mit/lib/Xaw/Repeater.c:1.1.1.1	Sat Mar 12 00:38:11 1994
--- mit/lib/Xaw/Repeater.c	Sat Mar 12 00:38:11 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xaw/Repeater.c,v 1.3 1993/03/27 09:10:23 dawes Exp $
   * $XConsortium: Repeater.c,v 1.8 91/03/14 16:48:04 converse Exp $
   *
   * Copyright 1990 Massachusetts Institute of Technology
***************
*** 101,107 ****
--- 102,112 ----
  
  RepeaterClassRec repeaterClassRec = {
    { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass		*/	(WidgetClass) &commandClassRec,
+ #else
+     /* superclass		*/	NULL,
+ #endif
      /* class_name		*/	"Repeater",
      /* widget_size		*/	sizeof(RepeaterRec),
      /* class_initialize		*/	XawInitializeWidgetSet,
***************
*** 148,154 ****
--- 153,163 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass repeaterWidgetClass = (WidgetClass) &repeaterClassRec;
+ #else
+ extern WidgetClass repeaterWidgetClass;
+ #endif
  
  
  /*****************************************************************************
diff -c mit/lib/Xaw/Scrollbar.c:1.1.1.1 mit/lib/Xaw/Scrollbar.c:1.3
*** mit/lib/Xaw/Scrollbar.c:1.1.1.1	Sat Mar 12 00:38:12 1994
--- mit/lib/Xaw/Scrollbar.c	Sat Mar 12 00:38:12 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Scrollbar.c,v 1.3 1993/03/27 09:10:26 dawes Exp $ */
  /* $XConsortium: Scrollbar.c,v 1.69 91/05/04 23:07:32 keith Exp $ */
  
  /***********************************************************
***************
*** 117,123 ****
--- 118,128 ----
  
  ScrollbarClassRec scrollbarClassRec = {
    { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass       */      (WidgetClass) &simpleClassRec,
+ #else
+     /* superclass       */      NULL,
+ #endif
      /* class_name       */      "Scrollbar",
      /* size             */      sizeof(ScrollbarRec),
      /* class_initialize	*/	ClassInitialize,
***************
*** 159,165 ****
--- 164,174 ----
  
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass scrollbarWidgetClass = (WidgetClass)&scrollbarClassRec;
+ #else
+ extern WidgetClass scrollbarWidgetClass;
+ #endif
  
  #define NoButton -1
  #define PICKLENGTH(widget, x, y) \
diff -c mit/lib/Xaw/Simple.c:1.1.1.1 mit/lib/Xaw/Simple.c:1.3
*** mit/lib/Xaw/Simple.c:1.1.1.1	Sat Mar 12 00:38:12 1994
--- mit/lib/Xaw/Simple.c	Sat Mar 12 00:38:13 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Simple.c,v 1.3 1993/03/27 09:10:28 dawes Exp $ */
  /* $XConsortium: Simple.c,v 1.33 91/07/21 13:55:23 converse Exp $ */
  
  /***********************************************************
***************
*** 52,58 ****
--- 53,63 ----
  
  SimpleClassRec simpleClassRec = {
    { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass		*/	(WidgetClass) &widgetClassRec,
+ #else
+     /* superclass		*/	NULL,
+ #endif
      /* class_name		*/	"Simple",
      /* widget_size		*/	sizeof(SimpleRec),
      /* class_initialize		*/	ClassInitialize,
***************
*** 90,96 ****
--- 95,105 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass simpleWidgetClass = (WidgetClass)&simpleClassRec;
+ #else
+ extern WidgetClass simpleWidgetClass;
+ #endif
  
  static void ClassInitialize()
  {
diff -c mit/lib/Xaw/SimpleMenu.c:1.1.1.2 mit/lib/Xaw/SimpleMenu.c:1.3
*** mit/lib/Xaw/SimpleMenu.c:1.1.1.2	Sat Mar 12 00:38:13 1994
--- mit/lib/Xaw/SimpleMenu.c	Sat Mar 12 00:38:13 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/SimpleMenu.c,v 1.3 1993/03/27 09:10:30 dawes Exp $ */
  /* $XConsortium: SimpleMenu.c,v 1.41 92/09/10 16:25:07 converse Exp $ */
  
  /*
***************
*** 135,145 ****
--- 136,154 ----
      /* accepts_objects */ TRUE,
  };
  
+ #ifndef SVR3SHLIB
  #define superclass (&overrideShellClassRec)
+ #else
+ #define superclass (overrideShellWidgetClass)
+ #endif
      
  SimpleMenuClassRec simpleMenuClassRec = {
    {
+ #ifndef SVR3SHLIB
      /* superclass         */    (WidgetClass) superclass,
+ #else
+     /* superclass         */    NULL,
+ #endif
      /* class_name         */    "SimpleMenu",
      /* size               */    sizeof(SimpleMenuRec),
      /* class_initialize   */	ClassInitialize,
***************
*** 186,192 ****
--- 195,205 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass simpleMenuWidgetClass = (WidgetClass)&simpleMenuClassRec;
+ #else
+ extern WidgetClass simpleMenuWidgetClass;
+ #endif
  
  /************************************************************
   *
diff -c mit/lib/Xaw/Sme.c:1.1.1.1 mit/lib/Xaw/Sme.c:1.3
*** mit/lib/Xaw/Sme.c:1.1.1.1	Sat Mar 12 00:38:14 1994
--- mit/lib/Xaw/Sme.c	Sat Mar 12 00:38:14 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Sme.c,v 1.3 1993/03/27 09:10:32 dawes Exp $ */
  /* $XConsortium: Sme.c,v 1.9 91/02/17 16:44:14 rws Exp $ */
  
  /*
***************
*** 54,61 ****
--- 55,67 ----
  static void Initialize();
  static XtGeometryResult QueryGeometry();
  
+ #ifndef SVR3SHLIB
  #define SUPERCLASS (&rectObjClassRec)
+ #else
+ #define SUPERCLASS NULL
+ #endif
  
+ 
  SmeClassRec smeClassRec = {
    {
      /* superclass         */    (WidgetClass) SUPERCLASS,
***************
*** 100,106 ****
--- 106,116 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass smeObjectClass = (WidgetClass) &smeClassRec;
+ #else
+ extern WidgetClass smeObjectClass;
+ #endif
  
  /************************************************************
   *
diff -c mit/lib/Xaw/SmeBSB.c:1.1.1.1 mit/lib/Xaw/SmeBSB.c:1.3
*** mit/lib/Xaw/SmeBSB.c:1.1.1.1	Sat Mar 12 00:38:14 1994
--- mit/lib/Xaw/SmeBSB.c	Sat Mar 12 00:38:15 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/SmeBSB.c,v 1.3 1993/03/27 09:10:34 dawes Exp $ */
  /* $XConsortium: SmeBSB.c,v 1.16 91/03/15 15:59:41 gildea Exp $ */
  
  /*
***************
*** 85,92 ****
  
  static void GetDefaultSize(), DrawBitmaps(), GetBitmapInfo();
  static void CreateGCs(), DestroyGCs();
!     
  #define superclass (&smeClassRec)
  SmeBSBClassRec smeBSBClassRec = {
    {
      /* superclass         */    (WidgetClass) superclass,
--- 86,97 ----
  
  static void GetDefaultSize(), DrawBitmaps(), GetBitmapInfo();
  static void CreateGCs(), DestroyGCs();
! 
! #ifndef SVR3SHLIB    
  #define superclass (&smeClassRec)
+ #else
+ #define superclass NULL
+ #endif
  SmeBSBClassRec smeBSBClassRec = {
    {
      /* superclass         */    (WidgetClass) superclass,
***************
*** 135,141 ****
--- 140,150 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass smeBSBObjectClass = (WidgetClass) &smeBSBClassRec;
+ #else
+ extern WidgetClass smeBSBObjectClass;
+ #endif
  
  /************************************************************
   *
diff -c mit/lib/Xaw/SmeLine.c:1.1.1.1 mit/lib/Xaw/SmeLine.c:1.3
*** mit/lib/Xaw/SmeLine.c:1.1.1.1	Sat Mar 12 00:38:15 1994
--- mit/lib/Xaw/SmeLine.c	Sat Mar 12 00:38:15 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/SmeLine.c,v 1.3 1993/03/27 09:10:36 dawes Exp $ */
  /* $XConsortium: SmeLine.c,v 1.13 91/07/23 12:23:21 rws Exp $ */
  
  /*
***************
*** 62,68 ****
--- 63,73 ----
  static XtGeometryResult QueryGeometry();
  
  
+ #ifndef SVR3SHLIB
  #define SUPERCLASS (&smeClassRec)
+ #else
+ #define SUPERCLASS NULL
+ #endif
  
  SmeLineClassRec smeLineClassRec = {
    {
***************
*** 111,117 ****
--- 116,126 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass smeLineObjectClass = (WidgetClass) &smeLineClassRec;
+ #else
+ extern WidgetClass smeLineObjectClass;
+ #endif
  
  /************************************************************
   *
diff -c mit/lib/Xaw/StripChart.c:1.1.1.1 mit/lib/Xaw/StripChart.c:1.3
*** mit/lib/Xaw/StripChart.c:1.1.1.1	Sat Mar 12 00:38:15 1994
--- mit/lib/Xaw/StripChart.c	Sat Mar 12 00:38:16 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/StripChart.c,v 1.3 1993/03/27 09:10:38 dawes Exp $ */
  /* $XConsortium: StripChart.c,v 1.20 91/05/24 17:20:42 converse Exp $ */
  
  /***********************************************************
***************
*** 64,70 ****
--- 65,75 ----
  
  StripChartClassRec stripChartClassRec = {
      { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass		*/	(WidgetClass) &simpleClassRec,
+ #else
+     /* superclass		*/	NULL,
+ #endif
      /* class_name		*/	"StripChart",
      /* size			*/	sizeof(StripChartRec),
      /* class_initialize		*/	XawInitializeWidgetSet,
***************
*** 103,109 ****
--- 108,118 ----
      }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass stripChartWidgetClass = (WidgetClass) &stripChartClassRec;
+ #else
+ extern WidgetClass stripChartWidgetClass;
+ #endif
  
  /****************************************************************
   *
diff -c mit/lib/Xaw/Text.c:1.1.1.2 mit/lib/Xaw/Text.c:1.3
*** mit/lib/Xaw/Text.c:1.1.1.2	Sat Mar 12 00:38:17 1994
--- mit/lib/Xaw/Text.c	Sat Mar 12 00:38:17 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Text.c,v 1.3 1993/03/27 09:10:41 dawes Exp $ */
  /* $XConsortium: Text.c,v 1.184 92/11/16 15:00:13 converse Exp $ */
  
  /***********************************************************
***************
*** 24,29 ****
--- 25,34 ----
  
  ******************************************************************/
  
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
+ 
  #include <X11/IntrinsicP.h>
  #include <X11/StringDefs.h>
  #include <X11/Shell.h>
***************
*** 43,49 ****
--- 48,58 ----
  
  #include <X11/Xfuncs.h>
  
+ #ifndef SVR3SHLIB
  unsigned long FMT8BIT = 0L;
+ #else
+ extern unsigned long FMT8BIT;
+ #endif
  
  #define SinkClearToBG          XawTextSinkClearToBackground
  
***************
*** 2754,2760 ****
--- 2763,2773 ----
      Arg args[1];
      TextWidget tw = (TextWidget) w;
  
+ #ifndef SVR3SHLIB
      (*(&simpleClassRec)->simple_class.change_sensitive)(w);
+ #else
+     (*((SimpleWidgetClass)simpleWidgetClass)->simple_class.change_sensitive)(w);
+ #endif
  
      XtSetArg(args[0], XtNancestorSensitive, 
  	       (tw->core.ancestor_sensitive && tw->core.sensitive));
***************
*** 3256,3262 ****
--- 3269,3279 ----
    
  TextClassRec textClassRec = {
    { /* core fields */
+ #ifndef SVR3SHLIB
      /* superclass       */      (WidgetClass) &simpleClassRec,
+ #else
+     /* superclass       */      NULL,
+ #endif
      /* class_name       */      "Text",
      /* widget_size      */      sizeof(TextRec),
      /* class_initialize */      ClassInitialize,
***************
*** 3297,3300 ****
--- 3314,3321 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass textWidgetClass = (WidgetClass)&textClassRec;
+ #else
+ extern WidgetClass textWidgetClass;
+ #endif
diff -c mit/lib/Xaw/TextAction.c:1.1.1.1 mit/lib/Xaw/TextAction.c:1.3
*** mit/lib/Xaw/TextAction.c:1.1.1.1	Sat Mar 12 00:38:19 1994
--- mit/lib/Xaw/TextAction.c	Sat Mar 12 00:38:19 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/TextAction.c,v 1.3 1993/03/27 09:10:46 dawes Exp $ */
  /* $XConsortium: TextAction.c,v 1.43 91/07/23 12:23:54 rws Exp $ */
  
  /***********************************************************
***************
*** 36,41 ****
--- 37,46 ----
   *						MIT X Consortium 
   */
  
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
+ 
  #include <X11/IntrinsicP.h>
  #include <X11/StringDefs.h>
  #include <X11/Xatom.h>
***************
*** 1576,1579 ****
--- 1581,1588 ----
    {"PopdownSearchAction",       _XawTextPopdownSearchAction},
  };
  
+ #ifdef SVR3SHLIB
+ #undef _XawTextActionsTableCount
+ #define _XawTextActionsTableCount __XawTextActionsTableCount
+ #endif
  Cardinal _XawTextActionsTableCount = XtNumber(_XawTextActionsTable);
diff -c mit/lib/Xaw/TextPop.c:1.1.1.1 mit/lib/Xaw/TextPop.c:2.0
*** mit/lib/Xaw/TextPop.c:1.1.1.1	Sat Mar 12 00:38:20 1994
--- mit/lib/Xaw/TextPop.c	Sat Mar 12 00:38:20 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/TextPop.c,v 2.0 1993/11/07 14:06:51 dawes Exp $ */
  /* $XConsortium: TextPop.c,v 1.22 91/07/25 18:10:22 rws Exp $ */
  
  /***********************************************************
***************
*** 45,50 ****
--- 46,55 ----
   *
   *************************************************************/
  
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
+ 
  #include <X11/IntrinsicP.h>
  #include <X11/StringDefs.h>
  #include <X11/Shell.h> 
***************
*** 60,67 ****
  #include <X11/Xos.h>		/* for O_RDONLY */
  #include <errno.h>
  
! extern int errno, sys_nerr;
  extern char* sys_errlist[];
  
  #define INSERT_FILE ("Enter Filename:")
  
--- 65,80 ----
  #include <X11/Xos.h>		/* for O_RDONLY */
  #include <errno.h>
  
! extern int errno;
! #ifdef SCO
! extern int open();
! #endif
! #ifndef X_NO_STRERROR
! #include <string.h>
! #else
! extern int sys_nerr;
  extern char* sys_errlist[];
+ #endif
  
  #define INSERT_FILE ("Enter Filename:")
  
***************
*** 239,246 ****
--- 252,263 ----
      }
      else
        sprintf( msg, "*** Error: %s ***",
+ #ifndef X_NO_STRERROR
+ 	      strerror(errno));
+ #else
  	      (errno > 0 && errno < sys_nerr) ?
  	      sys_errlist[errno] : "Can't open file" );
+ #endif
    
  
    (void)SetResourceByName(ctx->text.file_insert, 
diff -c mit/lib/Xaw/TextSink.c:1.1.1.1 mit/lib/Xaw/TextSink.c:1.3
*** mit/lib/Xaw/TextSink.c:1.1.1.1	Sat Mar 12 00:38:21 1994
--- mit/lib/Xaw/TextSink.c	Sat Mar 12 00:38:21 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/TextSink.c,v 1.3 1993/03/27 09:10:49 dawes Exp $ */
  /* $XConsortium: TextSink.c,v 1.16 91/05/28 10:50:01 converse Exp $ */
  
  /*
***************
*** 62,68 ****
--- 63,73 ----
  };
  #undef offset
  
+ #ifndef SVR3SHLIB
  #define SuperClass		(&objectClassRec)
+ #else
+ #define SuperClass		NULL
+ #endif
  TextSinkClassRec textSinkClassRec = {
    {
  /* core_class fields */	
***************
*** 114,120 ****
--- 119,129 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass textSinkObjectClass = (WidgetClass)&textSinkClassRec;
+ #else
+ extern WidgetClass textSinkObjectClass;
+ #endif
  
  static void
  ClassPartInitialize(wc)
diff -c mit/lib/Xaw/TextSrc.c:1.1.1.1 mit/lib/Xaw/TextSrc.c:1.3
*** mit/lib/Xaw/TextSrc.c:1.1.1.1	Sat Mar 12 00:38:21 1994
--- mit/lib/Xaw/TextSrc.c	Sat Mar 12 00:38:21 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/TextSrc.c,v 1.3 1993/03/27 09:10:52 dawes Exp $ */
  /* $XConsortium: TextSrc.c,v 1.11 91/02/20 17:58:08 converse Exp $ */
  
  /*
***************
*** 58,64 ****
--- 59,69 ----
  static XawTextPosition Search(), Scan(), Read();
  static int Replace();
  
+ #ifndef SVR3SHLIB
  #define SuperClass		(&objectClassRec)
+ #else
+ #define SuperClass		NULL
+ #endif
  TextSrcClassRec textSrcClassRec = {
    {
  /* core_class fields */	
***************
*** 106,112 ****
--- 111,121 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass textSrcObjectClass = (WidgetClass)&textSrcClassRec;
+ #else
+ extern WidgetClass textSrcObjectClass;
+ #endif
  
  static void 
  ClassInitialize ()
diff -c mit/lib/Xaw/TextTr.c:1.1.1.1 mit/lib/Xaw/TextTr.c:1.3
*** mit/lib/Xaw/TextTr.c:1.1.1.1	Sat Mar 12 00:38:22 1994
--- mit/lib/Xaw/TextTr.c	Sat Mar 12 00:38:22 1994
***************
*** 1,6 ****
--- 1,11 ----
+ /* $XFree86: mit/lib/Xaw/TextTr.c,v 1.3 1993/03/27 09:10:54 dawes Exp $ */
  /* $XConsortium: TextTr.c,v 1.13 89/11/01 17:01:24 kit Exp $ */
  
+ #ifndef SVR3SHLIB
  char *_XawDefaultTextTranslations1 =
+ #else
+ char __XawDefaultTextTranslations1[] =
+ #endif
  "\
  Ctrl<Key>A:	beginning-of-line() \n\
  Ctrl<Key>B:	backward-character() \n\
***************
*** 24,30 ****
  Ctrl<Key>W:	kill-selection() \n\
  Ctrl<Key>Y:	insert-selection(CUT_BUFFER1) \n\
  Ctrl<Key>Z:	scroll-one-line-up() \n\
! ", *_XawDefaultTextTranslations2 = "\
  Meta<Key>B:	backward-word() \n\
  Meta<Key>F:	forward-word() \n\
  Meta<Key>I:	insert-file() \n\
--- 29,41 ----
  Ctrl<Key>W:	kill-selection() \n\
  Ctrl<Key>Y:	insert-selection(CUT_BUFFER1) \n\
  Ctrl<Key>Z:	scroll-one-line-up() \n\
! ",
! #ifndef SVR3SHLIB
! *_XawDefaultTextTranslations2 =
! #else
! __XawDefaultTextTranslations2[] =
! #endif
! "\
  Meta<Key>B:	backward-word() \n\
  Meta<Key>F:	forward-word() \n\
  Meta<Key>I:	insert-file() \n\
***************
*** 45,51 ****
   Shift Meta<Key>Delete:		backward-kill-word() \n\
  ~Shift Meta<Key>BackSpace:	delete-previous-word() \n\
   Shift Meta<Key>BackSpace:	backward-kill-word() \n\
! ", *_XawDefaultTextTranslations3 = "\
  <Key>Right:	forward-character() \n\
  <Key>Left:	backward-character() \n\
  <Key>Down:	next-line() \n\
--- 56,68 ----
   Shift Meta<Key>Delete:		backward-kill-word() \n\
  ~Shift Meta<Key>BackSpace:	delete-previous-word() \n\
   Shift Meta<Key>BackSpace:	backward-kill-word() \n\
! ",
! #ifndef SVR3SHLIB
! *_XawDefaultTextTranslations3 =
! #else
! __XawDefaultTextTranslations3[] = 
! #endif
! "\
  <Key>Right:	forward-character() \n\
  <Key>Left:	backward-character() \n\
  <Key>Down:	next-line() \n\
diff -c mit/lib/Xaw/Toggle.c:1.1.1.1 mit/lib/Xaw/Toggle.c:1.3
*** mit/lib/Xaw/Toggle.c:1.1.1.1	Sat Mar 12 00:38:22 1994
--- mit/lib/Xaw/Toggle.c	Sat Mar 12 00:38:22 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Toggle.c,v 1.3 1993/03/27 09:10:56 dawes Exp $ */
  /* $XConsortium: Toggle.c,v 1.24 91/07/25 14:07:48 converse Exp $ */
  
  /*
***************
*** 33,38 ****
--- 34,43 ----
   *
   */
  
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
+ 
  #include <stdio.h>
  
  #include <X11/IntrinsicP.h>
***************
*** 91,97 ****
--- 96,106 ----
    {"set",	        ToggleSet},
  };
  
+ #ifndef SVR3SHLIB
  #define SuperClass ((CommandWidgetClass)&commandClassRec)
+ #else
+ #define SuperClass NULL
+ #endif
  
  ToggleClassRec toggleClassRec = {
    {
***************
*** 145,151 ****
--- 154,164 ----
  };
  
    /* for public consumption */
+ #ifndef SVR3SHLIB
  WidgetClass toggleWidgetClass = (WidgetClass) &toggleClassRec;
+ #else
+ extern WidgetClass toggleWidgetClass;
+ #endif
  
  /****************************************************************
   *
diff -c mit/lib/Xaw/Tree.c:1.1.1.1 mit/lib/Xaw/Tree.c:1.3
*** mit/lib/Xaw/Tree.c:1.1.1.1	Sat Mar 12 00:38:23 1994
--- mit/lib/Xaw/Tree.c	Sat Mar 12 00:38:23 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xaw/Tree.c,v 1.3 1993/03/27 09:10:58 dawes Exp $
   * $XConsortium: Tree.c,v 1.42 91/02/20 20:06:07 converse Exp $
   *
   * Copyright 1990 Massachusetts Institute of Technology
***************
*** 96,102 ****
--- 97,107 ----
  TreeClassRec treeClassRec = {
    {
  					/* core_class fields  */
+ #ifndef SVR3SHLIB
      (WidgetClass) &constraintClassRec,	/* superclass         */
+ #else
+     NULL,				/* superclass         */
+ #endif
      "Tree",				/* class_name         */
      sizeof(TreeRec),			/* widget_size        */
      ClassInitialize,			/* class_init         */
***************
*** 153,159 ****
--- 158,168 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  WidgetClass treeWidgetClass = (WidgetClass) &treeClassRec;
+ #else
+ extern WidgetClass treeWidgetClass;
+ #endif
  
  
  /*****************************************************************************
diff -c mit/lib/Xaw/Vendor.c:1.1.1.1 mit/lib/Xaw/Vendor.c:1.3
*** mit/lib/Xaw/Vendor.c:1.1.1.1	Sat Mar 12 00:38:24 1994
--- mit/lib/Xaw/Vendor.c	Sat Mar 12 00:38:24 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Vendor.c,v 1.3 1993/03/27 09:11:00 dawes Exp $ */
  /* $XConsortium: Vendor.c,v 1.21 91/07/30 15:29:56 rws Exp $ */
  
  /***********************************************************
***************
*** 59,68 ****
--- 60,77 ----
  static void XawVendorShellInitialize();
  static void ChangeManaged();
  
+ #ifndef SVR3SHLIB
  #define SuperClass (&wmShellClassRec)
+ #else
+ #define SuperClass ((WMShellWidgetClass)wmShellWidgetClass)
+ #endif
  externaldef(vendorshellclassrec) VendorShellClassRec vendorShellClassRec = {
    {
+ #ifndef SVR3SHLIB
      /* superclass	  */	(WidgetClass)SuperClass,
+ #else
+     /* superclass	  */	NULL,
+ #endif
      /* class_name	  */	"VendorShell",
      /* size		  */	sizeof(VendorShellRec),
      /* class_initialize	  */	XawVendorShellClassInitialize,
***************
*** 109,116 ****
--- 118,129 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  externaldef(vendorshellwidgetclass) WidgetClass vendorShellWidgetClass =
  	(WidgetClass) (&vendorShellClassRec);
+ #else
+ externalref WidgetClass vendorShellWidgetClass;
+ #endif
  
  static void XawVendorShellClassInitialize()
  {
diff -c mit/lib/Xaw/Viewport.c:1.1.1.1 mit/lib/Xaw/Viewport.c:1.3
*** mit/lib/Xaw/Viewport.c:1.1.1.1	Sat Mar 12 00:38:25 1994
--- mit/lib/Xaw/Viewport.c	Sat Mar 12 00:38:25 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xaw/Viewport.c,v 1.3 1993/03/21 05:10:55 dawes Exp $ */
  /* $XConsortium: Viewport.c,v 1.68 91/07/24 18:56:11 converse Exp $ */
  
  /***********************************************************
***************
*** 59,68 ****
--- 60,77 ----
  static Boolean SetValues(), Layout();
  static XtGeometryResult GeometryManager(), PreferredGeometry();
  
+ #ifndef SVR3SHLIB
  #define superclass	(&formClassRec)
+ #else
+ #define superclass	((FormWidgetClass)formWidgetClass)
+ #endif
  ViewportClassRec viewportClassRec = {
    { /* core_class fields */
+ #ifndef SVR3SHLIB
      /* superclass	  */	(WidgetClass) superclass,
+ #else
+     /* superclass	  */	NULL,
+ #endif
      /* class_name	  */	"Viewport",
      /* widget_size	  */	sizeof(ViewportRec),
      /* class_initialize	  */	XawInitializeWidgetSet,
***************
*** 120,126 ****
--- 129,139 ----
  };
  
  
+ #ifndef SVR3SHLIB
  WidgetClass viewportWidgetClass = (WidgetClass)&viewportClassRec;
+ #else
+ extern WidgetClass viewportWidgetClass;
+ #endif
  
  static Widget CreateScrollbar(w, horizontal)
      ViewportWidget w;
***************
*** 130,142 ****
      ViewportConstraints constraints =
  	(ViewportConstraints)clip->core.constraints;
      static Arg barArgs[] = {
! 	{XtNorientation, NULL},
! 	{XtNlength, NULL},
! 	{XtNleft, NULL},
! 	{XtNright, NULL},
! 	{XtNtop, NULL},
! 	{XtNbottom, NULL},
! 	{XtNmappedWhenManaged, False},
      };
      Widget bar;
  
--- 143,155 ----
      ViewportConstraints constraints =
  	(ViewportConstraints)clip->core.constraints;
      static Arg barArgs[] = {
! 	{XtNorientation, (XtArgVal)NULL},
! 	{XtNlength, (XtArgVal)NULL},
! 	{XtNleft, (XtArgVal)NULL},
! 	{XtNright, (XtArgVal)NULL},
! 	{XtNtop, (XtArgVal)NULL},
! 	{XtNbottom, (XtArgVal)NULL},
! 	{XtNmappedWhenManaged, (XtArgVal)False},
      };
      Widget bar;
  
diff -c /dev/null mit/lib/Xaw/dummyBind.c:1.2
*** /dev/null	Sat Mar 12 00:38:25 1994
--- mit/lib/Xaw/dummyBind.c	Sat Mar 12 00:38:25 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw: dummyBind.c
+  *
+  * This dummy function is only linked to the client if the client
+  * doesn't supply one
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/dummyBind.c,v 1.2 1993/03/27 09:11:02 dawes Exp $
+  */
+ 
+ void _bind_to_sv3shlib_()
+ {
+    /* do nothing */
+ 
+ }
+ 
diff -c /dev/null mit/lib/Xaw/globals.c:1.3
*** /dev/null	Sat Mar 12 00:38:25 1994
--- mit/lib/Xaw/globals.c	Sat Mar 12 00:38:26 1994
***************
*** 0 ****
--- 1,167 ----
+ /* libXaw : libXaw.c
+  * exported data
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/Xaw/globals.c,v 1.3 1993/03/20 03:33:49 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xmu/WidgetNode.h>
+ #include <X11/Xaw/AllWidgets.h>
+ #include <X11/Xaw/TextP.h>
+ 
+ #ifdef SVR3SHLIB
+ 
+ #ifdef __STDC__
+ #define Const const
+ #else
+ #define Const /**/
+ #endif
+ 
+ #define VoidInit(var) void *var = 0
+ 
+ Const char *_shared_libXaw_version = SOXAWREV;  char __libXaw_sp1__[16] = "";
+ 
+ unsigned long FMT8BIT = 0L;
+ 
+ extern char __XawDefaultTextTranslations1[];
+ extern char __XawDefaultTextTranslations2[];
+ extern char __XawDefaultTextTranslations3[];
+ 
+ char *_XawDefaultTextTranslations1 = __XawDefaultTextTranslations1;
+ char *_XawDefaultTextTranslations2 = __XawDefaultTextTranslations2;
+ char *_XawDefaultTextTranslations3 = __XawDefaultTextTranslations3;
+ 
+ Cardinal _XawTextActionsTableCount = 0;
+ 
+ VoidInit(_libXaw__aux__);
+ VoidInit(_libXaw_XShapeCombineMask);
+ VoidInit(_libXaw_XShapeQueryExtension);
+ VoidInit(_libXaw__ctype);
+ VoidInit(_libXaw__iob);
+ VoidInit(_libXaw_asctime);
+ VoidInit(_libXaw_atof);
+ VoidInit(_libXaw_atoi);
+ VoidInit(_libXaw_bcopy);
+ VoidInit(_libXaw_close);
+ VoidInit(_libXaw_creat);
+ VoidInit(_libXaw_errno);
+ VoidInit(_libXaw_exit);
+ VoidInit(_libXaw_fclose);
+ VoidInit(_libXaw_fopen);
+ VoidInit(_libXaw_fprintf);
+ VoidInit(_libXaw_fread);
+ VoidInit(_libXaw_fseek);
+ VoidInit(_libXaw_ftell);
+ VoidInit(_libXaw_getlogin);
+ VoidInit(_libXaw_getpwuid);
+ VoidInit(_libXaw_getuid);
+ VoidInit(_libXaw_localtime);
+ VoidInit(_libXaw_memset);
+ VoidInit(_libXaw_open);
+ VoidInit(_libXaw_printf);
+ VoidInit(_libXaw_read);
+ VoidInit(_libXaw_sprintf);
+ VoidInit(_libXaw_stat);
+ VoidInit(_libXaw_strcat);
+ VoidInit(_libXaw_strchr);
+ VoidInit(_libXaw_strcmp);
+ VoidInit(_libXaw_strcpy);
+ VoidInit(_libXaw_strncpy);
+ VoidInit(_libXaw_sys_errlist);
+ VoidInit(_libXaw_sys_nerr);
+ VoidInit(_libXaw_system);
+ VoidInit(_libXaw_time);
+ VoidInit(_libXaw_tmpnam);
+ VoidInit(_libXaw_toupper);
+ VoidInit(_libXaw_write);
+ VoidInit(_libXaw__XawTextActionsTableCount);
+ 
+ VoidInit(_libXaw_asciiSinkObjectClass);
+ VoidInit(_libXaw_asciiSrcObjectClass);
+ VoidInit(_libXaw_asciiTextWidgetClass);
+ VoidInit(_libXaw_boxWidgetClass);
+ VoidInit(_libXaw_clockWidgetClass);
+ VoidInit(_libXaw_commandWidgetClass);
+ VoidInit(_libXaw_dialogWidgetClass);
+ VoidInit(_libXaw_formWidgetClass);
+ VoidInit(_libXaw_gripWidgetClass);
+ VoidInit(_libXaw_labelWidgetClass);
+ VoidInit(_libXaw_listWidgetClass);
+ VoidInit(_libXaw_logoWidgetClass);
+ VoidInit(_libXaw_mailboxWidgetClass);
+ VoidInit(_libXaw_menuButtonWidgetClass);
+ VoidInit(_libXaw_panedWidgetClass);
+ VoidInit(_libXaw_pannerWidgetClass);
+ VoidInit(_libXaw_portholeWidgetClass);
+ VoidInit(_libXaw_repeaterWidgetClass);
+ VoidInit(_libXaw_scrollbarWidgetClass);
+ VoidInit(_libXaw_simpleWidgetClass);
+ VoidInit(_libXaw_simpleMenuWidgetClass);
+ VoidInit(_libXaw_smeObjectClass);
+ VoidInit(_libXaw_smeBSBObjectClass);
+ VoidInit(_libXaw_smeLineObjectClass);
+ VoidInit(_libXaw_stripChartWidgetClass);
+ VoidInit(_libXaw_textWidgetClass);
+ VoidInit(_libXaw_textSinkObjectClass);
+ VoidInit(_libXaw_textSrcObjectClass);
+ VoidInit(_libXaw_toggleWidgetClass);
+ VoidInit(_libXaw_treeWidgetClass);
+ VoidInit(_libXaw_vendorShellWidgetClass);
+ VoidInit(_libXaw_viewportWidgetClass);
+ 
+ VoidInit(_libXaw_transientShellWidgetClass);
+ 
+ VoidInit(_libXaw__XA_CHARACTER_POSITION);
+ VoidInit(_libXaw__XA_COMPOUND_TEXT);
+ VoidInit(_libXaw__XA_DELETE);
+ VoidInit(_libXaw__XA_LENGTH);
+ VoidInit(_libXaw__XA_LIST_LENGTH);
+ VoidInit(_libXaw__XA_NULL);
+ VoidInit(_libXaw__XA_SPAN);
+ VoidInit(_libXaw__XA_TARGETS);
+ VoidInit(_libXaw__XA_TEXT);
+ 
+ void *__libXaw_p__[FUTURE_WIDGET_COUNT] = {0};
+ 
+ 
+ #ifndef __GNUC__
+ /*
+  * If we are working with floating point aritmetic, stock AT&T cc generates
+  * an unresolved reference to __fltused. But we want to make a shared lib from
+  * this here and don't want to reference /lib/libc_s.a, just define this sym as
+  * (shared lib) static.
+  * The trick is that while building the shared lib all references to this
+  * symbol are resolved internally. But the symbol will be outside only visible
+  * as a static one, so preventing a name conflict with other shared libs.
+  */
+ long __fltused = 0;
+ #endif
+ 
+ /* A dummy function for free branchtab-slots.
+  * This would be a great place for an error-check mechanism for shared libs.
+  * (Print error message if not existent function is called.)
+  */
+ extern void _libXaw_dummy() {};
+ 
+ 
+ /*
+  * This function is for future versions of the library which could
+  * want initialize pointers to default values, which clients linked with
+  * the old version don't initialize. It's called from inside the
+  * .init section of the clients.
+  */
+ extern Cardinal __XawTextActionsTableCount;
+ 
+ void __default_libXaw_init_()
+ {
+ 
+   _XawTextActionsTableCount = __XawTextActionsTableCount;
+ 
+ }
+ 
+ #endif
+ 
diff -c /dev/null mit/lib/Xaw/import.h:2.0
*** /dev/null	Sat Mar 12 00:38:26 1994
--- mit/lib/Xaw/import.h	Sat Mar 12 00:38:26 1994
***************
*** 0 ****
--- 1,247 ----
+ /* libXaw : import.h
+  * indirection defines
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/Xaw/import.h,v 2.0 1993/09/22 15:32:03 dawes Exp $
+  */
+ 
+ #define FUTURE_WIDGET_COUNT 20
+ 
+ #ifndef _libXaw_import
+ #define _libXaw_import
+ #ifdef SVR3SHLIB
+ 
+ #define XShapeCombineMask  (*_libXaw_XShapeCombineMask)
+ #define XShapeQueryExtension  (*_libXaw_XShapeQueryExtension)
+ #define _ctype  (*_libXaw__ctype)
+ #define _iob  (*_libXaw__iob)
+ #define asctime  (*_libXaw_asctime)
+ #define atof  (*_libXaw_atof)
+ #define atoi  (*_libXaw_atoi)
+ #define bcopy  (*_libXaw_bcopy)
+ /* prevent name conflict with member close of XIM */
+ #define close(fd) (*_libXaw_close)(fd)
+ #define creat  (*_libXaw_creat)
+ #define errno  (*_libXaw_errno)
+ #define exit  (*_libXaw_exit)
+ #define fclose  (*_libXaw_fclose)
+ #define fopen  (*_libXaw_fopen)
+ #define fprintf  (*_libXaw_fprintf)
+ #define fread  (*_libXaw_fread)
+ #define fseek  (*_libXaw_fseek)
+ #define ftell  (*_libXaw_ftell)
+ #define getlogin  (*_libXaw_getlogin)
+ #define getpwuid  (*_libXaw_getpwuid)
+ #define getuid  (*_libXaw_getuid)
+ #define localtime  (*_libXaw_localtime)
+ #define memset  (*_libXaw_memset)
+ #define open  (*_libXaw_open)
+ #define printf  (*_libXaw_printf)
+ #define read  (*_libXaw_read)
+ #define sprintf  (*_libXaw_sprintf)
+ /* prevent name conflict with struct stat */
+ #define stat(path, buf) (*_libXaw_stat)(path, buf)
+ #define strcat  (*_libXaw_strcat)
+ #define strchr  (*_libXaw_strchr)
+ #define strcmp  (*_libXaw_strcmp)
+ #define strcpy  (*_libXaw_strcpy)
+ #define strncpy  (*_libXaw_strncpy)
+ #define sys_errlist  (*_libXaw_sys_errlist)
+ #define sys_nerr  (*_libXaw_sys_nerr)
+ #define system  (*_libXaw_system)
+ /* prevent name conflict with member time of TextWidget */
+ #define time(tloc)  (*_libXaw_time)(tloc)
+ #define tmpnam  (*_libXaw_tmpnam)
+ #define toupper  (*_libXaw_toupper)
+ #define write  (*_libXaw_write)
+ #define _XawTextActionsTableCount  (*_libXaw__XawTextActionsTableCount)
+ #define asciiSinkObjectClass  (*_libXaw_asciiSinkObjectClass)
+ #define asciiSrcObjectClass  (*_libXaw_asciiSrcObjectClass)
+ #define asciiTextWidgetClass  (*_libXaw_asciiTextWidgetClass)
+ #define boxWidgetClass  (*_libXaw_boxWidgetClass)
+ #define clockWidgetClass  (*_libXaw_clockWidgetClass)
+ #define commandWidgetClass  (*_libXaw_commandWidgetClass)
+ #define dialogWidgetClass  (*_libXaw_dialogWidgetClass)
+ #define formWidgetClass  (*_libXaw_formWidgetClass)
+ #define gripWidgetClass  (*_libXaw_gripWidgetClass)
+ #define labelWidgetClass  (*_libXaw_labelWidgetClass)
+ #define listWidgetClass  (*_libXaw_listWidgetClass)
+ #define logoWidgetClass (*_libXaw_logoWidgetClass)
+ #define mailboxWidgetClass  (*_libXaw_mailboxWidgetClass)
+ #define menuButtonWidgetClass  (*_libXaw_menuButtonWidgetClass)
+ #define panedWidgetClass  (*_libXaw_panedWidgetClass)
+ #define pannerWidgetClass  (*_libXaw_pannerWidgetClass)
+ #define portholeWidgetClass  (*_libXaw_portholeWidgetClass)
+ #define repeaterWidgetClass  (*_libXaw_repeaterWidgetClass)
+ #define scrollbarWidgetClass  (*_libXaw_scrollbarWidgetClass)
+ #define simpleWidgetClass  (*_libXaw_simpleWidgetClass)
+ #define simpleMenuWidgetClass  (*_libXaw_simpleMenuWidgetClass)
+ #define smeObjectClass  (*_libXaw_smeObjectClass)
+ #define smeBSBObjectClass  (*_libXaw_smeBSBObjectClass)
+ #define smeLineObjectClass  (*_libXaw_smeLineObjectClass)
+ #define stripChartWidgetClass  (*_libXaw_stripChartWidgetClass)
+ #define textWidgetClass  (*_libXaw_textWidgetClass)
+ #define textSinkObjectClass  (*_libXaw_textSinkObjectClass)
+ #define textSrcObjectClass  (*_libXaw_textSrcObjectClass)
+ #define toggleWidgetClass  (*_libXaw_toggleWidgetClass)
+ #define treeWidgetClass  (*_libXaw_treeWidgetClass)
+ #define vendorShellWidgetClass  (*_libXaw_vendorShellWidgetClass)
+ #define viewportWidgetClass  (*_libXaw_viewportWidgetClass)
+ 
+ #define transientShellWidgetClass  (*_libXaw_transientShellWidgetClass)
+ 
+ #define _XA_CHARACTER_POSITION  (*_libXaw__XA_CHARACTER_POSITION)
+ #define _XA_COMPOUND_TEXT  (*_libXaw__XA_COMPOUND_TEXT)
+ #define _XA_DELETE  (*_libXaw__XA_DELETE)
+ #define _XA_LENGTH  (*_libXaw__XA_LENGTH)
+ #define _XA_LIST_LENGTH  (*_libXaw__XA_LIST_LENGTH)
+ #define _XA_NULL  (*_libXaw__XA_NULL)
+ #define _XA_SPAN  (*_libXaw__XA_SPAN)
+ #define _XA_TARGETS  (*_libXaw__XA_TARGETS)
+ #define _XA_TEXT  (*_libXaw__XA_TEXT)
+ 
+ /* Imported functions declarations
+  * Why declaring some imported functions here?
+  * This should be done gracefully through including of the systems
+  * header files. Unfortunatly there are some source files don't
+  * include all headers they should include, there are also some functions
+  * nowhere declared in the systems headers and some are declared
+  * without extern and cause problems since the names are redefined
+  * and these declarations then become undesired false pointer definitions.
+  */
+ 
+ extern void XShapeCombineMask();
+ extern int XShapeQueryExtension();
+ 
+ /* <time.h> on ISC 2.2.1 doesn't declare time(2) for __STDC__
+  * so get time_t from it and declare it excplicit
+  */
+ #ifndef ATT
+ #include <time.h>
+ #endif
+ 
+ #if defined(ISC202) || defined(ATT)
+ extern int (*_libXaw_stat)();
+ extern char (*_libXaw_toupper)();
+ #endif
+ 
+ #ifdef ISC202
+ #include <sys/types.h>
+ #endif
+ 
+ #ifdef ATT
+ extern int open();
+ #endif
+ 
+ #ifdef __STDC__
+ #ifndef ATT
+ extern time_t time(time_t *);
+ #else
+ extern long time(time_t *);   /* gcc 2.3.3 seems to have problems */
+ #endif                        /* with typedefs on AT&T            */
+ #ifndef SCO324
+ extern int creat(char const *, unsigned short);
+ #endif
+ extern void exit(int);
+ extern unsigned short /*uid_t*/ getuid(void);
+ #ifndef SCO
+ extern int printf(char const *, ...);
+ extern int sprintf(char *, char const *, ...);
+ extern int sscanf(char *, char const *, ...);
+ #endif
+ extern int system(char const *);
+ extern int atoi(char const *);
+ extern int access(char const *, int);
+ extern unsigned int alarm(unsigned int);
+ extern unsigned int sleep(unsigned int);
+ extern int close(int);
+ extern int read(int, char *, unsigned int);
+ extern int write(int, char const *, unsigned int);
+ extern int grantpt(int);
+ extern char *ptsname(int);
+ extern int unlockpt(int);
+ extern char *getenv(char const *);
+ #else
+ #ifndef ATT
+ extern time_t time();    
+ #else
+ extern long time();     /* gcc 2.3.3 seems to have problems with */
+ #endif                  /* typedefs on AT&T                      */
+ #ifndef SCO324
+ extern int creat();
+ #endif
+ extern void exit();
+ extern unsigned short /*uid_t*/ getuid();
+ #ifndef SCO
+ extern int printf();
+ extern int sprintf();
+ extern int sscanf();
+ #endif
+ extern int system();
+ extern int atoi();
+ extern int access();
+ extern unsigned int alarm();
+ extern unsigned int sleep();
+ extern int close();
+ extern int read();
+ extern int write();
+ extern int grantpt();
+ extern char *ptsname();
+ extern int unlockpt();
+ extern char *getenv();
+ #endif
+ 
+ /* use char * also for __STDC__, the sources want it */ 
+ extern char *malloc(), *realloc(), *calloc();
+ 
+ #include <string.h>
+ 
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ 
+ extern void qsort();
+ #ifndef ISC40
+ extern int _flsbuf();
+ extern int _filbuf();
+ #endif
+ extern int ioctl();
+ extern int getmsg();
+ extern int putmsg();
+ 
+ extern unsigned short ntohs(), htons();
+ extern unsigned long ntohl(), htonl();
+ extern unsigned long inet_addr();
+ extern int connect();
+ extern int gethostname();
+ extern int setsockopt();
+ extern int socket();
+ extern int writev();
+ extern int gettimeofday();
+ 
+ 
+ /* Functions with ambiguous names */
+ 
+ #ifdef __STDC__
+ extern int close(int);
+ extern void free(void *);
+ #include <sys/time.h>
+ #include <sys/bsdtypes.h>
+ #ifdef SCO
+ #include <sys/types.h>
+ #ifdef SCO324
+ extern double atof(char *);
+ #endif /* SCO324 */
+ #endif /* SCO */
+ extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+ #else
+ extern int (*_libXaw_close)();
+ extern void (*_libXaw_free)();
+ extern int (*_libXaw_select)();
+ #endif
+ 
+ #endif
+ #endif
+ 
diff -c /dev/null mit/lib/Xaw/jump_funcs:1.1
*** /dev/null	Sat Mar 12 00:38:26 1994
--- mit/lib/Xaw/jump_funcs	Sat Mar 12 00:38:28 1994
***************
*** 0 ****
--- 1,86 ----
+ # $XFree86: mit/lib/Xaw/jump_funcs,v 1.1 1993/04/16 14:20:46 dawes Exp $
+ #
+ 00000000 T _XawAsciiSourceFreeString libXaw         AsciiSrc
+ 00000000 T _XawAsciiSave        libXaw         AsciiSrc
+ 00000000 T _XawAsciiSaveAsFile  libXaw         AsciiSrc
+ 00000000 T _XawAsciiSourceChanged libXaw         AsciiSrc
+ 00000000 T _XawDialogAddButton  libXaw         Dialog
+ 00000000 T _XawDialogGetValueString libXaw         Dialog
+ 00000000 T _XawFormDoLayout     libXaw         Form
+ 00000000 T _XawListChange       libXaw         List
+ 00000000 T _XawListUnhighlight  libXaw         List
+ 00000000 T _XawListHighlight    libXaw         List
+ 00000000 T _XawListShowCurrent  libXaw         List
+ 00000000 T _XawPanedSetMinMax   libXaw         Paned
+ 00000000 T _XawPanedGetMinMax   libXaw         Paned
+ 00000000 T _XawPanedSetRefigureMode libXaw         Paned
+ 00000000 T _XawPanedGetNumSub   libXaw         Paned
+ 00000000 T _XawPanedAllowResize libXaw         Paned
+ 00000000 T _XawScrollbarSetThumb libXaw         Scrollbar
+ 00000000 T _XawSimpleMenuAddGlobalActions libXaw         SimpleMenu
+ 00000000 T _XawSimpleMenuGetActiveEntry libXaw         SimpleMenu
+ 00000000 T _XawSimpleMenuClearActiveEntry libXaw         SimpleMenu
+ 00000000 T __XawTextNeedsUpdating libXaw         Text
+ 00000000 T __XawTextGetText     libXaw         Text
+ 00000000 T __XawTextGetSTRING   libXaw         Text
+ 00000000 T __XawTextBuildLineTable libXaw         Text
+ 00000000 T __XawTextSetScrollBars libXaw         Text
+ 00000000 T __XawTextVScroll     libXaw         Text
+ 00000000 T __XawTextSaltAwaySelection libXaw         Text
+ 00000000 T __XawTextReplace     libXaw         Text
+ 00000000 T __XawTextClearAndCenterDisplay libXaw         Text
+ 00000000 T __XawTextCheckResize libXaw         Text
+ 00000000 T __XawTextSelectionList libXaw         Text
+ 00000000 T __XawTextSetSelection libXaw         Text
+ 00000000 T __XawTextAlterSelection libXaw         Text
+ 00000000 T __XawTextPrepareToUpdate libXaw         Text
+ 00000000 T __XawTextShowPosition libXaw         Text
+ 00000000 T __XawTextExecuteUpdate libXaw         Text
+ 00000000 T _XawTextDisplay      libXaw         Text
+ 00000000 T _XawTextSetSelectionArray libXaw         Text
+ 00000000 T _XawTextGetSelectionPos libXaw         Text
+ 00000000 T _XawTextSetSource    libXaw         Text
+ 00000000 T _XawTextReplace      libXaw         Text
+ 00000000 T _XawTextTopPosition  libXaw         Text
+ 00000000 T _XawTextSetInsertionPoint libXaw         Text
+ 00000000 T _XawTextGetInsertionPoint libXaw         Text
+ 00000000 T _XawTextUnsetSelection libXaw         Text
+ 00000000 T _XawTextSetSelection libXaw         Text
+ 00000000 T _XawTextInvalidate   libXaw         Text
+ 00000000 T _XawTextDisableRedisplay libXaw         Text
+ 00000000 T _XawTextEnableRedisplay libXaw         Text
+ 00000000 T _XawTextGetSource    libXaw         Text
+ 00000000 T _XawTextDisplayCaret libXaw         Text
+ 00000000 T _XawTextSearch       libXaw         Text
+ 00000000 T _XawTextSinkDisplayText libXaw         TextSink
+ 00000000 T _XawTextSinkInsertCursor libXaw         TextSink
+ 00000000 T _XawTextSinkClearToBackground libXaw         TextSink
+ 00000000 T _XawTextSinkFindPosition libXaw         TextSink
+ 00000000 T _XawTextSinkFindDistance libXaw         TextSink
+ 00000000 T _XawTextSinkResolve  libXaw         TextSink
+ 00000000 T _XawTextSinkMaxLines libXaw         TextSink
+ 00000000 T _XawTextSinkMaxHeight libXaw         TextSink
+ 00000000 T _XawTextSinkSetTabs  libXaw         TextSink
+ 00000000 T _XawTextSinkGetCursorBounds libXaw         TextSink
+ 00000000 T _XawTextSourceRead   libXaw         TextSrc
+ 00000000 T _XawTextSourceReplace libXaw         TextSrc
+ 00000000 T _XawTextSourceScan   libXaw         TextSrc
+ 00000000 T _XawTextSourceSearch libXaw         TextSrc
+ 00000000 T _XawTextSourceConvertSelection libXaw         TextSrc
+ 00000000 T _XawTextSourceSetSelection libXaw         TextSrc
+ 00000000 T __XawTextZapSelection libXaw         TextAction
+ 00000000 T __XawTextInsertFileAction libXaw         TextPop
+ 00000000 T __XawTextInsertFile  libXaw         TextPop
+ 00000000 T __XawTextDoSearchAction libXaw         TextPop
+ 00000000 T __XawTextPopdownSearchAction libXaw         TextPop
+ 00000000 T __XawTextSearch      libXaw         TextPop
+ 00000000 T __XawTextDoReplaceAction libXaw         TextPop
+ 00000000 T __XawTextSetField    libXaw         TextPop
+ 00000000 T _XawToggleChangeRadioGroup libXaw         Toggle
+ 00000000 T _XawToggleGetCurrent libXaw         Toggle
+ 00000000 T _XawToggleSetCurrent libXaw         Toggle
+ 00000000 T _XawToggleUnsetCurrent libXaw         Toggle
+ 00000000 T _XawTreeForceLayout  libXaw         Tree
+ 00000000 T _XawViewportSetLocation libXaw         Viewport
+ 00000000 T _XawViewportSetCoordinates libXaw         Viewport
+ 00000000 T _XawInitializeWidgetSet libXaw         XawInit
diff -c /dev/null mit/lib/Xaw/jump_ignore:1.1
*** /dev/null	Sat Mar 12 00:38:28 1994
--- mit/lib/Xaw/jump_ignore	Sat Mar 12 00:38:28 1994
***************
*** 0 ****
--- 1 ----
+ # $XFree86: mit/lib/Xaw/jump_ignore,v 1.1 1993/04/17 02:37:57 dawes Exp $
diff -c /dev/null mit/lib/Xaw/jump_vars:1.1
*** /dev/null	Sat Mar 12 00:38:28 1994
--- mit/lib/Xaw/jump_vars	Sat Mar 12 00:38:28 1994
***************
*** 0 ****
--- 1,75 ----
+ # $XFree86: mit/lib/Xaw/jump_vars,v 1.1 1993/04/16 14:20:47 dawes Exp $
+ #
+ 00001400 D _XawWidgetArray      libXaw         AllWidgets
+ 00000004 D _XawWidgetCount      libXaw         AllWidgets
+ 00000140 D _asciiSinkClassRec   libXaw         AsciiSink
+ 00000004 D _asciiSinkObjectClass libXaw         AsciiSink
+ 00000120 D _asciiSrcClassRec    libXaw         AsciiSrc
+ 00000004 D _asciiSrcObjectClass libXaw         AsciiSrc
+ 00000100 D _asciiTextClassRec   libXaw         AsciiText
+ 00000004 D _asciiTextWidgetClass libXaw         AsciiText
+ 00000100 D _boxClassRec         libXaw         Box
+ 00000004 D _boxWidgetClass      libXaw         Box
+ 00000100 D _clockClassRec       libXaw         Clock
+ 00000004 D _clockWidgetClass    libXaw         Clock
+ 00000100 D _commandClassRec     libXaw         Command
+ 00000004 D _commandWidgetClass  libXaw         Command
+ 00000140 D _dialogClassRec      libXaw         Dialog
+ 00000004 D _dialogWidgetClass   libXaw         Dialog
+ 00000140 D _formClassRec        libXaw         Form
+ 00000004 D _formWidgetClass     libXaw         Form
+ 00000100 D _gripClassRec        libXaw         Grip
+ 00000004 D _gripWidgetClass     libXaw         Grip
+ 00000100 D _labelClassRec       libXaw         Label
+ 00000004 D _labelWidgetClass    libXaw         Label
+ 00000100 D _listClassRec        libXaw         List
+ 00000004 D _listWidgetClass     libXaw         List
+ 00000100 D _logoClassRec        libXaw         Logo
+ 00000004 D _logoWidgetClass     libXaw         Logo
+ 00000100 D _mailboxClassRec     libXaw         Mailbox
+ 00000004 D _mailboxWidgetClass  libXaw         Mailbox
+ 00000100 D _menuButtonClassRec  libXaw         MenuButton
+ 00000004 D _menuButtonWidgetClass libXaw         MenuButton
+ 00000140 D _panedClassRec       libXaw         Paned
+ 00000004 D _panedWidgetClass    libXaw         Paned
+ 00000004 D _vPanedWidgetClass   libXaw         Paned
+ 00000100 D _pannerClassRec      libXaw         Panner
+ 00000004 D _pannerWidgetClass   libXaw         Panner
+ 00000100 D _portholeClassRec    libXaw         Porthole
+ 00000004 D _portholeWidgetClass libXaw         Porthole
+ 00000100 D _repeaterClassRec    libXaw         Repeater
+ 00000004 D _repeaterWidgetClass libXaw         Repeater
+ 00000100 D _scrollbarClassRec   libXaw         Scrollbar
+ 00000004 D _scrollbarWidgetClass libXaw         Scrollbar
+ 00000100 D _simpleClassRec      libXaw         Simple
+ 00000004 D _simpleWidgetClass   libXaw         Simple
+ 00000100 D _simpleMenuClassRec  libXaw         SimpleMenu
+ 00000004 D _simpleMenuWidgetClass libXaw         SimpleMenu
+ 00000100 D _smeClassRec         libXaw         Sme
+ 00000004 D _smeObjectClass      libXaw         Sme
+ 00000100 D _smeBSBClassRec      libXaw         SmeBSB
+ 00000004 D _smeBSBObjectClass   libXaw         SmeBSB
+ 00000100 D _smeLineClassRec     libXaw         SmeLine
+ 00000004 D _smeLineObjectClass  libXaw         SmeLine
+ 00000100 D _stripChartClassRec  libXaw         StripChart
+ 00000004 D _stripChartWidgetClass libXaw         StripChart
+ 00000004 D _FMT8BIT             libXaw         Text
+ 00000100 D _textClassRec        libXaw         Text
+ 00000004 D _textWidgetClass     libXaw         Text
+ 00000100 D _textSinkClassRec    libXaw         TextSink
+ 00000004 D _textSinkObjectClass libXaw         TextSink
+ 00000100 D _textSrcClassRec     libXaw         TextSrc
+ 00000004 D _textSrcObjectClass  libXaw         TextSrc
+ 00000300 D __XawTextActionsTable libXaw         TextAction
+ 00000004 D __XawTextActionsTableCount libXaw         TextAction
+ 00000004 D __XawDefaultTextTranslations1 libXaw         TextTr
+ 00000004 D __XawDefaultTextTranslations2 libXaw         TextTr
+ 00000004 D __XawDefaultTextTranslations3 libXaw         TextTr
+ 00000100 D _toggleClassRec      libXaw         Toggle
+ 00000004 D _toggleWidgetClass   libXaw         Toggle
+ 00000140 D _treeClassRec        libXaw         Tree
+ 00000004 D _treeWidgetClass     libXaw         Tree
+ 00000100 D _vendorShellClassRec libXaw         Vendor
+ 00000004 D _vendorShellWidgetClass libXaw         Vendor
+ 00000140 D _viewportClassRec    libXaw         Viewport
+ 00000004 D _viewportWidgetClass libXaw         Viewport
diff -c /dev/null mit/lib/Xaw/libXaw.def:1.3
*** /dev/null	Sat Mar 12 00:38:29 1994
--- mit/lib/Xaw/libXaw.def	Sat Mar 12 00:38:29 1994
***************
*** 0 ****
--- 1,368 ----
+ /* libXaw : libXaw.def
+  * shared library description file
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/Xaw/libXaw.def,v 1.3 1993/03/20 03:33:50 dawes Exp $
+  */
+ 
+ /**/#address .text 0xB1800000
+ /**/#address .data 0xB1C00000
+ 
+ 
+ /**/#objects noload
+ ../X/libX11_s.a
+ ../Xt/libXt_s.a
+ ../Xmu/libXmu_s.a
+ 
+ /**/#branch
+ XawAsciiSave 1
+ XawAsciiSaveAsFile 2
+ XawAsciiSourceChanged 3
+ XawAsciiSourceFreeString 4
+ XawDialogAddButton 5
+ XawDialogGetValueString 6
+ XawFormDoLayout 7
+ XawInitializeWidgetSet 8
+ XawListChange 9
+ XawListHighlight 10
+ XawListShowCurrent 11
+ XawListUnhighlight 12
+ XawPanedAllowResize 13
+ XawPanedGetMinMax 14
+ XawPanedGetNumSub 15
+ XawPanedSetMinMax 16
+ XawPanedSetRefigureMode 17
+ XawScrollbarSetThumb 18
+ XawSimpleMenuAddGlobalActions 19
+ XawSimpleMenuClearActiveEntry 20
+ XawSimpleMenuGetActiveEntry 21
+ XawTextDisableRedisplay 22
+ XawTextDisplay 23
+ XawTextDisplayCaret 24
+ XawTextEnableRedisplay 25
+ XawTextGetInsertionPoint 26
+ XawTextGetSelectionPos 27
+ XawTextGetSource 28
+ XawTextInvalidate 29
+ XawTextReplace 30
+ XawTextSearch 31
+ XawTextSetInsertionPoint 32
+ XawTextSetSelection 33
+ XawTextSetSelectionArray 34
+ XawTextSetSource 35
+ XawTextSinkClearToBackground 36
+ XawTextSinkDisplayText 37
+ XawTextSinkFindDistance 38
+ XawTextSinkFindPosition 39
+ XawTextSinkGetCursorBounds 40
+ XawTextSinkInsertCursor 41
+ XawTextSinkMaxHeight 42
+ XawTextSinkMaxLines 43
+ XawTextSinkResolve 44
+ XawTextSinkSetTabs 45
+ XawTextSourceConvertSelection 46
+ XawTextSourceRead 47
+ XawTextSourceReplace 48
+ XawTextSourceScan 49
+ XawTextSourceSearch 50
+ XawTextSourceSetSelection 51
+ XawTextTopPosition 52
+ XawTextUnsetSelection 53
+ XawToggleChangeRadioGroup 54
+ XawToggleGetCurrent 55
+ XawToggleSetCurrent 56
+ XawToggleUnsetCurrent 57
+ XawTreeForceLayout 58
+ XawViewportSetCoordinates 59
+ XawViewportSetLocation 60
+ _XawTextAlterSelection 61
+ _XawTextBuildLineTable 62
+ _XawTextCheckResize 63
+ _XawTextClearAndCenterDisplay 64
+ _XawTextDoReplaceAction 65
+ _XawTextDoSearchAction 66
+ _XawTextExecuteUpdate 67
+ _XawTextGetSTRING 68
+ _XawTextGetText 69
+ _XawTextInsertFile 70
+ _XawTextInsertFileAction 71
+ _XawTextNeedsUpdating 72
+ _XawTextPopdownSearchAction 73
+ _XawTextPrepareToUpdate 74
+ _XawTextReplace 75
+ _XawTextSaltAwaySelection 76
+ _XawTextSearch 77
+ _XawTextSelectionList 78
+ _XawTextSetField 79
+ _XawTextSetScrollBars 80
+ _XawTextSetSelection 81
+ _XawTextShowPosition 82
+ _XawTextVScroll 83
+ _XawTextZapSelection 84
+ __default_libXaw_init_ 85
+ 
+ _libXaw_dummy 86-150
+ 
+ 
+ /**/#objects
+ DOWN/globals.o  /* All objects with global data must be come at first!*/
+ DOWN/pAsciiSink.o
+ DOWN/pAsciiSrc.o
+ DOWN/pAsciiText.o
+ DOWN/pBox.o
+ DOWN/pClock.o
+ DOWN/pCommand.o
+ DOWN/pDialog.o
+ DOWN/pForm.o
+ DOWN/pGrip.o
+ DOWN/pLabel.o
+ DOWN/pList.o
+ DOWN/pLogo.o
+ DOWN/pMailbox.o
+ DOWN/pMenuBotton.o
+ DOWN/pPaned.o
+ DOWN/pPanner.o
+ DOWN/pPorthole.o
+ DOWN/pRepeater.o
+ DOWN/pScrollbar.o
+ DOWN/pSimple.o
+ DOWN/pSimpleMenu.o
+ DOWN/pSme.o
+ DOWN/pSmeBSB.o
+ DOWN/pSmeLine.o
+ DOWN/pStripChart.o
+ DOWN/pText.o
+ DOWN/pTextSink.o
+ DOWN/pTextSrc.o
+ DOWN/pToggle.o
+ DOWN/pTree.o
+ DOWN/pVendor.o
+ DOWN/pViewport.o
+ DOWN/pFuture.o
+ DOWN/AllWidgets.o
+ DOWN/TextAction.o
+ /*
+  * Any additional global data must be inserted below this
+  * point to maintain the address in the objects before
+  */
+ DOWN/AsciiSink.o
+ DOWN/AsciiSrc.o
+ DOWN/AsciiText.o
+ DOWN/Box.o
+ DOWN/Clock.o
+ DOWN/Command.o
+ DOWN/Dialog.o
+ DOWN/Form.o
+ DOWN/Grip.o
+ DOWN/Label.o
+ DOWN/List.o
+ DOWN/Logo.o
+ DOWN/Mailbox.o
+ DOWN/MenuButton.o
+ DOWN/Paned.o
+ DOWN/Panner.o
+ DOWN/Porthole.o
+ DOWN/Repeater.o
+ DOWN/Scrollbar.o
+ DOWN/Simple.o
+ DOWN/SimpleMenu.o
+ DOWN/Sme.o
+ DOWN/SmeBSB.o
+ DOWN/SmeLine.o
+ DOWN/StripChart.o
+ DOWN/Text.o
+ DOWN/TextPop.o
+ DOWN/TextSink.o
+ DOWN/TextSrc.o
+ DOWN/TextTr.o
+ DOWN/Toggle.o
+ DOWN/Tree.o
+ DOWN/Vendor.o
+ DOWN/Viewport.o
+ DOWN/XawInit.o
+ 
+ 
+ 
+ /**/#init globals.o
+ _libXaw_XShapeCombineMask  XShapeCombineMask
+ _libXaw_XShapeQueryExtension  XShapeQueryExtension
+ _libXaw__ctype  _ctype
+ _libXaw_bcopy  bcopy
+ _libXaw_close  close
+ _libXaw_errno  errno
+ _libXaw_printf  printf
+ _libXaw_sprintf  sprintf
+ _libXaw_strcmp  strcmp
+ _libXaw_strcpy  strcpy
+ _libXaw_strncpy  strncpy
+ _libXaw_sys_errlist  sys_errlist
+ _libXaw_sys_nerr  sys_nerr
+ _libXaw__XawTextActionsTableCount  _XawTextActionsTableCount
+ _libXaw__aux__  __libXaw_init_stub_
+ _libXaw_asciiSrcObjectClass  asciiSrcObjectClass
+ _libXaw_asciiTextWidgetClass  asciiTextWidgetClass
+ _libXaw_commandWidgetClass  commandWidgetClass
+ _libXaw_formWidgetClass  formWidgetClass
+ _libXaw_gripWidgetClass  gripWidgetClass
+ _libXaw_labelWidgetClass  labelWidgetClass
+ _libXaw_scrollbarWidgetClass  scrollbarWidgetClass
+ _libXaw_smeBSBObjectClass  smeBSBObjectClass
+ _libXaw_toggleWidgetClass  toggleWidgetClass
+ _libXaw_vendorShellWidgetClass  vendorShellWidgetClass
+ 
+ /**/#init AllWidgets.o
+ _libXaw__aux__  __libXaw_init_stub_
+ 
+ /**/#init AsciiSink.o
+ _libXaw_asciiSinkObjectClass  asciiSinkObjectClass
+ 
+ /**/#init AsciiSrc.o
+ _libXaw_creat  creat
+ _libXaw_fclose  fclose
+ _libXaw_fopen  fopen
+ _libXaw_fread  fread
+ _libXaw_fseek  fseek
+ _libXaw_ftell  ftell
+ _libXaw_tmpnam  tmpnam
+ _libXaw_write  write
+ 
+ /**/#init Box.o
+ _libXaw_boxWidgetClass  boxWidgetClass
+ 
+ /**/#init Clock.o
+ _libXaw_asctime  asctime
+ _libXaw_localtime  localtime
+ _libXaw_time  time
+ _libXaw_clockWidgetClass  clockWidgetClass
+ 
+ /**/#init Dialog.o
+ _libXaw_dialogWidgetClass  dialogWidgetClass
+ 
+ /**/#init Label.o
+ _libXaw_strchr  strchr
+ 
+ /**/#init List.o
+ _libXaw_listWidgetClass  listWidgetClass
+ 
+ /**/#init Logo.o
+ _libXaw_logoWidgetClass  logoWidgetClass
+ 
+ /**/#init Mailbox.o
+ _libXaw__iob  _iob
+ _libXaw_exit  exit
+ _libXaw_fprintf  fprintf
+ _libXaw_getlogin  getlogin
+ _libXaw_getpwuid  getpwuid
+ _libXaw_getuid  getuid
+ _libXaw_stat  stat
+ _libXaw_strcat  strcat
+ _libXaw_system  system
+ _libXaw_mailboxWidgetClass  mailboxWidgetClass
+ 
+ /**/#init MenuButton.o
+ _libXaw_menuButtonWidgetClass  menuButtonWidgetClass
+ 
+ /**/#init Paned.o
+ _libXaw_toupper  toupper
+ _libXaw_panedWidgetClass  panedWidgetClass
+ 
+ /**/#init Panner.o
+ _libXaw_atof  atof
+ _libXaw_pannerWidgetClass  pannerWidgetClass
+ 
+ /**/#init Porthole.o
+ _libXaw_portholeWidgetClass  portholeWidgetClass
+ 
+ /**/#init Repeater.o
+ _libXaw_repeaterWidgetClass  repeaterWidgetClass
+ 
+ /**/#init Simple.o
+ _libXaw_simpleWidgetClass  simpleWidgetClass
+ 
+ /**/#init SimpleMenu.o
+ _libXaw_simpleMenuWidgetClass  simpleMenuWidgetClass
+ 
+ /**/#init Sme.o
+ _libXaw_smeObjectClass  smeObjectClass
+ 
+ /**/#init SmeLine.o
+ _libXaw_smeLineObjectClass  smeLineObjectClass
+ 
+ /**/#init StripChart.o
+ _libXaw_stripChartWidgetClass  stripChartWidgetClass
+ 
+ /**/#init Text.o
+ _libXaw_memset  memset
+ _libXaw_textWidgetClass  textWidgetClass
+ _libXaw__XA_CHARACTER_POSITION  _XA_CHARACTER_POSITION
+ _libXaw__XA_COMPOUND_TEXT  _XA_COMPOUND_TEXT
+ _libXaw__XA_DELETE  _XA_DELETE
+ _libXaw__XA_LENGTH  _XA_LENGTH
+ _libXaw__XA_LIST_LENGTH  _XA_LIST_LENGTH
+ _libXaw__XA_NULL  _XA_NULL
+ _libXaw__XA_SPAN  _XA_SPAN
+ _libXaw__XA_TARGETS  _XA_TARGETS
+ _libXaw__XA_TEXT  _XA_TEXT
+ 
+ /**/#init TextSink.o
+ _libXaw_textSinkObjectClass  textSinkObjectClass
+ 
+ /**/#init TextSrc.o
+ _libXaw_textSrcObjectClass  textSrcObjectClass
+ 
+ /**/#init TextAction.o
+ _libXaw_atoi  atoi
+ 
+ /**/#init TextPop.o
+ _libXaw_open  open
+ _libXaw_read  read
+ _libXaw_transientShellWidgetClass  transientShellWidgetClass
+ 
+ /**/#init Tree.o
+ _libXaw_treeWidgetClass  treeWidgetClass
+ 
+ /**/#init Vendor.o
+ _libXaw__aux__  __libXaw_init_stub_
+ 
+ /**/#init Viewport.o
+ _libXaw_viewportWidgetClass  viewportWidgetClass
+ 
+ /**/#init XawInit.o
+ _libXaw__aux__  __libXaw_init_stub_
+ 
+ 
+ 
+ 
+ /**/#libraries
+ /* Here can objects be specified, which will extracted from
+  * an specified archive library and then linked to the shared
+  * library. This can avoid unwanted referencing of other
+  * shared libraries.
+  * NOTE: this objects must be listed also under #objects!
+  * e.g.:
+ /lib/libc.a memcpy.o
+  * or e.g.:
+ #ifdef __GNUC__
+ GNULIB  _fixdfsi.o
+ #endif
+  *
+  * NOT USED YET
+  *
+  */
+ 
+ /**/#externals
+ /* Here you can specify objects which will only linked to the
+  * host shared library.
+  * That are e.g. objects which contain only big data you want
+  * to seperate from the text section. (See mit/util/mksv3shlib/README.)
+  */
+ InitLibStub.o
+ InitClnStub.o
+ DOWN/InitLib.o
+ DOWN/ChkShlibRev.o
+ DOWN/dummyBind.o
+ 
+ /* There must be a comment as last line */
diff -c /dev/null mit/lib/Xaw/pAsciiSink.c:1.2
*** /dev/null	Sat Mar 12 00:38:30 1994
--- mit/lib/Xaw/pAsciiSink.c	Sat Mar 12 00:38:30 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pAsciiSink.c
+  * ---------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pAsciiSink.c,v 1.2 1993/03/27 09:11:03 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/AsciiSinkP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef asciiSinkObjectClass
+ WidgetClass asciiSinkObjectClass = (WidgetClass)&asciiSinkClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pAsciiSrc.c:1.2
*** /dev/null	Sat Mar 12 00:38:30 1994
--- mit/lib/Xaw/pAsciiSrc.c	Sat Mar 12 00:38:30 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pAsciiSrc.c
+  * --------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pAsciiSrc.c,v 1.2 1993/03/27 09:11:05 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/AsciiSrcP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef asciiSrcObjectClass
+ WidgetClass asciiSrcObjectClass = (WidgetClass)&asciiSrcClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pAsciiText.c:1.2
*** /dev/null	Sat Mar 12 00:38:30 1994
--- mit/lib/Xaw/pAsciiText.c	Sat Mar 12 00:38:32 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pAscii.c
+  * ---------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pAsciiText.c,v 1.2 1993/03/27 09:11:06 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/AsciiTextP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef asciiTextWidgetClass
+ WidgetClass asciiTextWidgetClass = (WidgetClass)&asciiTextClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pBox.c:1.2
*** /dev/null	Sat Mar 12 00:38:32 1994
--- mit/lib/Xaw/pBox.c	Sat Mar 12 00:38:32 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pBox.c
+  * ---------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pBox.c,v 1.2 1993/03/27 09:11:08 dawes Exp $
+  */
+ 
+ #include        <X11/IntrinsicP.h>
+ #include        <X11/Xaw/BoxP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef boxWidgetClass
+ WidgetClass boxWidgetClass = (WidgetClass)&boxClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pClock.c:1.2
*** /dev/null	Sat Mar 12 00:38:32 1994
--- mit/lib/Xaw/pClock.c	Sat Mar 12 00:38:32 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pClock.c
+  * -----------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pClock.c,v 1.2 1993/03/27 09:11:09 dawes Exp $
+  */
+ 
+ #include        <X11/IntrinsicP.h>
+ #include        <X11/Xaw/ClockP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef clockWidgetClass
+ WidgetClass clockWidgetClass = (WidgetClass) &clockClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pCommand.c:1.2
*** /dev/null	Sat Mar 12 00:38:32 1994
--- mit/lib/Xaw/pCommand.c	Sat Mar 12 00:38:32 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pCommand.c
+  * -------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pCommand.c,v 1.2 1993/03/27 09:11:11 dawes Exp $
+  */
+ 
+ #include        <X11/IntrinsicP.h>
+ #include 	<X11/Xaw/CommandP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef commandWidgetClass
+ WidgetClass commandWidgetClass = (WidgetClass) &commandClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pDialog.c:1.2
*** /dev/null	Sat Mar 12 00:38:33 1994
--- mit/lib/Xaw/pDialog.c	Sat Mar 12 00:38:33 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pDialog.c
+  * ------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pDialog.c,v 1.2 1993/03/27 09:11:12 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/DialogP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef dialogWidgetClass
+ WidgetClass dialogWidgetClass = (WidgetClass)&dialogClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pForm.c:1.2
*** /dev/null	Sat Mar 12 00:38:33 1994
--- mit/lib/Xaw/pForm.c	Sat Mar 12 00:38:33 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pForm.c
+  * ----------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pForm.c,v 1.2 1993/03/27 09:11:14 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/FormP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef formWidgetClass
+ WidgetClass formWidgetClass = (WidgetClass)&formClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pFuture.c:1.3
*** /dev/null	Sat Mar 12 00:38:33 1994
--- mit/lib/Xaw/pFuture.c	Sat Mar 12 00:38:33 1994
***************
*** 0 ****
--- 1,37 ----
+ /* libXaw : pFuture.c
+  * ------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pFuture.c,v 1.3 1993/03/20 03:33:52 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ 
+ #ifdef SVR3SHLIB
+ 
+ WidgetClass __futureWidgetClass_0_ = 0;
+ WidgetClass __futureWidgetClass_1_ = 0;
+ WidgetClass __futureWidgetClass_2_ = 0;
+ WidgetClass __futureWidgetClass_3_ = 0;
+ WidgetClass __futureWidgetClass_4_ = 0;
+ WidgetClass __futureWidgetClass_5_ = 0;
+ WidgetClass __futureWidgetClass_6_ = 0;
+ WidgetClass __futureWidgetClass_7_ = 0;
+ WidgetClass __futureWidgetClass_8_ = 0;
+ WidgetClass __futureWidgetClass_9_ = 0;
+ WidgetClass __futureWidgetClass_10_ = 0;
+ WidgetClass __futureWidgetClass_11_ = 0;
+ WidgetClass __futureWidgetClass_12_ = 0;
+ WidgetClass __futureWidgetClass_13_ = 0;
+ WidgetClass __futureWidgetClass_14_ = 0;
+ WidgetClass __futureWidgetClass_15_ = 0;
+ WidgetClass __futureWidgetClass_16_ = 0;
+ WidgetClass __futureWidgetClass_17_ = 0;
+ WidgetClass __futureWidgetClass_18_ = 0;
+ WidgetClass __futureWidgetClass_19_ = 0;
+ 
+ char __libXaw_sp2__[32] = "";
+ 
+ #endif
diff -c /dev/null mit/lib/Xaw/pGrip.c:1.2
*** /dev/null	Sat Mar 12 00:38:33 1994
--- mit/lib/Xaw/pGrip.c	Sat Mar 12 00:38:34 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pGrip.c
+  * ----------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pGrip.c,v 1.2 1993/03/27 09:11:15 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/GripP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef gripWidgetClass
+ WidgetClass gripWidgetClass = (WidgetClass) &gripClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pLabel.c:1.3
*** /dev/null	Sat Mar 12 00:38:34 1994
--- mit/lib/Xaw/pLabel.c	Sat Mar 12 00:38:34 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pLabel.c
+  * -----------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pLabel.c,v 1.3 1993/05/22 06:43:37 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/LabelP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef labelWidgetClass
+ WidgetClass labelWidgetClass = (WidgetClass)&labelClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pList.c:1.2
*** /dev/null	Sat Mar 12 00:38:34 1994
--- mit/lib/Xaw/pList.c	Sat Mar 12 00:38:34 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pList.c
+  * ----------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pList.c,v 1.2 1993/03/27 09:11:18 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/ListP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef listWidgetClass
+ WidgetClass listWidgetClass = (WidgetClass)&listClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pLogo.c:1.2
*** /dev/null	Sat Mar 12 00:38:34 1994
--- mit/lib/Xaw/pLogo.c	Sat Mar 12 00:38:35 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pLogo.c
+  * ----------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pLogo.c,v 1.2 1993/03/27 09:11:20 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/LogoP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef logoWidgetClass
+ WidgetClass logoWidgetClass = (WidgetClass) &logoClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pMailbox.c:1.2
*** /dev/null	Sat Mar 12 00:38:35 1994
--- mit/lib/Xaw/pMailbox.c	Sat Mar 12 00:38:35 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pMailbox.c
+  * -------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pMailbox.c,v 1.2 1993/03/27 09:11:21 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/MailboxP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef mailboxWidgetClass
+ WidgetClass mailboxWidgetClass = (WidgetClass) &mailboxClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pMenuBotton.c:1.2
*** /dev/null	Sat Mar 12 00:38:35 1994
--- mit/lib/Xaw/pMenuBotton.c	Sat Mar 12 00:38:35 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : p.MenuBotton.c
+  * -----------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pMenuBotton.c,v 1.2 1993/03/27 09:11:23 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/MenuButtoP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef menuButtonWidgetClass
+ WidgetClass menuButtonWidgetClass = (WidgetClass) &menuButtonClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pPaned.c:1.2
*** /dev/null	Sat Mar 12 00:38:35 1994
--- mit/lib/Xaw/pPaned.c	Sat Mar 12 00:38:36 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pPaned.c
+  * -----------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pPaned.c,v 1.2 1993/03/27 09:11:25 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/PanedP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef panedWidgetClass
+ WidgetClass panedWidgetClass = (WidgetClass) &panedClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pPanner.c:1.2
*** /dev/null	Sat Mar 12 00:38:36 1994
--- mit/lib/Xaw/pPanner.c	Sat Mar 12 00:38:36 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pPanner.c
+  * ------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pPanner.c,v 1.2 1993/03/27 09:11:26 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/PannerP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef pannerWidgetClass
+ WidgetClass pannerWidgetClass = (WidgetClass) &pannerClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pPorthole.c:1.2
*** /dev/null	Sat Mar 12 00:38:36 1994
--- mit/lib/Xaw/pPorthole.c	Sat Mar 12 00:38:36 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pPorthole.c
+  * --------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pPorthole.c,v 1.2 1993/03/27 09:11:28 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/PortholeP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef portholeWidgetClass
+ WidgetClass portholeWidgetClass = (WidgetClass) &portholeClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pRepeater.c:1.2
*** /dev/null	Sat Mar 12 00:38:36 1994
--- mit/lib/Xaw/pRepeater.c	Sat Mar 12 00:38:36 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pRepeater.c
+  * --------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pRepeater.c,v 1.2 1993/03/27 09:11:29 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/RepeaterP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef repeaterWidgetClass
+ WidgetClass repeaterWidgetClass = (WidgetClass) &repeaterClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pScrollbar.c:1.2
*** /dev/null	Sat Mar 12 00:38:37 1994
--- mit/lib/Xaw/pScrollbar.c	Sat Mar 12 00:38:37 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pScrollbar.c
+  * ---------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pScrollbar.c,v 1.2 1993/03/27 09:11:31 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/ScrollbarP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef scrollbarWidgetClass
+ WidgetClass scrollbarWidgetClass = (WidgetClass)&scrollbarClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pSimple.c:1.2
*** /dev/null	Sat Mar 12 00:38:37 1994
--- mit/lib/Xaw/pSimple.c	Sat Mar 12 00:38:37 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pSimple.c
+  * ------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pSimple.c,v 1.2 1993/03/27 09:11:32 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/SimpleP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef simpleWidgetClass
+ WidgetClass simpleWidgetClass = (WidgetClass)&simpleClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pSimpleMenu.c:1.2
*** /dev/null	Sat Mar 12 00:38:37 1994
--- mit/lib/Xaw/pSimpleMenu.c	Sat Mar 12 00:38:37 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pSimpleMenu.c
+  * ----------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pSimpleMenu.c,v 1.2 1993/03/27 09:11:34 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/SimpleMenP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef simpleMenuWidgetClass
+ WidgetClass simpleMenuWidgetClass = (WidgetClass)&simpleMenuClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pSme.c:1.2
*** /dev/null	Sat Mar 12 00:38:38 1994
--- mit/lib/Xaw/pSme.c	Sat Mar 12 00:38:38 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pSme.c
+  * ---------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pSme.c,v 1.2 1993/03/27 09:11:35 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/SmeP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef smeObjectClass
+ WidgetClass smeObjectClass = (WidgetClass) &smeClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pSmeBSB.c:1.2
*** /dev/null	Sat Mar 12 00:38:38 1994
--- mit/lib/Xaw/pSmeBSB.c	Sat Mar 12 00:38:38 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pSmeBSB.c
+  * ------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pSmeBSB.c,v 1.2 1993/03/27 09:11:37 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/SmeBSBP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef smeBSBObjectClass
+ WidgetClass smeBSBObjectClass = (WidgetClass) &smeBSBClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pSmeLine.c:1.2
*** /dev/null	Sat Mar 12 00:38:38 1994
--- mit/lib/Xaw/pSmeLine.c	Sat Mar 12 00:38:38 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pSmeLine.c
+  * -------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pSmeLine.c,v 1.2 1993/03/27 09:11:38 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/SmeLineP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef smeLineObjectClass
+ WidgetClass smeLineObjectClass = (WidgetClass) &smeLineClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pStripChart.c:1.2
*** /dev/null	Sat Mar 12 00:38:38 1994
--- mit/lib/Xaw/pStripChart.c	Sat Mar 12 00:38:39 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pStripChart.c
+  * ----------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pStripChart.c,v 1.2 1993/03/27 09:11:40 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/StripCharP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef stripChartWidgetClass
+ WidgetClass stripChartWidgetClass = (WidgetClass) &stripChartClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pText.c:1.2
*** /dev/null	Sat Mar 12 00:38:39 1994
--- mit/lib/Xaw/pText.c	Sat Mar 12 00:38:39 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pText.c
+  * ----------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pText.c,v 1.2 1993/03/27 09:11:42 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/TextP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef textWidgetClass
+ WidgetClass textWidgetClass = (WidgetClass)&textClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pTextSink.c:1.2
*** /dev/null	Sat Mar 12 00:38:39 1994
--- mit/lib/Xaw/pTextSink.c	Sat Mar 12 00:38:39 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pTextSink.c
+  * --------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pTextSink.c,v 1.2 1993/03/27 09:11:43 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/TextSinkP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef textSinkObjectClass
+ WidgetClass textSinkObjectClass = (WidgetClass)&textSinkClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pTextSrc.c:1.2
*** /dev/null	Sat Mar 12 00:38:39 1994
--- mit/lib/Xaw/pTextSrc.c	Sat Mar 12 00:38:40 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pTextSrc.c
+  * -------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pTextSrc.c,v 1.2 1993/03/27 09:11:45 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/TextSrcP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef textSrcObjectClass
+ WidgetClass textSrcObjectClass = (WidgetClass)&textSrcClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pToggle.c:1.2
*** /dev/null	Sat Mar 12 00:38:40 1994
--- mit/lib/Xaw/pToggle.c	Sat Mar 12 00:38:40 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pToggle.c
+  * ------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pToggle.c,v 1.2 1993/03/27 09:11:47 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/ToggleP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef toggleWidgetClass
+ WidgetClass toggleWidgetClass = (WidgetClass) &toggleClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pTree.c:1.2
*** /dev/null	Sat Mar 12 00:38:40 1994
--- mit/lib/Xaw/pTree.c	Sat Mar 12 00:38:40 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pTree.c
+  * ----------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pTree.c,v 1.2 1993/03/27 09:11:48 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/TreeP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef treeWidgetClass
+ WidgetClass treeWidgetClass = (WidgetClass) &treeClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pVendor.c:1.2
*** /dev/null	Sat Mar 12 00:38:40 1994
--- mit/lib/Xaw/pVendor.c	Sat Mar 12 00:38:40 1994
***************
*** 0 ****
--- 1,19 ----
+ /* libXaw : pVendor.c
+  * ------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pVendor.c,v 1.2 1993/03/27 09:11:49 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Shell.h>
+ #include <X11/ShellP.h>
+ #include <X11/Vendor.h>
+ #include <X11/VendorP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef vendorShellWidgetClass
+ WidgetClass vendorShellWidgetClass = (WidgetClass) &vendorShellClassRec;
+ #endif
diff -c /dev/null mit/lib/Xaw/pViewport.c:1.2
*** /dev/null	Sat Mar 12 00:38:41 1994
--- mit/lib/Xaw/pViewport.c	Sat Mar 12 00:38:41 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXaw : pViewport.c
+  * --------------------
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xaw/pViewport.c,v 1.2 1993/03/27 09:11:51 dawes Exp $
+  */
+ 
+ #include <X11/IntrinsicP.h>
+ #include <X11/Xaw/ViewportP.h>
+ 
+ #ifdef SVR3SHLIB
+ #undef viewportWidgetClass
+ WidgetClass viewportWidgetClass = (WidgetClass)&viewportClassRec;
+ #endif
diff -c mit/lib/Xdmcp/Fill.c:1.1.1.1 mit/lib/Xdmcp/Fill.c:2.0
*** mit/lib/Xdmcp/Fill.c:1.1.1.1	Sat Mar 12 00:38:45 1994
--- mit/lib/Xdmcp/Fill.c	Sat Mar 12 00:38:45 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xdmcp/Fill.c,v 2.0 1993/09/22 15:32:23 dawes Exp $
   * $XConsortium: Fill.c,v 1.4 91/07/16 20:33:50 gildea Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 28,39 ****
--- 29,52 ----
  #include <X11/Xmd.h>
  #include <X11/Xdmcp.h>
  
+ #if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN)
+ #define HASSOCKETS
+ #endif
+ 
  #ifdef STREAMSCONN
  #include <tiuser.h>
  #else
+ #ifdef HASSOCKETS
+ #ifndef _MINIX
  #include <sys/socket.h>
+ #else /* _MINIX */
+ #include <net/gen/udp.h>
+ #include <net/gen/udp_hdr.h>
+ #endif /* !_MINIX */
  #endif
+ #endif
  
+ #ifndef _MINIX
  int
  XdmcpFill (fd, buffer, from, fromlen)
      int		    fd;
***************
*** 71,79 ****
      buffer->count = dataunit.udata.len;
      *fromlen = dataunit.addr.len;
  #else
      buffer->count = recvfrom (fd, buffer->data, buffer->size, 0,
  			      (struct sockaddr *)from, fromlen);
! #endif
      if (buffer->count < 6) {
  	buffer->count = 0;
  	return FALSE;
--- 84,141 ----
      buffer->count = dataunit.udata.len;
      *fromlen = dataunit.addr.len;
  #else
+ #ifdef HASSOCKETS
      buffer->count = recvfrom (fd, buffer->data, buffer->size, 0,
  			      (struct sockaddr *)from, fromlen);
! #else
!     buffer->count = 0;
! #endif /* HASSOCKETS */
! #endif /* STREAMSCONN */
!     if (buffer->count < 6) {
! 	buffer->count = 0;
! 	return FALSE;
!     }
!     return TRUE;
! }
! #else /* _MINIX */
! int
! MNX_XdmcpFill (fd, buffer, from, fromlen, data, datalen)
!     int		    fd;
!     XdmcpBufferPtr  buffer;
!     XdmcpNetaddr    from;	/* return */
!     int		    *fromlen;	/* return */
!     char	    *data;
!     int		    datalen;
! {
!     BYTE    *newBuf;
!     struct sockaddr *from_addr;
!     udp_io_hdr_t *udp_io_hdr;
! 
!     if (buffer->size < XDM_MAX_MSGLEN)
!     {
! 	newBuf = (BYTE *) Xalloc (XDM_MAX_MSGLEN);
! 	if (newBuf)
! 	{
! 	    Xfree (buffer->data);
! 	    buffer->data = newBuf;
! 	    buffer->size = XDM_MAX_MSGLEN;
! 	}
!     }
!     buffer->pointer = 0;
!     udp_io_hdr= (udp_io_hdr_t *)data;
!     data += sizeof(udp_io_hdr_t) + udp_io_hdr->uih_ip_opt_len;
!     datalen -= sizeof(udp_io_hdr_t) + udp_io_hdr->uih_ip_opt_len;
!     buffer->count= udp_io_hdr->uih_data_len;
!     if (buffer->count > datalen)
!     {
!     	buffer->count= 0;
!     	return FALSE;
!     }
!     bcopy(data, (char *)buffer->data, buffer->count);
!     from_addr= (struct sockaddr *)from;
!     from_addr->sa_u.sa_family= AF_INET;
!     from_addr->sa_u.sa_in.sin_addr= udp_io_hdr->uih_src_addr;
!     from_addr->sa_u.sa_in.sin_port= udp_io_hdr->uih_src_port;
      if (buffer->count < 6) {
  	buffer->count = 0;
  	return FALSE;
***************
*** 80,82 ****
--- 142,145 ----
      }
      return TRUE;
  }
+ #endif /* !_MINIX */
diff -c mit/lib/Xdmcp/Flush.c:1.1.1.1 mit/lib/Xdmcp/Flush.c:2.0
*** mit/lib/Xdmcp/Flush.c:1.1.1.1	Sat Mar 12 00:38:45 1994
--- mit/lib/Xdmcp/Flush.c	Sat Mar 12 00:38:45 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xdmcp/Flush.c,v 2.0 1993/09/22 15:32:25 dawes Exp $
   * $XConsortium: Flush.c,v 1.4 91/07/16 20:33:52 gildea Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 28,37 ****
--- 29,50 ----
  #include <X11/Xmd.h>
  #include <X11/Xdmcp.h>
  
+ #if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN)
+ #define HASSOCKETS
+ #endif
+ 
  #ifdef STREAMSCONN
  #include <tiuser.h>
  #else
+ #ifdef HASSOCKETS
+ #ifndef _MINIX
  #include <sys/socket.h>
+ #else /* _MINIX */
+ #include <errno.h>
+ #include <net/gen/udp.h>
+ #include <net/gen/udp_hdr.h>
+ #endif /* !_MINIX */
+ #endif
  #endif
  
  int
***************
*** 42,47 ****
--- 55,66 ----
      int		    tolen;
  {
      int result;
+ #if _MINIX
+     struct sockaddr *to_addr;
+     char *b;
+     udp_io_hdr_t *udp_io_hdr;
+     int flags, s_errno;
+ #endif /* !_MINIX */
  
  #ifdef STREAMSCONN
      struct t_unitdata dataunit;
***************
*** 55,64 ****
      if (result < 0)
  	return FALSE;
  #else
      result = sendto (fd, buffer->data, buffer->pointer, 0,
  		     (struct sockaddr *)to, tolen);
      if (result != buffer->pointer)
  	return FALSE;
! #endif
      return TRUE;
  }
--- 74,114 ----
      if (result < 0)
  	return FALSE;
  #else
+ #ifdef HASSOCKETS
+ #ifndef _MINIX
      result = sendto (fd, buffer->data, buffer->pointer, 0,
  		     (struct sockaddr *)to, tolen);
      if (result != buffer->pointer)
  	return FALSE;
! #else /* _MINIX */
!     to_addr= (struct sockaddr *)to;
!     b= (char *)Xalloc(buffer->pointer + sizeof(udp_io_hdr_t));
!     if (b == NULL)
!     	return FALSE;
!     udp_io_hdr= (udp_io_hdr_t *)b;
!     bcopy((char *)buffer->data, b+sizeof(udp_io_hdr_t), buffer->pointer);
!     udp_io_hdr->uih_dst_addr= to_addr->sa_u.sa_in.sin_addr;
!     udp_io_hdr->uih_dst_port= to_addr->sa_u.sa_in.sin_port;
!     udp_io_hdr->uih_ip_opt_len= 0;
!     udp_io_hdr->uih_data_len= buffer->pointer;
! 
!     /* Make the write synchronous by turning of asynch I/O */
!     flags= fcntl(fd, F_GETFD);
!     fcntl(fd, F_SETFD, flags & ~FD_ASYNCHIO);
!     result= write(fd, b, buffer->pointer + sizeof(udp_io_hdr_t));
!     s_errno= errno;
!     Xfree(b);
!     fcntl(fd, F_SETFD, flags);
!     if (result != buffer->pointer + sizeof(udp_io_hdr_t))
!     {
!     	ErrorF("XdmcpFlush: unable to write: %d, '%s'\n", result,
!     		strerror(s_errno));
!     	return FALSE;
!     }
! #endif /* !_MINIX */
! #else
!     return FALSE;
! #endif /* HASSOCKETS */
! #endif /* STREAMSCONN */
      return TRUE;
  }
diff -c mit/lib/Xdmcp/Imakefile:1.1.1.1 mit/lib/Xdmcp/Imakefile:1.4
*** mit/lib/Xdmcp/Imakefile:1.1.1.1	Sat Mar 12 00:38:46 1994
--- mit/lib/Xdmcp/Imakefile	Sat Mar 12 00:38:46 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/lib/Xdmcp/Imakefile,v 1.4 1993/03/27 09:16:43 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.19 91/09/18 14:28:52 rws Exp $
  #define DoNormalLib NormalLibXdmcp
  #define DoSharedLib SharedLibXdmcp
***************
*** 124,129 ****
--- 125,132 ----
  
  LintLibraryTarget(Xdmcp,$(SRCS))
  InstallLintLibrary(Xdmcp,$(LINTLIBDIR))
+ 
+ InstallLinkKitLibrary(Xdmcp,$(LINKKITDIR)/lib)
  
  BuildIncludes($(HEADERS),.,.)
  
diff -c mit/lib/Xdmcp/Wrap.c:1.1.1.1 mit/lib/Xdmcp/Wrap.c:1.2
*** mit/lib/Xdmcp/Wrap.c:1.1.1.1	Sat Mar 12 00:38:47 1994
--- mit/lib/Xdmcp/Wrap.c	Sat Mar 12 00:38:47 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xdmcp/Wrap.c,v 1.2 1993/05/22 06:45:12 dawes Exp $
   * $XConsortium: Wrap.c,v 1.8 91/09/10 14:34:11 keith Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 29,34 ****
--- 30,39 ----
  #include <X11/Xdmcp.h>
  
  #ifdef HASXDMAUTH
+ 
+ #ifdef SVR3SHLIB
+ #undef XdmcpWrap
+ #endif
  
  /*
   * The following function exists only to demonstrate the
diff -c mit/lib/Xmu/Atoms.c:1.1.1.1 mit/lib/Xmu/Atoms.c:1.3
*** mit/lib/Xmu/Atoms.c:1.1.1.1	Sat Mar 12 00:38:51 1994
--- mit/lib/Xmu/Atoms.c	Sat Mar 12 00:38:52 1994
***************
*** 1,4 ****
--- 1,5 ----
  /* $XConsortium: Atoms.c,v 1.15 91/06/30 17:49:57 rws Exp $
+  * $XFree86: mit/lib/Xmu/Atoms.c,v 1.3 1993/03/27 09:16:59 dawes Exp $
   *
   * Copyright 1988 by the Massachusetts Institute of Technology
   *
***************
*** 20,25 ****
--- 21,39 ----
   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   *
   */
+ 
+ #ifdef SVR3SHLIB
+ #undef _XA_CLASS
+ #undef _XA_CLIENT_WINDOW
+ #undef _XA_HOSTNAME
+ #undef _XA_IP_ADDRESS
+ #undef _XA_NAME
+ #undef _XA_NET_ADDRESS
+ #undef _XA_OWNER_OS
+ #undef _XA_TARGETS
+ #undef _XA_TIMESTAMP
+ #undef _XA_USER
+ #endif
  
  /*
   * This file contains routines to cache atoms, avoiding multiple
diff -c /dev/null mit/lib/Xmu/ChkShlibRev.c:1.2
*** /dev/null	Sat Mar 12 00:38:52 1994
--- mit/lib/Xmu/ChkShlibRev.c	Sat Mar 12 00:38:52 1994
***************
*** 0 ****
--- 1,34 ----
+ /* libXmu: ChkShlibRev.c
+  *
+  * This code is linked to the clients and is called by their .init sections.
+  * It checks the SVR3 target shared library revision.
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xmu/ChkShlibRev.c,v 1.2 1993/03/27 09:17:02 dawes Exp $
+  */
+ 
+ #include <stdio.h>
+ 
+ #ifdef SVR3SHLIB
+ #ifdef __STDC__
+ #define Const const
+ #else
+ #define Const /**/
+ #endif
+ 
+ extern Const char *_shared_libXmu_version;
+ 
+ void __check_libXmu_rev_()
+ {
+ 
+   /* check revision
+    */
+ 
+   if(strcmp(_shared_libXmu_version, SOXMUREV))
+ 	fprintf(stderr, "Warning: %s has other revision (%s) than expected"
+ 			" %s\n", TARGET, _shared_libXmu_version, SOXMUREV);
+ 
+ }
+ #endif
+ 
diff -c mit/lib/Xmu/CvtStdSel.c:1.1.1.1 mit/lib/Xmu/CvtStdSel.c:1.5
*** mit/lib/Xmu/CvtStdSel.c:1.1.1.1	Sat Mar 12 00:38:52 1994
--- mit/lib/Xmu/CvtStdSel.c	Sat Mar 12 00:38:52 1994
***************
*** 1,4 ****
--- 1,5 ----
  /* $XConsortium: CvtStdSel.c,v 1.23 91/04/11 09:04:08 rws Exp $
+  * $XFree86: mit/lib/Xmu/CvtStdSel.c,v 1.5 1993/05/04 15:00:15 dawes Exp $
   *
   * Copyright 1988 by the Massachusetts Institute of Technology
   *
***************
*** 27,32 ****
--- 28,37 ----
   *	XmuConvertStandardSelection()	return a known selection
   */
  
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
+ 
  #ifdef SYSVNET
  #include <interlan/il_types.h>
  #define __TYPES__		/* prevent #include <sys/types.h> in Xlib.h */
***************
*** 39,48 ****
  #include <X11/ShellP.h>
  #include <stdio.h>
  
! #ifndef SYSVNET
  #include <netdb.h>
  #include <sys/socket.h>
  #endif
  
  #include "Atoms.h"
  #include "StdSel.h"
--- 44,55 ----
  #include <X11/ShellP.h>
  #include <stdio.h>
  
! #if !defined(SYSVNET) && !defined(AMOEBA) && !defined(_MINIX)
! #if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN)
  #include <netdb.h>
  #include <sys/socket.h>
  #endif
+ #endif
  
  #include "Atoms.h"
  #include "StdSel.h"
***************
*** 72,77 ****
--- 79,88 ----
  #endif
  #endif
  
+ #ifdef SCO
+ extern int uname();
+ #endif
+ 
  static char *get_os_name ()
  {
  #ifdef OS_NAME
***************
*** 186,192 ****
  	*format = 8;
  	return True;
      }
! #ifdef TCPCONN
      if (*target == XA_IP_ADDRESS(d)) {
  	char hostname[1024];
  
--- 197,203 ----
  	*format = 8;
  	return True;
      }
! #if defined(TCPCONN) && !defined(_MINIX)
      if (*target == XA_IP_ADDRESS(d)) {
  	char hostname[1024];
  
diff -c mit/lib/Xmu/Imakefile:1.1.1.2 mit/lib/Xmu/Imakefile:2.1
*** mit/lib/Xmu/Imakefile:1.1.1.2	Sat Mar 12 00:38:53 1994
--- mit/lib/Xmu/Imakefile	Sat Mar 12 00:38:53 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/lib/Xmu/Imakefile,v 2.1 1994/01/13 08:49:30 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.74 91/12/20 11:20:22 rws Exp $
  XCOMM
  XCOMM This library contains miscellaneous utility routines and is not part
***************
*** 97,103 ****
  	VisCmap.c \
  	WidgetNode.c \
  	Xct.c \
! 	sharedlib.c
  
  #if SharedDataSeparation
  UNSHAREDOBJS = sharedlib.o
--- 98,107 ----
  	VisCmap.c \
  	WidgetNode.c \
  	Xct.c \
! 	sharedlib.c \
! 	globals.c \
! 	InitLibStub.s \
! 	ChkShlibRev.c
  
  #if SharedDataSeparation
  UNSHAREDOBJS = sharedlib.o
***************
*** 147,171 ****
  	WidgetNode.o \
  	Xct.o
  
  LibraryObjectRule()
  
  SpecialLibObjectRule(CvtStdSel.o,$(ICONFIGFILES),$(CSSDEFS))
  SpecialLibObjectRule(LocBitmap.o,$(ICONFIGFILES),$(BITDEFS))
  #if DoSharedLib && SharedDataSeparation
! SpecialObjectRule(sharedlib.o,,$(SHLIBDEF))
  #endif
  
  #if DoSharedLib
! #if SunPost411FCSLd
  libXmu.so.$(SOXMUREV): $(EXTENSIONSRC)/lib/libXext.so.$(SOXEXTREV)
  
  $(EXTENSIONSRC)/lib/libXext.so.$(SOXEXTREV):
  	cd $(EXTENSIONSRC)/lib; make libXext.so.$(SOXEXTREV)
  #endif
  #if DoNormalLib
  SharedLibraryTarget(Xmu,$(SOXMUREV),$(OBJS),shared,..)
  #else
  SharedLibraryTarget(Xmu,$(SOXMUREV),$(OBJS),.,.)
  #endif
  SharedLibraryDataTarget(Xmu,$(SOXMUREV),$(UNSHAREDOBJS))
  #ifdef RsArchitecture
--- 151,195 ----
  	WidgetNode.o \
  	Xct.o
  
+ #if defined(i386SVR3Architecture) && DoSharedLib
+ SVR3SHLIBOBJS = \
+ 	globals.o \
+ 	InitLibStub.o \
+ 	ChkShlibRev.o
+ #endif
+ 
  LibraryObjectRule()
  
+ #if defined(i386SVR3Architecture) && DoSharedLib
+ SpecialLibObjectRule(globals.o,$(ICONFIGFILES),-D_libXmu_import -DSOXMUREV=\"$(SOXMUREV)\")
+ SpecialLibObjectRule(ChkShlibRev.o,,-D_libXmu_import -DSOXMUREV=\"$(SOXMUREV)\" -DTARGET=\"$(LIBDIR)/shlib/libXmu.$(SOXMUREV)\")
+ #endif
+ 
  SpecialLibObjectRule(CvtStdSel.o,$(ICONFIGFILES),$(CSSDEFS))
  SpecialLibObjectRule(LocBitmap.o,$(ICONFIGFILES),$(BITDEFS))
  #if DoSharedLib && SharedDataSeparation
! SpecialObjectRule(sharedlib.o,sharedlib.c,$(SHLIBDEF))
  #endif
  
  #if DoSharedLib
! #if defined(SunPost411FCSLd) || defined(i386BsdArchitecture)
  libXmu.so.$(SOXMUREV): $(EXTENSIONSRC)/lib/libXext.so.$(SOXEXTREV)
  
  $(EXTENSIONSRC)/lib/libXext.so.$(SOXEXTREV):
  	cd $(EXTENSIONSRC)/lib; make libXext.so.$(SOXEXTREV)
  #endif
+ #ifndef i386SVR3Architecture
  #if DoNormalLib
  SharedLibraryTarget(Xmu,$(SOXMUREV),$(OBJS),shared,..)
  #else
  SharedLibraryTarget(Xmu,$(SOXMUREV),$(OBJS),.,.)
+ #endif
+ #else
+ #if DoNormalLib
+ SharedLibraryTarget(Xmu,$(SOXMUREV),$(OBJS) $(SVR3SHLIBOBJS),shared,..)
+ #else
+ SharedLibraryTarget(Xmu,$(SOXMUREV),$(OBJS) $(SVR3SHLIBOBJS),.,.)
+ #endif
  #endif
  SharedLibraryDataTarget(Xmu,$(SOXMUREV),$(UNSHAREDOBJS))
  #ifdef RsArchitecture
diff -c /dev/null mit/lib/Xmu/InitLibStub.s:1.2
*** /dev/null	Sat Mar 12 00:38:53 1994
--- mit/lib/Xmu/InitLibStub.s	Sat Mar 12 00:38:53 1994
***************
*** 0 ****
--- 1,28 ----
+ 	.file	"InitLibStub.s"
+ 
+ /#####################################################################
+ /# InitLibStub.s						     #
+ /# ----------------------------------------------------------------- #
+ /# This stub goes to .init section of the client binary. It checks   #
+ /# the revision of the library and calls the init code for the       #
+ /# library							     #
+ /# Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany       #
+ /# (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)		     #
+ /#####################################################################
+ 
+ /# $XFree86: mit/lib/Xmu/InitLibStub.s,v 1.2 1993/03/27 09:17:05 dawes Exp $
+ 
+ .section .init,"x" 
+ 
+ 	.align 4
+ 	.globl __libXmu_init_stub_
+ 
+ __libXmu_init_stub_:
+ 
+ / check revision of target shared library
+ 
+         pushl %ebp
+         movl %esp,%ebp
+         call __check_libXmu_rev_
+         leave
+ 
diff -c mit/lib/Xmu/LocBitmap.c:1.1.1.1 mit/lib/Xmu/LocBitmap.c:1.4
*** mit/lib/Xmu/LocBitmap.c:1.1.1.1	Sat Mar 12 00:38:54 1994
--- mit/lib/Xmu/LocBitmap.c	Sat Mar 12 00:38:54 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xmu/LocBitmap.c,v 1.4 1993/05/24 12:37:17 dawes Exp $
   * $XConsortium: LocBitmap.c,v 1.16 91/07/02 09:09:59 rws Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 23,28 ****
--- 24,32 ----
   * Author:  Jim Fulton, MIT X Consortium
   */
  
+ #ifdef SCO324
+ #include <X11/Xos.h>
+ #endif
  #include <X11/Xlib.h>
  #include <X11/Xresource.h>
  #include <X11/Xutil.h>
***************
*** 29,34 ****
--- 33,44 ----
  #include <X11/Xmu/CvtCache.h>
  #include <X11/Xmu/Drawing.h>
  
+ #ifndef X_NOT_STDC_ENV
+ #include <stdlib.h>
+ #else
+ extern char *getenv();
+ #endif
+ 
  #ifndef X_NOT_POSIX
  #ifdef _POSIX_SOURCE
  #include <limits.h>
***************
*** 152,157 ****
--- 162,169 ----
  	char *fn = filename;
  	Pixmap pixmap;
  	unsigned char *data;
+ 	char bitmappath[PATH_MAX];
+ 	char *xwinhome = NULL;
  
  	switch (i) {
  	  case 1:
***************
*** 169,175 ****
  	    }
  	    continue;
  	  case 3:
! 	    sprintf (filename, "%s/%s", BITMAPDIR, name);
  	    break;
  	  case 4:
  	    if (!try_plain_name) continue;
--- 181,193 ----
  	    }
  	    continue;
  	  case 3:
! 	    if ((xwinhome = getenv("XWINHOME")) == NULL) {
! 		strcpy(bitmappath, BITMAPDIR);
! 	    }
! 	    else {
! 		sprintf(bitmappath, "%s/include/X11/bitmaps", xwinhome);
! 	    }
! 	    sprintf (filename, "%s/%s", bitmappath, name);
  	    break;
  	  case 4:
  	    if (!try_plain_name) continue;
diff -c mit/lib/Xmu/RdBitF.c:1.1.1.1 mit/lib/Xmu/RdBitF.c:1.5
*** mit/lib/Xmu/RdBitF.c:1.1.1.1	Sat Mar 12 00:38:55 1994
--- mit/lib/Xmu/RdBitF.c	Sat Mar 12 00:38:55 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xmu/RdBitF.c,v 1.5 1993/05/24 12:37:19 dawes Exp $
   * $XConsortium: RdBitF.c,v 1.8 91/03/09 16:27:55 rws Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 40,45 ****
--- 41,50 ----
   * Based on an optimized version provided by Jim Becker, Auguest 5, 1988.
   */
  
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
+ 
  #include <X11/Xos.h>
  #include <X11/Xlib.h>
  #include <X11/Xutil.h>
***************
*** 46,51 ****
--- 51,70 ----
  #include <stdio.h>
  #include <ctype.h>
  
+ /*
+  * Don't want getc() declared as external function for __STDC__ on
+  * ISC 2.2.1 or for _POSIX_SOURCE on 2.2.1/3.0 because of shared
+  * library creation
+  *
+  * Under SCO324, getc is a macro but it uses errno so we always redefine it
+  * (mainly for shared libraries)
+  */
+ #if (defined(ISC) && defined(_POSIX_SOURCE)) || (defined(ISC22) && defined(__STDC__)) || defined(SCO324)
+ #ifdef getc
+ #undef getc
+ #endif
+ #define getc(p)         (--(p)->_cnt < 0 ? _filbuf(p) : (int) *(p)->_ptr++)
+ #endif
  
  #define MAX_SIZE 255
  
diff -c mit/lib/Xmu/StrToBmap.c:1.1.1.1 mit/lib/Xmu/StrToBmap.c:1.3
*** mit/lib/Xmu/StrToBmap.c:1.1.1.1	Sat Mar 12 00:38:55 1994
--- mit/lib/Xmu/StrToBmap.c	Sat Mar 12 00:38:55 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xmu/StrToBmap.c,v 1.3 1993/03/27 09:17:08 dawes Exp $ */
  /* static char rcsid[] = "$XConsortium: StrToBmap.c,v 1.11 91/03/09 17:08:48 rws Exp $"; */
  
  
***************
*** 24,29 ****
--- 25,34 ----
  SOFTWARE.
  
  ******************************************************************/
+ 
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
  
  #include	<X11/Intrinsic.h>
  #include	<X11/StringDefs.h>
diff -c mit/lib/Xmu/StrToCurs.c:1.1.1.2 mit/lib/Xmu/StrToCurs.c:1.2
*** mit/lib/Xmu/StrToCurs.c:1.1.1.2	Sat Mar 12 00:38:56 1994
--- mit/lib/Xmu/StrToCurs.c	Sat Mar 12 00:38:56 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xmu/StrToCurs.c,v 1.2 1993/05/24 12:37:21 dawes Exp $ */
  /* $XConsortium: StrToCurs.c,v 1.19 92/03/19 15:22:29 converse Exp $ */
  
  /***********************************************************
***************
*** 24,29 ****
--- 25,33 ----
  
  ******************************************************************/
  
+ #ifdef SCO324
+ #include	<X11/Xos.h>
+ #endif
  #include	<X11/Intrinsic.h>
  #include	<X11/StringDefs.h>
  #include	<X11/Xmu/Converters.h>
diff -c mit/lib/Xmu/StrToLong.c:1.1.1.1 mit/lib/Xmu/StrToLong.c:1.2
*** mit/lib/Xmu/StrToLong.c:1.1.1.1	Sat Mar 12 00:38:56 1994
--- mit/lib/Xmu/StrToLong.c	Sat Mar 12 00:38:56 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/lib/Xmu/StrToLong.c,v 1.2 1993/05/04 15:00:17 dawes Exp $
   * $XConsortium: StrToLong.c,v 1.3 90/10/26 16:43:40 dave Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 22,27 ****
--- 23,31 ----
   */
  
  
+ #ifdef SCO
+ #include <stdio.h>
+ #endif
  #include <X11/Intrinsic.h>
  #include "Converters.h"
  
diff -c /dev/null mit/lib/Xmu/globals.c:1.3
*** /dev/null	Sat Mar 12 00:38:56 1994
--- mit/lib/Xmu/globals.c	Sat Mar 12 00:38:57 1994
***************
*** 0 ****
--- 1,87 ----
+ /* libXmu : libXmu.c
+  * exported data
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/Xmu/globals.c,v 1.3 1993/03/27 09:17:09 dawes Exp $
+  */
+ 
+ #ifdef SVR3SHLIB
+ 
+ #ifdef __STDC__
+ #define Const const
+ #else
+ #define Const /**/
+ #endif
+ 
+ Const char *_shared_libXmu_version = SOXMUREV;  char __libXmu_sp1__[16] = "";
+ 
+ #define VoidInit(var) void *var = 0
+ 
+ VoidInit(_libXmu__aux__);
+ VoidInit(_libXmu_XShapeCombineMask);
+ VoidInit(_libXmu__ctype);
+ VoidInit(_libXmu__filbuf);
+ VoidInit(_libXmu__iob);
+ VoidInit(_libXmu_atoi);
+ VoidInit(_libXmu_bcopy);
+ VoidInit(_libXmu_calloc);
+ VoidInit(_libXmu_exit);
+ VoidInit(_libXmu_fclose);
+ VoidInit(_libXmu_fgets);
+ VoidInit(_libXmu_fopen);
+ VoidInit(_libXmu_fprintf);
+ VoidInit(_libXmu_fputs);
+ VoidInit(_libXmu_free);
+ VoidInit(_libXmu_getenv);
+ VoidInit(_libXmu_gethostbyname);
+ VoidInit(_libXmu_gethostname);
+ VoidInit(_libXmu_malloc);
+ VoidInit(_libXmu_qsort);
+ VoidInit(_libXmu_realloc);
+ VoidInit(_libXmu_sprintf);
+ VoidInit(_libXmu_sscanf);
+ VoidInit(_libXmu_strcat);
+ VoidInit(_libXmu_strcmp);
+ VoidInit(_libXmu_strcpy);
+ VoidInit(_libXmu_strncmp);
+ VoidInit(_libXmu_strncpy);
+ VoidInit(_libXmu_strrchr);
+ VoidInit(_libXmu_uname);
+ 
+ VoidInit(_libXmu__XA_CLASS);
+ VoidInit(_libXmu__XA_CLIENT_WINDOW);
+ VoidInit(_libXmu__XA_HOSTNAME);
+ VoidInit(_libXmu__XA_IP_ADDRESS);
+ VoidInit(_libXmu__XA_NAME);
+ VoidInit(_libXmu__XA_NET_ADDRESS);
+ VoidInit(_libXmu__XA_OWNER_OS);
+ VoidInit(_libXmu__XA_TARGETS);
+ VoidInit(_libXmu__XA_TIMESTAMP);
+ VoidInit(_libXmu__XA_USER);
+ 
+ 
+ #ifndef __GNUC__
+ /*
+  * If we are working with floating point aritmetic, stock AT&T cc generates
+  * an unresolved reference to __fltused. But we want to make a shared lib from
+  * this here and don't want to reference /lib/libc_s.a, just define this sym as
+  * (shared lib) static.
+  * The trick is that while building the shared lib all references to this
+  * symbol are resolved internally. But the symbol will be outside only visible
+  * as a static one, so preventing a name conflict with other shared libs.
+  */
+ long __fltused = 0;
+ #endif
+ 
+ /* A dummy function for free branchtab-slots.
+  * This would be a great place for an error-check mechanism for shared libs.
+  * (Print error message if not existent function is called.)
+  */
+ extern void _libXmu_dummy() {};
+ 
+ #endif
+ 
+ 
diff -c /dev/null mit/lib/Xmu/import.h:2.0
*** /dev/null	Sat Mar 12 00:38:57 1994
--- mit/lib/Xmu/import.h	Sat Mar 12 00:38:57 1994
***************
*** 0 ****
--- 1,160 ----
+ /* libXmu : import.h
+  * indirection defines
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/Xmu/import.h,v 2.0 1993/09/22 15:32:44 dawes Exp $
+  */
+ 
+ #ifndef _libXmu_import
+ #define _libXmu_import
+ #ifdef SVR3SHLIB
+ 
+ #define XShapeCombineMask  (*_libXmu_XShapeCombineMask)
+ #define _ctype  (*_libXmu__ctype)
+ #define _filbuf  (*_libXmu__filbuf)
+ #define _iob  (*_libXmu__iob)
+ #define atoi  (*_libXmu_atoi)
+ #define bcopy  (*_libXmu_bcopy)
+ #define calloc  (*_libXmu_calloc)
+ #define exit  (*_libXmu_exit)
+ #define fclose  (*_libXmu_fclose)
+ #define fgets  (*_libXmu_fgets)
+ #define fopen  (*_libXmu_fopen)
+ #define fprintf  (*_libXmu_fprintf)
+ #define fputs  (*_libXmu_fputs)
+ /* prevent name conflict with member free of XFontSetMethods */
+ #define free(ptr) (*_libXmu_free)(ptr)
+ #define getenv  (*_libXmu_getenv)
+ #define gethostbyname  (*_libXmu_gethostbyname)
+ #define gethostname  (*_libXmu_gethostname)
+ #define malloc  (*_libXmu_malloc)
+ #define qsort  (*_libXmu_qsort)
+ #define realloc  (*_libXmu_realloc)
+ #define sprintf  (*_libXmu_sprintf)
+ #define sscanf  (*_libXmu_sscanf)
+ #define strcat  (*_libXmu_strcat)
+ #define strcmp  (*_libXmu_strcmp)
+ #define strcpy  (*_libXmu_strcpy)
+ #define strncmp  (*_libXmu_strncmp)
+ #define strncpy  (*_libXmu_strncpy)
+ #define strrchr  (*_libXmu_strrchr)
+ #define uname  (*_libXmu_uname)
+ 
+ #define _XA_CLASS  (*_libXmu__XA_CLASS)
+ #define _XA_CLIENT_WINDOW  (*_libXmu__XA_CLIENT_WINDOW)
+ #define _XA_HOSTNAME  (*_libXmu__XA_HOSTNAME)
+ #define _XA_IP_ADDRESS  (*_libXmu__XA_IP_ADDRESS)
+ #define _XA_NAME  (*_libXmu__XA_NAME)
+ #define _XA_NET_ADDRESS  (*_libXmu__XA_NET_ADDRESS)
+ #define _XA_OWNER_OS  (*_libXmu__XA_OWNER_OS)
+ #define _XA_TARGETS  (*_libXmu__XA_TARGETS)
+ #define _XA_TIMESTAMP  (*_libXmu__XA_TIMESTAMP)
+ #define _XA_USER  (*_libXmu__XA_USER)
+ 
+ 
+ /* Imported functions declarations
+  * Why declaring some imported functions here?
+  * This should be done gracefully through including of the systems
+  * header files. Unfortunatly there are some source files don't
+  * include all headers they should include, there are also some functions
+  * nowhere declared in the systems headers and some are declared
+  * without extern and cause problems since the names are redefined
+  * and these declarations then become undesired false pointer definitions.
+  */
+ 
+ /* This section needs editing! It's only an example for the X libs. */
+ 
+ #ifdef __STDC__
+ extern int creat(char const *, unsigned short);
+ extern void exit(int);
+ #ifndef SCO
+ extern int printf(char const *, ...);
+ extern int sprintf(char *, char const *, ...);
+ extern int sscanf(char *, char const *, ...);
+ #endif
+ extern int atoi(char const *);
+ extern int access(char const *, int);
+ extern unsigned int alarm(unsigned int);
+ extern unsigned int sleep(unsigned int);
+ extern int close(int);
+ extern int read(int, char *, unsigned int);
+ extern int write(int, char const *, unsigned int);
+ extern int grantpt(int);
+ extern char *ptsname(int);
+ extern int unlockpt(int);
+ extern char *getenv(char const *);
+ #else
+ extern int creat();
+ extern void exit();
+ #ifndef SCO
+ extern int printf();
+ extern int sprintf();
+ extern int sscanf();
+ #endif
+ extern int atoi();
+ extern int access();
+ extern unsigned int alarm();
+ extern unsigned int sleep();
+ extern int close();
+ extern int read();
+ extern int write();
+ extern int grantpt();
+ extern char *ptsname();
+ extern int unlockpt();
+ extern char *getenv();
+ #endif
+ 
+ /* use char * also for __STDC__, the sources want it */ 
+ extern char *malloc(), *realloc(), *calloc();
+ 
+ #include <string.h>
+ 
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ 
+ extern void qsort();
+ #ifndef ISC40
+ extern int _flsbuf();
+ extern int _filbuf();
+ #endif
+ extern int ioctl();
+ extern int getmsg();
+ extern int putmsg();
+ 
+ extern unsigned short ntohs(), htons();
+ extern unsigned long ntohl(), htonl();
+ extern unsigned long inet_addr();
+ extern int connect();
+ extern int gethostname();
+ extern int setsockopt();
+ extern int socket();
+ extern int writev();
+ extern int gettimeofday();
+ #ifdef ATT
+ extern int uname();
+ #endif
+ 
+ 
+ /* Functions with ambiguous names */
+ 
+ #ifdef __STDC__
+ extern int close(int);
+ extern void free(void *);
+ #include <sys/time.h>
+ #include <sys/bsdtypes.h>
+ #ifdef SCO
+ #include <sys/types.h>
+ #endif /* SCO */
+ extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+ #else
+ extern int (*_libXmu_close)();
+ extern void (*_libXmu_free)();
+ extern int (*_libXmu_select)();
+ #endif
+ 
+ #endif
+ #endif
+ 
diff -c /dev/null mit/lib/Xmu/libXmu.def:1.4
*** /dev/null	Sat Mar 12 00:38:57 1994
--- mit/lib/Xmu/libXmu.def	Sat Mar 12 00:38:57 1994
***************
*** 0 ****
--- 1,286 ----
+ /* libXmu : libXmu.def
+  * shared library description file
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/Xmu/libXmu.def,v 1.4 1993/04/24 05:21:53 dawes Exp $
+  */
+ 
+ /**/#address .text 0xB1000000
+ /**/#address .data 0xB1400000
+ 
+ 
+ /**/#objects noload
+ ../X/libX11_s.a
+ ../Xt/libXt_s.a
+ 
+ /**/#branch
+ XctCreate 1
+ XctFree 2
+ XctNextItem 3
+ XctReset 4
+ XmuAddCloseDisplayHook 5
+ XmuAddInitializer 6
+ XmuAllStandardColormaps 7
+ XmuCallInitializers 8
+ XmuClientWindow 9
+ XmuCompareISOLatin1 10
+ XmuConvertStandardSelection 11
+ XmuCopyISOLatin1Lowered 12
+ XmuCopyISOLatin1Uppered 13
+ XmuCreateColormap 14
+ XmuCreatePixmapFromBitmap 15
+ XmuCreateStippledPixmap 16
+ XmuCursorNameToIndex 17
+ XmuCvtFunctionToCallback 18
+ XmuCvtStringToBackingStore 19
+ XmuCvtStringToBitmap 20
+ XmuCvtStringToColorCursor 21
+ XmuCvtStringToCursor 22
+ XmuCvtStringToGravity 23
+ XmuCvtStringToJustify 24
+ XmuCvtStringToLong 25
+ XmuCvtStringToOrientation 26
+ XmuCvtStringToShapeStyle 27
+ XmuCvtStringToWidget 28
+ XmuDQAddDisplay 29
+ XmuDQCreate 30
+ XmuDQDestroy 31
+ XmuDQLookupDisplay 32
+ XmuDQRemoveDisplay 33
+ XmuDeleteStandardColormap 34
+ XmuDistinguishableColors 35
+ XmuDistinguishablePixels 36
+ XmuDrawLogo 37
+ XmuDrawRoundedRectangle 38
+ XmuFillRoundedRectangle 39
+ XmuGetAtomName 40
+ XmuGetColormapAllocation 41
+ XmuGetHostname 42
+ XmuInternAtom 43
+ XmuInternStrings 44
+ XmuLocateBitmapFile 45
+ XmuLocatePixmapFile 46
+ XmuLookupAPL 47
+ XmuLookupArabic 48
+ XmuLookupCloseDisplayHook 49
+ XmuLookupCyrillic 50
+ XmuLookupGreek 51
+ XmuLookupHebrew 52
+ XmuLookupJISX0201 53
+ XmuLookupKana 54
+ XmuLookupLatin1 55
+ XmuLookupLatin2 56
+ XmuLookupLatin3 57
+ XmuLookupLatin4 58
+ XmuLookupStandardColormap 59
+ XmuLookupString 60
+ XmuMakeAtom 61
+ XmuNameOfAtom 62
+ XmuNewCvtStringToWidget 63
+ XmuPrintDefaultErrorMessage 64
+ XmuReadBitmapData 65
+ XmuReadBitmapDataFromFile 66
+ XmuReleaseStippledPixmap 67
+ XmuRemoveCloseDisplayHook 68
+ XmuReshapeWidget 69
+ XmuScreenOfWindow 70
+ XmuSimpleErrorHandler 71
+ XmuStandardColormap 72
+ XmuUpdateMapHints 73
+ XmuVisualStandardColormaps 74
+ XmuWnCountOwnedResources 75
+ XmuWnFetchResources 76
+ XmuWnInitializeNodes 77
+ XmuWnNameToNode 78
+ _XEditResCheckMessages 79
+ _XEditResGet16 80
+ _XEditResGet32 81
+ _XEditResGet8 82
+ _XEditResGetSigned16 83
+ _XEditResGetString8 84
+ _XEditResGetWidgetInfo 85
+ _XEditResPut16 86
+ _XEditResPut32 87
+ _XEditResPut8 88
+ _XEditResPutString8 89
+ _XEditResPutWidgetInfo 90
+ _XEditResResetStream 91
+ _XmuCCLookupDisplay 92
+ _XmuStringToBitmapFreeCache 93
+ _XmuStringToBitmapInitCache 94
+ 
+ _libXmu_dummy 95-150
+ 
+ 
+ /**/#objects
+ DOWN/globals.o  /* All objects with global data must be at come first!*/
+ DOWN/Atoms.o	/* must be second object */
+ DOWN/AllCmap.o
+ DOWN/ClientWin.o
+ DOWN/CloseHook.o
+ DOWN/CmapAlloc.o
+ DOWN/CrCmap.o
+ DOWN/CrPixFBit.o
+ DOWN/CursorName.o
+ DOWN/CvtCache.o
+ DOWN/CvtStdSel.o
+ DOWN/DefErrMsg.o
+ DOWN/DelCmap.o
+ DOWN/DisplayQue.o
+ DOWN/Distinct.o
+ DOWN/DrRndRect.o
+ DOWN/DrawLogo.o
+ DOWN/EditresCom.o
+ DOWN/FToCback.o
+ DOWN/GetHost.o
+ DOWN/GrayPixmap.o
+ DOWN/Initer.o
+ DOWN/LocBitmap.o
+ DOWN/Lookup.o
+ DOWN/LookupCmap.o
+ DOWN/Lower.o
+ DOWN/RdBitF.o
+ DOWN/ScrOfWin.o
+ DOWN/ShapeWidg.o
+ DOWN/StdCmap.o
+ DOWN/StrToBS.o
+ DOWN/StrToBmap.o
+ DOWN/StrToCurs.o
+ DOWN/StrToGrav.o
+ DOWN/StrToJust.o
+ DOWN/StrToLong.o
+ DOWN/StrToOrnt.o
+ DOWN/StrToShap.o
+ DOWN/StrToWidg.o
+ DOWN/UpdMapHint.o
+ DOWN/VisCmap.o
+ DOWN/WidgetNode.o
+ DOWN/Xct.o
+ 
+ 
+ /**/#init globals.o
+ _libXmu__iob  _iob
+ _libXmu_bcopy  bcopy
+ _libXmu_calloc  calloc
+ _libXmu_fprintf  fprintf
+ _libXmu_free  free
+ _libXmu_getenv  getenv
+ _libXmu_malloc  malloc
+ _libXmu_qsort  qsort
+ _libXmu_sprintf  sprintf
+ _libXmu_sscanf  sscanf
+ _libXmu_strcmp  strcmp
+ _libXmu_strcpy  strcpy
+ _libXmu_strncmp  strncmp
+ _libXmu__aux__  __libXmu_init_stub_
+ 
+ /**/#init CvtStdSel.o
+ _libXmu_gethostbyname  gethostbyname
+ _libXmu_strcat  strcat
+ _libXmu_uname  uname
+ _libXmu__XA_CLASS  _XA_CLASS
+ _libXmu__XA_CLIENT_WINDOW  _XA_CLIENT_WINDOW
+ _libXmu__XA_HOSTNAME  _XA_HOSTNAME
+ _libXmu__XA_IP_ADDRESS  _XA_IP_ADDRESS
+ _libXmu__XA_NAME  _XA_NAME
+ _libXmu__XA_NET_ADDRESS  _XA_NET_ADDRESS
+ _libXmu__XA_OWNER_OS  _XA_OWNER_OS
+ _libXmu__XA_TARGETS  _XA_TARGETS
+ _libXmu__XA_TIMESTAMP  _XA_TIMESTAMP
+ _libXmu__XA_USER  _XA_USER
+ 
+ 
+ /**/#init DefErrMsg.o
+ _libXmu_fputs  fputs
+ 
+ /**/#init GetHost.o
+ _libXmu_gethostname  gethostname
+ 
+ /**/#init LocBitmap.o
+ _libXmu_strncpy  strncpy
+ 
+ /**/#init RdBitF.o
+ _libXmu__ctype  _ctype
+ _libXmu__filbuf  _filbuf
+ _libXmu_fclose  fclose
+ _libXmu_fgets  fgets
+ _libXmu_fopen  fopen
+ _libXmu_strrchr  strrchr
+ 
+ /**/#init ShapeWidg.o
+ _libXmu_XShapeCombineMask  XShapeCombineMask
+ 
+ /**/#init StrToCurs.o
+ _libXmu_atoi  atoi
+ 
+ /**/#init WidgetNode.o
+ _libXmu_exit  exit
+ 
+ /**/#init Xct.o
+ _libXmu_realloc  realloc
+ 
+ /**/#init Atoms.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init ClientWin.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init CmapAlloc.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init CrPixFBit.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init DelCmap.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init DrawLogo.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init DrRndRect.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init FToCback.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init GrayPixmap.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init Initer.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init Lookup.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init Lower.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init ScrOfWin.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init StdCmap.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init StrToWidg.o
+ _libXmu__aux__  __libXmu_init_stub_
+ /**/#init UpdMapHint.o
+ _libXmu__aux__  __libXmu_init_stub_
+ 
+ 
+ 
+ /**/#libraries
+ /* Here can objects be specified, which will extracted from
+  * an specified archive library and then linked to the shared
+  * library. This can avoid unwanted referencing of other
+  * shared libraries.
+  * NOTE: this objects must be listed also under #objects!
+  * e.g.:
+ /lib/libc.a memcpy.o
+  * or e.g.:
+ #ifdef __GNUC__
+ GNULIB  _fixdfsi.o
+ #endif
+  *
+  * NOT USED YET
+  *
+  */
+ 
+ /**/#externals
+ /* Here you can specify objects which will only linked to the
+  * host shared library.
+  * That are e.g. objects which contain only big data you want
+  * to seperate from the text section. (See mit/util/mksv3shlib/README.)
+  */
+ InitLibStub.o
+ DOWN/ChkShlibRev.o
+ 
+ /* There must be a comment as last line */
diff -c /dev/null mit/lib/Xt/ChkShlibRev.c:1.2
*** /dev/null	Sat Mar 12 00:39:04 1994
--- mit/lib/Xt/ChkShlibRev.c	Sat Mar 12 00:39:04 1994
***************
*** 0 ****
--- 1,34 ----
+ /* libXt: ChkShlibRev.c
+  *
+  * This code is linked to the clients and is called by their .init sections.
+  * It checks the SVR3 target shared library revision.
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xt/ChkShlibRev.c,v 1.2 1993/03/27 09:12:20 dawes Exp $
+  */
+ 
+ #include <stdio.h>
+ 
+ #ifdef SVR3SHLIB
+ #ifdef __STDC__
+ #define Const const
+ #else
+ #define Const /**/
+ #endif
+ 
+ extern Const char *_shared_libXt_version;
+ 
+ void __check_libXt_rev_()
+ {
+ 
+   /* check revision
+    */
+ 
+   if(strcmp(_shared_libXt_version, SOXTREV))
+ 	fprintf(stderr, "Warning: %s has other revision (%s) than expected"
+ 			" %s\n", TARGET, _shared_libXt_version, SOXTREV);
+ 
+ }
+ #endif
+ 
diff -c mit/lib/Xt/Composite.c:1.1.1.1 mit/lib/Xt/Composite.c:1.3
*** mit/lib/Xt/Composite.c:1.1.1.1	Sat Mar 12 00:39:05 1994
--- mit/lib/Xt/Composite.c	Sat Mar 12 00:39:05 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Composite.c,v 1.3 1993/03/27 09:12:23 dawes Exp $ */
  /* $XConsortium: Composite.c,v 1.18 91/04/04 20:52:53 converse Exp $ */
  
  /***********************************************************
***************
*** 45,51 ****
--- 46,56 ----
  
  externaldef(compositeclassrec) CompositeClassRec compositeClassRec = {
    { /******* CorePart *******/
+ #ifndef SVR3SHLIB
      /* superclass	    */	&widgetClassRec,
+ #else
+     /* superclass           */  NULL,	/* binded on runtime */
+ #endif
      /* class_name	    */	"Composite",
      /* widget_size	    */	sizeof(CompositeRec),
      /* class_initialize     */  NULL,
***************
*** 87,93 ****
--- 92,103 ----
      }
  };
  
+ #ifndef SVR3SHLIB
  externaldef(compositewidgetclass) WidgetClass compositeWidgetClass = (WidgetClass) &compositeClassRec;
+ #else
+ externalref WidgetClass compositeWidgetClass;
+ #define _XtInherit  (*_libXt__XtInherit)
+ #endif
  
  static void CompositeClassPartInitialize(widgetClass)
  	WidgetClass widgetClass;
diff -c mit/lib/Xt/Constraint.c:1.1.1.1 mit/lib/Xt/Constraint.c:1.4
*** mit/lib/Xt/Constraint.c:1.1.1.1	Sat Mar 12 00:39:05 1994
--- mit/lib/Xt/Constraint.c	Sat Mar 12 00:39:05 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Constraint.c,v 1.4 1993/03/20 03:40:41 dawes Exp $ */
  /* $XConsortium: Constraint.c,v 1.13 91/06/10 15:08:01 converse Exp $ */
  
  /***********************************************************
***************
*** 31,37 ****
--- 32,42 ----
  static void ConstraintPartInitialize();
  externaldef(constraintclassrec) ConstraintClassRec constraintClassRec = {
    { /******* CorePart *******/
+ #ifndef SVR3SHLIB
      /* superclass	    */	(WidgetClass) &compositeClassRec,
+ #else
+     /* superclass           */  NULL,	/* binded on runtime */
+ #endif
      /* class_name	    */	"Constraint",
      /* widget_size	    */	sizeof(ConstraintRec),
      /* class_initialize     */  NULL,
***************
*** 79,87 ****
      /* extension	    */  NULL
    }
  };
! 
  externaldef(constraintwidgetclass) WidgetClass constraintWidgetClass =
  	(WidgetClass) &constraintClassRec;
  
  
  static void ConstraintPartInitialize(wc)
--- 84,96 ----
      /* extension	    */  NULL
    }
  };
! #ifndef SVR3SHLIB
  externaldef(constraintwidgetclass) WidgetClass constraintWidgetClass =
  	(WidgetClass) &constraintClassRec;
+ #else
+ externalref WidgetClass constraintWidgetClass;
+ #define _XtInherit  (*_libXt__XtInherit)
+ #endif
  
  
  static void ConstraintPartInitialize(wc)
diff -c mit/lib/Xt/Convert.c:1.1.1.3 mit/lib/Xt/Convert.c:2.0
*** mit/lib/Xt/Convert.c:1.1.1.3	Sat Mar 12 00:39:06 1994
--- mit/lib/Xt/Convert.c	Sat Mar 12 00:39:06 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Convert.c,v 2.0 1993/11/13 04:23:32 dawes Exp $ */
  /* $XConsortium: Convert.c,v 1.68 93/07/12 14:52:00 converse Exp $ */
  
  /***********************************************************
diff -c mit/lib/Xt/Core.c:1.1.1.1 mit/lib/Xt/Core.c:1.4
*** mit/lib/Xt/Core.c:1.1.1.1	Sat Mar 12 00:39:06 1994
--- mit/lib/Xt/Core.c	Sat Mar 12 00:39:07 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Core.c,v 1.4 1993/03/20 03:40:44 dawes Exp $ */
  /* $XConsortium: Core.c,v 1.55 91/06/11 20:25:04 converse Exp $ */
  
  /***********************************************************
***************
*** 40,46 ****
--- 41,51 ----
   *
   ******************************************************************/
  
+ #ifndef SVR3SHLIB
  externaldef(xtinherittranslations) int _XtInheritTranslations = 0;
+ #else
+ externalref int _XtInheritTranslations;
+ #endif
  extern String XtCXtToolkitError; /* from IntrinsicI.h */
  static void XtCopyScreen();
  
***************
*** 85,93 ****
  static Boolean CoreSetValues();
  static void CoreSetValuesAlmost();
  
! static RectObjClassRec unNamedObjClassRec = {
    {
      /* superclass	  */	(WidgetClass)&rectObjClassRec,
      /* class_name	  */	"UnNamedObj",
      /* widget_size	  */	0,
      /* class_initialize   */    NULL,
--- 90,107 ----
  static Boolean CoreSetValues();
  static void CoreSetValuesAlmost();
  
! #ifndef SVR3SHLIB
! static
! #else
! #define unNamedObjClassRec _libXtCore_unNamedObjClassRec
! #endif
! RectObjClassRec unNamedObjClassRec = {
    {
+ #ifndef SVR3SHLIB
      /* superclass	  */	(WidgetClass)&rectObjClassRec,
+ #else
+     /* superclass         */    NULL,	/* binded on runtime */
+ #endif
      /* class_name	  */	"UnNamedObj",
      /* widget_size	  */	0,
      /* class_initialize   */    NULL,
***************
*** 159,167 ****
--- 173,187 ----
      /* extension            */  NULL
    }
  };
+ #ifndef SVR3SHLIB
  externaldef (WidgetClass) WidgetClass widgetClass = &widgetClassRec;
  
  externaldef (WidgetClass) WidgetClass coreWidgetClass = &widgetClassRec;
+ #else
+ externalref WidgetClass widgetClass;
+ externalref WidgetClass coreWidgetClass;
+ #define _XtInherit  (*_libXt__XtInherit)
+ #endif
  
  
  /*ARGSUSED*/
diff -c mit/lib/Xt/Display.c:1.1.1.4 mit/lib/Xt/Display.c:2.0
*** mit/lib/Xt/Display.c:1.1.1.4	Sat Mar 12 00:39:07 1994
--- mit/lib/Xt/Display.c	Sat Mar 12 00:39:07 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Display.c,v 2.0 1993/11/13 04:23:34 dawes Exp $ */
  /* $XConsortium: Display.c,v 1.89.1.1 93/07/20 16:32:36 kaleb Exp $ */
  
  /***********************************************************
***************
*** 26,31 ****
--- 27,36 ----
  
  #include "IntrinsicI.h"
  
+ #ifdef AMOEBA
+ #define fd_set Fd_set
+ #endif
+ 
  #ifndef X_NOT_STDC_ENV
  #include <stdlib.h>
  #else
***************
*** 65,70 ****
--- 70,82 ----
  	XtAppContext app;
  {
  #define DISPLAYS_TO_ADD 4
+ #ifdef AMOEBA
+ 	if (app->count >= 1 ) {
+ 	    XtErrorMsg("noMoreDisplays", "XtAddToAppContext", "XtToolkitError",
+ 		       "AMOEBA-X only supports one display per application",
+ 		       (String *) NULL, (Cardinal *)NULL);
+       }
+ #endif
  
  	if (app->count >= app->max) {
  	    app->max += DISPLAYS_TO_ADD;
***************
*** 73,81 ****
--- 85,95 ----
  	}
  
  	app->list[app->count++] = d;
+ #ifndef AMOEBA
  	if (ConnectionNumber(d) + 1 > app->fds.nfds) {
  	    app->fds.nfds = ConnectionNumber(d) + 1;
  	}
+ #endif
  #undef DISPLAYS_TO_ADD
  }
  
***************
*** 312,320 ****
  	app->sync = app->being_destroyed = app->error_inited = FALSE;
  	app->in_phase2_destroy = NULL;
  	app->fds.nfds = app->fds.count = 0;
! 	FD_ZERO(&app->fds.rmask);
! 	FD_ZERO(&app->fds.wmask);
! 	FD_ZERO(&app->fds.emask);
  	app->input_max = 0;
  	_XtHeapInit(&app->heap);
  	app->fallback_resources = NULL;
--- 326,336 ----
  	app->sync = app->being_destroyed = app->error_inited = FALSE;
  	app->in_phase2_destroy = NULL;
  	app->fds.nfds = app->fds.count = 0;
! #ifndef _MINIX
! 	FD_ZERO((fd_set *)&app->fds.rmask);
! 	FD_ZERO((fd_set *)&app->fds.wmask);
! 	FD_ZERO((fd_set *)&app->fds.emask);
! #endif
  	app->input_max = 0;
  	_XtHeapInit(&app->heap);
  	app->fallback_resources = NULL;
diff -c mit/lib/Xt/Error.c:1.1.1.1 mit/lib/Xt/Error.c:2.0
*** mit/lib/Xt/Error.c:1.1.1.1	Sat Mar 12 00:39:08 1994
--- mit/lib/Xt/Error.c	Sat Mar 12 00:39:08 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Error.c,v 2.0 1993/06/13 06:58:59 dawes Exp $ */
  /* $XConsortium: Error.c,v 1.33 91/11/09 15:38:01 keith Exp $ */
  
  /***********************************************************
***************
*** 27,32 ****
--- 28,50 ----
  #include "IntrinsicI.h"
  #include <stdio.h>
  
+ #ifndef PATH_MAX
+ #include <sys/param.h>
+ #ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+ #define PATH_MAX MAXPATHLEN
+ #else
+ #define PATH_MAX 1024
+ #endif
+ #endif
+ #endif
+ 
+ #ifndef X_NOT_STDC_ENV
+ #include <stdlib.h>
+ #else
+ extern char *getenv();
+ #endif
+ 
  /* The error handlers in the application context aren't used since we can't
     come up with a uniform way of using them.  If you can, define
     GLOBALERRORS to be FALSE (or 0). */
***************
*** 162,169 ****
      XrmDatabase *db;
  {
      XrmDatabase errordb;
  
!     errordb = XrmGetFileDatabase(ERRORDB);
      XrmMergeDatabases(errordb, db);
  }
  
--- 180,195 ----
      XrmDatabase *db;
  {
      XrmDatabase errordb;
+     char errordbpath[PATH_MAX];
+     char *xwinhome = NULL;
  
!     if ((xwinhome = getenv("XWINHOME")) == NULL) {
! 	strcpy(errordbpath, ERRORDB);
!     }
!     else {
! 	sprintf(errordbpath, "%s/lib/X11/XtErrorDB");
!     }
!     errordb = XrmGetFileDatabase(errordbpath);
      XrmMergeDatabases(errordb, db);
  }
  
***************
*** 389,395 ****
--- 415,423 ----
  void _XtDefaultError(message)
      String message;
  {
+ #ifdef X_NOT_STDC_ENV
      extern void exit();
+ #endif
  
      (void)fprintf(stderr, "%sError: %s\n", XTERROR_PREFIX, message);
      exit(1);
diff -c mit/lib/Xt/Imakefile:1.1.1.1 mit/lib/Xt/Imakefile:2.0
*** mit/lib/Xt/Imakefile:1.1.1.1	Sat Mar 12 00:39:09 1994
--- mit/lib/Xt/Imakefile	Sat Mar 12 00:39:09 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/lib/Xt/Imakefile,v 2.0 1993/08/28 07:45:11 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.93 91/09/18 14:29:25 rws Exp $
  #define DoNormalLib NormalLibXt
  #define DoSharedLib SharedLibXt
***************
*** 112,119 ****
  	VarGet.c \
  	Varargs.c \
  	Vendor.c \
! 	sharedlib.c
! 
  OBJS = \
  	ActionHook.o \
  	Alloc.o \
--- 113,133 ----
  	VarGet.c \
  	Varargs.c \
  	Vendor.c \
! 	sharedlib.c \
! 	globals.c \
! 	InitLibStub.s \
! 	InitClnStub.s \
! 	InitLib.c \
! 	ChkShlibRev.c \
! 	dummyBind.c \
! 	pComposite.c \
! 	pConstraint.c \
! 	pCore.c \
! 	pObject.c \
! 	pRectObj.c \
! 	pShell.c \
! 	pVendor.c 
! 	
  OBJS = \
  	ActionHook.o \
  	Alloc.o \
***************
*** 166,171 ****
--- 180,203 ----
  	Varargs.o \
  	Vendor.o
  
+ #if defined(i386SVR3Architecture) && DoSharedLib
+ SVR3SHLIBOBJS = \
+ 	globals.o \
+ 	InitLibStub.o \
+ 	InitClnStub.o \
+ 	InitLib.o \
+ 	ChkShlibRev.o \
+ 	dummyBind.o \
+ 	pComposite.o \
+ 	pConstraint.o \
+ 	pCore.o \
+ 	pObject.o \
+ 	pRectObj.o \
+ 	pShell.o \
+ 	pVendor.o
+ #endif
+ 
+ 
  #if SharedDataSeparation
  UNSHAREDOBJS = StringDefs.o sharedlib.o
  #else
***************
*** 174,192 ****
  
  LibraryObjectRule()
  
  SpecialLibObjectRule(Intrinsic.o,$(ICONFIGFILES),$(SRCH_DEFINES))
  SpecialLibObjectRule(Error.o,$(ICONFIGFILES),$(DB_DEFINES))
  SpecialLibObjectRule(Alloc.o,NullParameter,$(ALLOC_DEFINES))
  SpecialLibObjectRule(Converters.o,$(ICONFIGFILES),$(BC_DEFINES))
  #if DoSharedLib
! SpecialObjectRule(sharedlib.o,,$(SHLIBDEF))
  #endif
  
  #if DoSharedLib
  #if DoNormalLib
  SharedLibraryTarget(Xt,$(SOXTREV),$(OBJS),shared,..)
  #else
  SharedLibraryTarget(Xt,$(SOXTREV),$(OBJS),.,.)
  #endif
  SharedLibraryDataTarget(Xt,$(SOXTREV),$(UNSHAREDOBJS))
  InstallSharedLibrary(Xt,$(SOXTREV),$(USRLIBDIR))
--- 206,238 ----
  
  LibraryObjectRule()
  
+ #if defined(i386SVR3Architecture) && DoSharedLib
+ SpecialLibObjectRule(globals.o,$(ICONFIGFILES),-D_libXt_import -DSOXTREV=\"$(SOXTREV)\")
+ SpecialLibObjectRule(ChkShlibRev.o,,-D_libXt_import -DSOXTREV=\"$(SOXTREV)\" -DTARGET=\"$(LIBDIR)/shlib/libXt.$(SOXTREV)\")
+ SpecialLibObjectRule(InitLib.o,,-D_libXt_import)
+ #endif
+ 
  SpecialLibObjectRule(Intrinsic.o,$(ICONFIGFILES),$(SRCH_DEFINES))
  SpecialLibObjectRule(Error.o,$(ICONFIGFILES),$(DB_DEFINES))
  SpecialLibObjectRule(Alloc.o,NullParameter,$(ALLOC_DEFINES))
  SpecialLibObjectRule(Converters.o,$(ICONFIGFILES),$(BC_DEFINES))
  #if DoSharedLib
! SpecialObjectRule(sharedlib.o,sharedlib.c,$(SHLIBDEF))
  #endif
  
  #if DoSharedLib
+ #ifndef i386SVR3Architecture
  #if DoNormalLib
  SharedLibraryTarget(Xt,$(SOXTREV),$(OBJS),shared,..)
  #else
  SharedLibraryTarget(Xt,$(SOXTREV),$(OBJS),.,.)
+ #endif
+ #else
+ #if DoNormalLib
+ SharedLibraryTarget(Xt,$(SOXTREV),$(OBJS) $(SVR3SHLIBOBJS),shared,..)
+ #else
+ SharedLibraryTarget(Xt,$(SOXTREV),$(OBJS) $(SVR3SHLIBOBJS),.,.)
+ #endif
  #endif
  SharedLibraryDataTarget(Xt,$(SOXTREV),$(UNSHAREDOBJS))
  InstallSharedLibrary(Xt,$(SOXTREV),$(USRLIBDIR))
diff -c /dev/null mit/lib/Xt/InitClnStub.s:2.0
*** /dev/null	Sat Mar 12 00:39:09 1994
--- mit/lib/Xt/InitClnStub.s	Sat Mar 12 00:39:09 1994
***************
*** 0 ****
--- 1,31 ----
+ 	.file	"InitClnStub.s"
+ 
+ /#####################################################################
+ /# InitClnStub.s						     #
+ /# ----------------------------------------------------------------- #
+ /# This stub goes to .init section of the client binary and calls    #
+ /# the code which binds the client to the library		     #
+ /# Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany       #
+ /# (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)		     #
+ /#####################################################################
+ 
+ /# $XFree86: mit/lib/Xt/InitClnStub.s,v 2.0 1993/09/30 17:35:13 dawes Exp $
+ 
+ .section .init,"x" 
+ 
+ 	.align 4
+ 
+ 	.globl __bind_to_sv3shlib_
+ 
+ / bind client to library (init pointers in subclasses of the client)
+ / _bind_to_sv3shlib_() must be supplied by the client, otherwise
+ / an empty dummy function from the host shared library is linked to it
+ 
+ __bind_to_sv3shlib_:
+ 	pushl %ebp
+ 	movl %esp,%ebp
+ / call function in client
+ 	call _bind_to_sv3shlib_	
+ 	leave
+ 
+ 
diff -c /dev/null mit/lib/Xt/InitLib.c:1.3
*** /dev/null	Sat Mar 12 00:39:09 1994
--- mit/lib/Xt/InitLib.c	Sat Mar 12 00:39:10 1994
***************
*** 0 ****
--- 1,147 ----
+ /* libXt : InitLib.c
+  * -----------------
+  * This code goes into .init section of the client binary.
+  * On archive library references like &widgetClassRec, &compositeClassRec
+  * and so on are unresolved. They will resolved during linking. So someone
+  * could define its own (e.g.) widgetClassRec and even the library code
+  * will use it gracefully.
+  * On SVR3 shared lib such references are to fixed addresses. The library
+  * would never use a user defined (e.g.) widgetClassRec and more worse
+  * the compiler would complain about multiply defined widgetClassRec.
+  * So we don't reference to (e.g.) widgetClassRec in the shared lib.
+  * Instead putting this code to client binary, which is resolved during
+  * linking and writes on runtime the needed addresses to the shared lib.
+  *
+  * Second, it initializes all References to _XtInherit in the Library.
+  * This is necessary in libXt only, because a behavior of the mkshlib(1) tool.
+  * It seems to forget to replace function addresses in structures
+  * with the new function address from the branch table. But there are
+  * several places in the code were pointers are compared with _XtInherit.
+  *
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xt/InitLib.c,v 1.3 1993/05/22 06:51:00 dawes Exp $
+  */
+ 
+ #include "IntrinsicI.h"
+ #include "VarargsI.h"
+ #include "ShellP.h"
+ #include "VendorP.h"
+ 
+ #ifdef SVR3SHLIB
+ 
+ /* Check whether the named class is really from shared libXt.
+  * It could also be user supplied (e.g. vendorShellClassRec from Motif).
+  * We don't know with what the user wants to initialize, so let it be in
+  * that case.
+  * 0xB0C00000 : address of libXt's .data section
+  */
+ #define IsInLibXt(ClassRec) ((unsigned)ClassRec & 0xFFC00000) == 0xB0C00000 
+ 
+ externalref WidgetClass _libXtCore_unNamedObjClass;
+ 
+ void __libXt_init_()
+ {
+ 
+   /* Composite.c */
+   if(IsInLibXt(compositeWidgetClass)) {
+       compositeWidgetClass->core_class.superclass = widgetClass;
+       compositeWidgetClass->core_class.realize = XtInheritRealize;
+       compositeWidgetClass->core_class.set_values_almost = XtInheritSetValuesAlmost;
+   }
+ 
+   /* Constraint.c */
+   if(IsInLibXt(constraintWidgetClass)) {
+       constraintWidgetClass->core_class.superclass = compositeWidgetClass;
+       constraintWidgetClass->core_class.realize = XtInheritRealize;
+       constraintWidgetClass->core_class.set_values_almost = XtInheritSetValuesAlmost;
+       ((ConstraintWidgetClass)constraintWidgetClass)->composite_class.insert_child = XtInheritInsertChild;
+       ((ConstraintWidgetClass)constraintWidgetClass)->composite_class.delete_child = XtInheritDeleteChild;
+   }
+ 
+   /* Core.c */
+   if(IsInLibXt(_libXtCore_unNamedObjClass)) {
+       _libXtCore_unNamedObjClass->core_class.superclass = rectObjClass;
+       _libXtCore_unNamedObjClass->core_class.realize = XtInheritRealize;
+       _libXtCore_unNamedObjClass->core_class.set_values_almost = XtInheritSetValuesAlmost;
+   }
+ 
+   /* RectObj.c */
+   if(IsInLibXt(rectObjClass))
+       rectObjClass->core_class.superclass = objectClass;
+   
+   /* Shell.c */
+   if(IsInLibXt(shellWidgetClass)) {
+       shellWidgetClass->core_class.superclass = compositeWidgetClass;
+       shellWidgetClass->core_class.set_values_almost = XtInheritSetValuesAlmost;
+       ((ShellWidgetClass)shellWidgetClass)->composite_class.insert_child = XtInheritInsertChild;
+       ((ShellWidgetClass)shellWidgetClass)->composite_class.delete_child = XtInheritDeleteChild;
+   }
+ 
+   if(IsInLibXt(overrideShellWidgetClass)) {
+       overrideShellWidgetClass->core_class.realize = XtInheritRealize;
+       overrideShellWidgetClass->core_class.resize = XtInheritResize;
+       overrideShellWidgetClass->core_class.set_values_almost = XtInheritSetValuesAlmost;
+       ((OverrideShellWidgetClass)overrideShellWidgetClass)->composite_class.geometry_manager = XtInheritGeometryManager;
+       ((OverrideShellWidgetClass)overrideShellWidgetClass)->composite_class.change_managed = XtInheritChangeManaged;
+       ((OverrideShellWidgetClass)overrideShellWidgetClass)->composite_class.insert_child = XtInheritInsertChild;
+       ((OverrideShellWidgetClass)overrideShellWidgetClass)->composite_class.delete_child = XtInheritDeleteChild;
+   }
+ 
+   if(IsInLibXt(wmShellWidgetClass)) {
+       wmShellWidgetClass->core_class.realize = XtInheritRealize;
+       wmShellWidgetClass->core_class.resize = XtInheritResize;
+       wmShellWidgetClass->core_class.set_values_almost = XtInheritSetValuesAlmost;
+       ((WMShellWidgetClass)wmShellWidgetClass)->composite_class.geometry_manager = XtInheritGeometryManager;
+       ((WMShellWidgetClass)wmShellWidgetClass)->composite_class.change_managed = XtInheritChangeManaged;
+       ((WMShellWidgetClass)wmShellWidgetClass)->composite_class.insert_child = XtInheritInsertChild;
+       ((WMShellWidgetClass)wmShellWidgetClass)->composite_class.delete_child = XtInheritDeleteChild;
+   }
+ 
+   if(IsInLibXt(transientShellWidgetClass)) {
+       transientShellWidgetClass->core_class.superclass = vendorShellWidgetClass;
+       transientShellWidgetClass->core_class.resize = XtInheritResize;
+       transientShellWidgetClass->core_class.set_values_almost = XtInheritSetValuesAlmost;
+       ((TransientShellWidgetClass)transientShellWidgetClass)->composite_class.geometry_manager = XtInheritGeometryManager;
+       ((TransientShellWidgetClass)transientShellWidgetClass)->composite_class.change_managed = XtInheritChangeManaged;
+       ((TransientShellWidgetClass)transientShellWidgetClass)->composite_class.insert_child = XtInheritInsertChild;
+       ((TransientShellWidgetClass)transientShellWidgetClass)->composite_class.delete_child = XtInheritDeleteChild;
+   }
+ 
+   if(IsInLibXt(topLevelShellWidgetClass)) {
+       topLevelShellWidgetClass->core_class.superclass = vendorShellWidgetClass;
+       topLevelShellWidgetClass->core_class.realize = XtInheritRealize;
+       topLevelShellWidgetClass->core_class.resize = XtInheritResize;
+       topLevelShellWidgetClass->core_class.set_values_almost = XtInheritSetValuesAlmost;
+       ((TopLevelShellWidgetClass)topLevelShellWidgetClass)->composite_class.geometry_manager = XtInheritGeometryManager;
+       ((TopLevelShellWidgetClass)topLevelShellWidgetClass)->composite_class.change_managed = XtInheritChangeManaged;
+       ((TopLevelShellWidgetClass)topLevelShellWidgetClass)->composite_class.insert_child = XtInheritInsertChild;
+       ((TopLevelShellWidgetClass)topLevelShellWidgetClass)->composite_class.delete_child = XtInheritDeleteChild;
+   }
+ 
+   if(IsInLibXt(applicationShellWidgetClass)) {
+       applicationShellWidgetClass->core_class.realize = XtInheritRealize;
+       applicationShellWidgetClass->core_class.resize = XtInheritResize;
+       applicationShellWidgetClass->core_class.set_values_almost = XtInheritSetValuesAlmost;
+       ((ApplicationShellWidgetClass)applicationShellWidgetClass)->composite_class.geometry_manager = XtInheritGeometryManager;
+       ((ApplicationShellWidgetClass)applicationShellWidgetClass)->composite_class.change_managed = XtInheritChangeManaged;
+       ((ApplicationShellWidgetClass)applicationShellWidgetClass)->composite_class.delete_child = XtInheritDeleteChild;
+   }
+ 
+   /* Vendor.c */
+   if(IsInLibXt(vendorShellWidgetClass)) {
+       vendorShellWidgetClass->core_class.superclass = wmShellWidgetClass;
+       vendorShellWidgetClass->core_class.realize = XtInheritRealize;
+       vendorShellWidgetClass->core_class.resize = XtInheritResize;
+       vendorShellWidgetClass->core_class.set_values_almost = XtInheritSetValuesAlmost;
+       ((VendorShellWidgetClass)vendorShellWidgetClass)->composite_class.geometry_manager = XtInheritGeometryManager;
+       ((VendorShellWidgetClass)vendorShellWidgetClass)->composite_class.change_managed = XtInheritChangeManaged;
+       ((VendorShellWidgetClass)vendorShellWidgetClass)->composite_class.insert_child = XtInheritInsertChild;
+       ((VendorShellWidgetClass)vendorShellWidgetClass)->composite_class.delete_child = XtInheritDeleteChild;
+   }
+ 
+ }
+ #endif /* SVR3SHLIB */
+ 
+ 
diff -c /dev/null mit/lib/Xt/InitLibStub.s:2.0
*** /dev/null	Sat Mar 12 00:39:10 1994
--- mit/lib/Xt/InitLibStub.s	Sat Mar 12 00:39:10 1994
***************
*** 0 ****
--- 1,45 ----
+ 	.file	"InitLibStub.s"
+ 
+ /#####################################################################
+ /# InitLibStub.s						     #
+ /# ----------------------------------------------------------------- #
+ /# This stub goes to .init section of the client binary. It checks   #
+ /# the revision of the library and calls the init code for the       #
+ /# library							     #
+ /# Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany       #
+ /# (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)		     #
+ /#####################################################################
+ 
+ /# $XFree86: mit/lib/Xt/InitLibStub.s,v 2.0 1993/08/22 12:36:56 dawes Exp $
+ 
+ .data
+ / create unresolved reference
+ 	.long __bind_to_sv3shlib_
+ 
+ .section .init,"x" 
+ 
+ 	.align 4
+ 	.globl __libXt_init_stub_
+ 
+ __libXt_init_stub_:
+ 
+ / check revision of target shared library
+ 
+         pushl %ebp
+         movl %esp,%ebp
+         call __check_libXt_rev_
+         leave
+ 
+ / inititialize library
+ 
+         pushl %ebp
+         movl %esp,%ebp
+         call __default_libXt_init_
+         leave
+ 
+         pushl %ebp
+         movl %esp,%ebp
+         call __libXt_init_
+         leave
+ 
+ 
diff -c mit/lib/Xt/InitialI.h:1.1.1.3 mit/lib/Xt/InitialI.h:2.1
*** mit/lib/Xt/InitialI.h:1.1.1.3	Sat Mar 12 00:39:12 1994
--- mit/lib/Xt/InitialI.h	Sat Mar 12 00:39:12 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/InitialI.h,v 2.1 1993/11/13 04:23:36 dawes Exp $ */
  /* $XConsortium: InitialI.h,v 1.64.1.1 93/07/20 16:26:20 kaleb Exp $ */
  
  /***********************************************************
***************
*** 80,88 ****
--- 81,91 ----
  
  typedef struct 
  {
+ #ifndef _MINIX
    	Fd_set rmask;
  	Fd_set wmask;
  	Fd_set emask;
+ #endif
  	int	nfds;
  	int	count;
  } FdStruct;
diff -c mit/lib/Xt/Initialize.c:1.1.1.2 mit/lib/Xt/Initialize.c:1.2
*** mit/lib/Xt/Initialize.c:1.1.1.2	Sat Mar 12 00:39:12 1994
--- mit/lib/Xt/Initialize.c	Sat Mar 12 00:39:12 1994
***************
*** 178,184 ****
--- 178,186 ----
       uid_t uid;
  #else
       int uid;
+ #ifndef SCO324
       extern int getuid();
+ #endif
  #ifndef SYSV386
       extern struct passwd *getpwuid(), *getpwnam();
  #endif
diff -c mit/lib/Xt/Intrinsic.c:1.1.1.2 mit/lib/Xt/Intrinsic.c:1.6
*** mit/lib/Xt/Intrinsic.c:1.1.1.2	Sat Mar 12 00:39:13 1994
--- mit/lib/Xt/Intrinsic.c	Sat Mar 12 00:39:13 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Intrinsic.c,v 1.6 1993/05/19 05:30:23 dawes Exp $ */
  /* $XConsortium: Intrinsic.c,v 1.173 93/02/26 16:37:13 converse Exp $ */
  
  /***********************************************************
***************
*** 41,47 ****
--- 42,55 ----
  extern char *getenv();
  #endif
  
+ #ifndef SVR3SHLIB
  String XtCXtToolkitError = "XtToolkitError";
+ #else
+ extern String XtCXtToolkitError;
+ #ifdef SCO
+ extern int (*_libXt_stat)();
+ #endif
+ #endif
  
  Boolean XtIsSubclass(widget, widgetClass)
      Widget    widget;
***************
*** 985,990 ****
--- 993,999 ----
  {
      XtPerDisplay pd = _XtGetPerDisplay(dpy);
      static char *defaultPath = NULL;
+     static char defpath[1024];
      char *massagedPath;
      int bytesAllocd, bytesLeft;
      char *ch, *result;
***************
*** 997,1005 ****
  
      if (path == NULL) {
  #ifndef VMS
  	if (defaultPath == NULL) {
! 	    defaultPath = getenv("XFILESEARCHPATH");
! 	    if (defaultPath == NULL) defaultPath = XFILESEARCHPATHDEFAULT;
  	}
  	path = defaultPath;
  #else
--- 1006,1029 ----
  
      if (path == NULL) {
  #ifndef VMS
+ 	char *xwinhome = NULL;
+ 
  	if (defaultPath == NULL) {
! 	    if ((defaultPath = getenv("XFILESEARCHPATH")) == NULL) {
! 		if ((xwinhome = getenv("XWINHOME")) == NULL) {
! 		    defaultPath = XFILESEARCHPATHDEFAULT;
! 		}
! 		else {
! 		    char libpath[256];
! 
! 		    sprintf(libpath, "%s/lib/X11", xwinhome);
! 		    sprintf(defpath,
!                       "%s/%%L/%%T/%%N%%C%%S:%s/%%l/%%T/%%N%%C%%S:%s/%%T/%%N%%C%%S:%s/%%L/%%T/%%N%%S:%s/%%l/%%T/%%N%%S:%s/%%T/%%N%%S",
! 		      libpath, libpath, libpath, libpath, libpath,
! 		      libpath);
! 		    defaultPath = defpath;
! 		}
! 	    }
  	}
  	path = defaultPath;
  #else
diff -c mit/lib/Xt/Intrinsic.h:1.1.1.1 mit/lib/Xt/Intrinsic.h:1.2
*** mit/lib/Xt/Intrinsic.h:1.1.1.1	Sat Mar 12 00:39:14 1994
--- mit/lib/Xt/Intrinsic.h	Sat Mar 12 00:39:15 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Intrinsic.h,v 1.2 1993/03/20 03:40:49 dawes Exp $ */
  /* $XConsortium: Intrinsic.h,v 1.174 91/09/09 16:25:56 converse Exp $ */
  
  /***********************************************************
***************
*** 1880,1889 ****
  #endif	/* !CRAY2 */
  #endif  /* __STDC__ */
  #else	/* ! (CRAY || __arm) */
! 
  #define XtOffset(p_type,field) \
  	((Cardinal) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
! 
  #endif /* !CRAY */
  
  #ifdef offsetof
--- 1881,1892 ----
  #endif	/* !CRAY2 */
  #endif  /* __STDC__ */
  #else	/* ! (CRAY || __arm) */
! #ifndef AMOEBA
  #define XtOffset(p_type,field) \
  	((Cardinal) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
! #else  /* !AMOEBA */
! #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
! #endif /* AMOEBA */
  #endif /* !CRAY */
  
  #ifdef offsetof
diff -c mit/lib/Xt/IntrinsicI.h:1.1.1.1 mit/lib/Xt/IntrinsicI.h:1.2
*** mit/lib/Xt/IntrinsicI.h:1.1.1.1	Sat Mar 12 00:39:15 1994
--- mit/lib/Xt/IntrinsicI.h	Sat Mar 12 00:39:15 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/IntrinsicI.h,v 1.2 1993/03/20 03:40:52 dawes Exp $ */
  /* $XConsortium: IntrinsicI.h,v 1.48 91/06/27 13:24:18 converse Exp $ */
  
  /***********************************************************
***************
*** 148,154 ****
--- 149,159 ----
  
  /* used by XtResolvePathname */
  #ifndef XFILESEARCHPATHDEFAULT
+ #ifdef AMOEBA
+ #define XFILESEARCHPATHDEFAULT "/profile/module/x11r5/%L/%T/%N%S:/profile/module/x11r5/%l/%T/%N%S:/profile/module/x11r5/%T/%N%S"
+ #else /* !AMOEBA */
  #define XFILESEARCHPATHDEFAULT "/usr/lib/X11/%L/%T/%N%S:/usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S"
+ #endif /* AMOEBA */
  #endif
  
  /* the following two were both "X Toolkit " prior to R4 */
***************
*** 161,167 ****
--- 166,176 ----
  #endif
  
  #ifndef ERRORDB
+ #ifdef AMOEBA
+ #define ERRORDB "/profile/module/x11/XtErrorDB"
+ #else
  #define ERRORDB "/usr/lib/X11/XtErrorDB"
+ #endif
  #endif
  
  extern String XtCXtToolkitError;
diff -c mit/lib/Xt/NextEvent.c:1.1.1.2 mit/lib/Xt/NextEvent.c:2.1
*** mit/lib/Xt/NextEvent.c:1.1.1.2	Sat Mar 12 00:39:16 1994
--- mit/lib/Xt/NextEvent.c	Sat Mar 12 00:39:16 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/NextEvent.c,v 2.1 1993/09/22 15:33:01 dawes Exp $ */
  /* $XConsortium: NextEvent.c,v 1.110 93/02/10 15:47:39 converse Exp $ */
  
  /***********************************************************
***************
*** 27,32 ****
--- 28,37 ----
  #include "IntrinsicI.h"
  #include <stdio.h>
  #include <errno.h>
+ #ifdef _MINIX
+ #include <assert.h>
+ #include <signal.h>
+ #endif
  
  extern int errno;
  
***************
*** 33,38 ****
--- 38,52 ----
  static TimerEventRec* freeTimerRecs;
  static WorkProcRec* freeWorkRecs;
  
+ #ifdef AMOEBA
+ #define fd_set	Fd_set
+ #define event	__event
+ #define interval __interval
+ #include <amoeba.h>
+ #undef event
+ #undef interval
+ #endif
+ 
  /* Some systems running NTP daemons are known to return strange usec
   * values from gettimeofday.  At present (3/90) this has only been
   * reported on SunOS...
***************
*** 91,96 ****
--- 105,166 ----
  #define IS_AT_OR_AFTER(t1, t2) (((t2).tv_sec > (t1).tv_sec) \
  	|| (((t2).tv_sec == (t1).tv_sec)&& ((t2).tv_usec >= (t1).tv_usec)))
  
+ #ifdef SVR4
+ /*  This is a fix for the difference between BSD's select() and
+  *  some SVR4's select().  Some SVR4 select() implementations can neve
+  *  return a value larger than the total number of file descriptors being
+  *  checked.  So, if you select for read and write on one file descriptor,
+  *  and both are true, those implementations of select() will only return 1.
+  *  BSD select in the same situation will return 2.
+  *
+  *	Additionally, BSD select() on timing out, will zero the masks,
+  *	while SVR4 does not.  This is fixed here as well.
+  *
+  *	Jerry Whelan, guru@bradley.edu, June 12th, 1993
+  */
+ 
+ #ifdef __STDC__
+ static int BSDselect(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+ #endif
+ 
+ static int
+ BSDselect(nfds, readfds, writefds, exceptfds, timeout)
+ int nfds;
+ fd_set *readfds, *writefds, *exceptfds;
+ struct timeval *timeout;
+ {
+     int    rval, i;
+ 
+     rval = select(nfds, readfds, writefds, exceptfds, timeout);
+ 
+     switch(rval) {
+ 	case -1:    return(rval);
+ 	 	    break;
+ 
+ 	case 0:     if(readfds != NULL)
+ 		    FD_ZERO(readfds);
+ 		    if(writefds != NULL)
+ 			FD_ZERO(writefds);
+ 		    if(exceptfds != NULL)
+ 			FD_ZERO(exceptfds);
+ 
+ 		    return(rval);
+ 		    break;
+ 
+ 	default:    for(i=0, rval=0; i < nfds; i++) {
+ 			if((readfds != NULL) && FD_ISSET(i, readfds)) rval++;
+ 			if((writefds != NULL) && FD_ISSET(i, writefds)) rval++;
+ 			if((writefds != NULL) && FD_ISSET(i, exceptfds)) rval++;
+ 		    }
+ 		    return(rval);
+     }
+ /* Should never get here */
+ }
+ 
+ #define select(a,b,c,d,e)       BSDselect(a,b,c,d,e)
+ 
+ #endif /* SVR4 */
+ 
  static void QueueTimerEvent(app, ptr)
      XtAppContext app;
      TimerEventRec *ptr;
***************
*** 107,112 ****
--- 177,203 ----
           *tt = ptr;
  }
  
+ #ifdef AMOEBA
+ static int
+ gettimeofday(tvp, tzp)
+     struct timeval *tvp;
+     struct timezone *tzp;
+ {
+     static unsigned long lasttime, timedelta;
+     unsigned long curtime;
+     long time();
+ 
+     curtime = sys_milli();
+     if (lasttime == 0 || lasttime > curtime) {
+ 	/* re-init timer */
+ 	timedelta = time(0) - curtime/1000;
+     }
+     lasttime = curtime;
+     tvp->tv_sec = timedelta + curtime/1000;
+     tvp->tv_usec = 1000 * (curtime%1000);
+ }
+ #endif /* AMOEBA */
+ 
  /* 
   * Routine to block in the toolkit.  This should be the only call to select.
   *
***************
*** 139,144 ****
--- 230,236 ----
   * makes little sense to do this regardless of the value of howlong
   * (bottom line is, we don't bother checking here).
   */
+ #ifndef _MINIX
  #if NeedFunctionPrototypes
  int _XtwaitForSomething(
  	_XtBoolean ignoreTimers,
***************
*** 167,174 ****
--- 259,270 ----
  	struct timeval	max_wait_time;
  	static struct timeval  zero_time = { 0 , 0};
  	register struct timeval *wait_time_ptr;
+ #ifndef AMOEBA
  	Fd_set rmaskfd, wmaskfd, emaskfd;
  	static Fd_set zero_fd = { 0 };
+ #else
+ 	int timout;
+ #endif
  	int nfound, i, d;
  	
   	if (block) {
***************
*** 200,205 ****
--- 296,302 ----
  			}
  		    } else wait_time_ptr = &zero_time;
  		} 
+ #ifndef AMOEBA
  		if( !ignoreInputs ) {
  			rmaskfd = app->fds.rmask;
  			wmaskfd = app->fds.wmask;
***************
*** 211,221 ****
  		}
  		if (!ignoreEvents) {
  		    for (d = 0; d < app->count; d++) {
! 			FD_SET (ConnectionNumber(app->list[d]), &rmaskfd);
  		    }
  		}
! 		nfound = select (app->fds.nfds, (int *) &rmaskfd,
! 			(int *) &wmaskfd, (int *) &emaskfd, wait_time_ptr);
  		if (nfound == -1) {
  			/*
  			 *  interrupt occured recalculate time value and select
--- 308,363 ----
  		}
  		if (!ignoreEvents) {
  		    for (d = 0; d < app->count; d++) {
! 			FD_SET (ConnectionNumber(app->list[d]),
! 			        (fd_set *)&rmaskfd);
  		    }
  		}
! 		nfound = select (app->fds.nfds, (fd_set *) &rmaskfd,
! 			         (fd_set *) &wmaskfd, (fd_set *) &emaskfd,
! 				 wait_time_ptr);
! #else
! 		/*
! 		 * Unfortunately we cannot use select when using the
! 		 * amoeba protocol. We call _XAmSelect to wait for the
! 		 * display to produce input (or until the timer runs
! 		 * out).
! 		 * This has two disadvantages:
! 		 * - We cannot wait for multiple displays.
! 		 *   (this is handled in Display.c, by not allowing more
! 		 *   than one to be opened)
! 		 * - We cannot wait for other file descriptors.
! 		 *   (I know no solution for this. Let's hope it doesn't
! 		 *   matter).
! 		 * However, this should at least enable us to handle most
! 		 * applications (i.e. with one display and no files).
! 		 *
! 		 * There is a workaround, however, in the form of
! 		 * XamSetSema and XamBlock, which allow you to wait for
! 		 * X events or other things.
! 		 */
! 		if (wait_time_ptr == 0 && ignoreEvents) {
! 		    fprintf(stderr, "XtWaitForSomething: infinite wait\n");
! 		    abort();
! 		}
! 		if (app->count != 1)
! 		    XtErrorMsg("xxx", "XtwaitForSomething", "XtToolkitError",
! 			"No display", (String *)NULL, (Cardinal *)NULL);
! 		if (wait_time_ptr)
! 		    timout = wait_time_ptr->tv_sec*1000 +
! 				(wait_time_ptr->tv_usec+999)/1000;
! 		else
! 		    timout = -1;
! 		if (ignoreEvents) {
! 		    mutex mu;
! 
! 		    mu_init(&mu);
! 		    mu_lock(&mu);
! 		    mu_trylock(&mu, timout);
! 		    nfound = 0;
! 		} else {
! 		    nfound = _XAmSelect(ConnectionNumber(app->list[0]), timout);
! 		}
! #endif /* AMOEBA */
  		if (nfound == -1) {
  			/*
  			 *  interrupt occured recalculate time value and select
***************
*** 276,285 ****
  	    else
  		*howlong -= (time_spent.tv_sec*1000+time_spent.tv_usec/1000);
  	}
  	if(ignoreInputs) {
  	    if (ignoreEvents) return -1; /* then only doing timers */
  	    for (d = 0; d < app->count; d++) {
! 		if (FD_ISSET(ConnectionNumber(app->list[d]), &rmaskfd)) {
  		    if (XEventsQueued( app->list[d], QueuedAfterReading ))
  			return d;
  		    /*
--- 418,428 ----
  	    else
  		*howlong -= (time_spent.tv_sec*1000+time_spent.tv_usec/1000);
  	}
+ #ifndef AMOEBA
  	if(ignoreInputs) {
  	    if (ignoreEvents) return -1; /* then only doing timers */
  	    for (d = 0; d < app->count; d++) {
! 		if (FD_ISSET(ConnectionNumber(app->list[d]), (fd_set *)&rmaskfd)) {
  		    if (XEventsQueued( app->list[d], QueuedAfterReading ))
  			return d;
  		    /*
***************
*** 301,307 ****
  
  	for (i = 0; i < app->fds.nfds && nfound > 0; i++) {
  	    XtInputMask condition = 0;
! 	    if (FD_ISSET (i, &rmaskfd)) {
  		nfound--;
  		if (!ignoreEvents) {
  		    for (d = 0; d < app->count; d++) {
--- 444,450 ----
  
  	for (i = 0; i < app->fds.nfds && nfound > 0; i++) {
  	    XtInputMask condition = 0;
! 	    if (FD_ISSET (i, (fd_set *)&rmaskfd)) {
  		nfound--;
  		if (!ignoreEvents) {
  		    for (d = 0; d < app->count; d++) {
***************
*** 326,336 ****
  		}
  		condition = XtInputReadMask;
  	    }
! 	    if (FD_ISSET (i, &wmaskfd)) {
  		condition |= XtInputWriteMask;
  		nfound--;
  	    }
! 	    if (FD_ISSET (i, &emaskfd)) {
  		condition |= XtInputExceptMask;
  		nfound--;
  	    }
--- 469,479 ----
  		}
  		condition = XtInputReadMask;
  	    }
! 	    if (FD_ISSET (i, (fd_set *)&wmaskfd)) {
  		condition |= XtInputWriteMask;
  		nfound--;
  	    }
! 	    if (FD_ISSET (i, (fd_set *)&emaskfd)) {
  		condition |= XtInputExceptMask;
  		nfound--;
  	    }
***************
*** 350,356 ****
--- 493,656 ----
  	    return ret;
  	goto WaitLoop;		/* must have been only error events */
  	}
+ #else
+ 	return nfound ? 0 : -1;
+ #endif
+ }
+ #else /* _MINIX */
+ #if NeedFunctionPrototypes
+ int _XtwaitForSomething(
+ 	_XtBoolean ignoreTimers,
+ 	_XtBoolean ignoreInputs,
+ 	_XtBoolean ignoreEvents,
+ 	_XtBoolean block,
+ 	unsigned long *howlong,
+ 	XtAppContext app
+         )
+ #else
+ int _XtwaitForSomething(ignoreTimers, ignoreInputs, ignoreEvents,
+ 			block, howlong, app)
+ 	Boolean ignoreTimers;
+ 	Boolean ignoreInputs;
+ 	Boolean ignoreEvents;
+ 	Boolean block;
+ 	unsigned long *howlong;
+ 	XtAppContext app;
+ #endif
+ {
+ /* MINIX version. Inputs are not supported. */
+ 
+ 	struct timeval  cur_time;
+ 	struct timeval  start_time;
+ 	struct timeval  wait_time;
+ 	struct timeval  new_time;
+ 	struct timeval  time_spent;
+ 	struct timeval	max_wait_time;
+ 	static struct timeval  zero_time = { 0 , 0};
+ 	register struct timeval *wait_time_ptr;
+ 	int r, i, d, fd;
+ 	asio_fd_set_t asio_bits;
+ 	struct fwait fw;
+ 	
+  	if (block) {
+ 		(void) gettimeofday (&cur_time, NULL);
+ 		FIXUP_TIMEVAL(cur_time);
+ 		start_time = cur_time;
+ 		if(howlong == NULL) { /* special case for ever */
+ 			wait_time_ptr = 0;
+ 		} else { /* block until at most */
+ 			max_wait_time.tv_sec = *howlong/1000;
+ 			max_wait_time.tv_usec = (*howlong %1000)*1000;
+ 			wait_time_ptr = &max_wait_time;
+ 		}
+ 	} else {  /* don't block */
+ 		max_wait_time = zero_time;
+ 		wait_time_ptr = &max_wait_time;
+ 	}
+ 
+       WaitLoop:
+ 	while (1) {
+ 		ASIO_FD_ZERO(&asio_bits);
+ 		if (app->timerQueue != NULL && !ignoreTimers && block) {
+ 		    if(IS_AFTER(cur_time, app->timerQueue->te_timer_value)) {
+ 			TIMEDELTA (wait_time, app->timerQueue->te_timer_value, 
+ 				   cur_time);
+ 			if(howlong==NULL || IS_AFTER(wait_time,max_wait_time)){
+ 				wait_time_ptr = &wait_time;
+ 			} else {
+ 				wait_time_ptr = &max_wait_time;
+ 			}
+ 		    } else wait_time_ptr = &zero_time;
+ 		} 
+ 		if (!ignoreEvents) {
+ 		    for (d = 0; d < app->count; d++) {
+ 		    	if (XEventsQueued(app->list[d], QueuedAfterReading))
+ 			    return d;
+ 			fd= MNX_XConnectionNumber(app->list[d]);
+ 			assert(fd != -1);
+ 			ASIO_FD_SET (fd, ASIO_READ, &asio_bits);
+ 		    }
+ 		}
+ 		fw.fw_flags= 0;
+ 		fw.fw_bits= asio_bits.afds_bits;
+ 		fw.fw_maxfd= ASIO_FD_SETSIZE;
+ 		if (wait_time_ptr)
+ 			r= timed_fwait(&fw, wait_time_ptr);
+ 		else
+ 			r= fwait(&fw);
+ 		if (r == -1) {
+ 			/*
+ 			 *  interrupt occured recalculate time value and select
+ 			 *  again.
+ 			 */
+ 			if (errno == EINTR) {
+ 			    errno = 0;  /* errno is not self reseting */
+ 			    if (block) {
+ 				if (wait_time_ptr == NULL) /*howlong == NULL*/
+ 				    continue;
+ 				(void)gettimeofday (&new_time, NULL);
+ 				FIXUP_TIMEVAL(new_time);
+ 				TIMEDELTA(time_spent, new_time, cur_time);
+ 				cur_time = new_time;
+ 				if(IS_AFTER(time_spent, *wait_time_ptr)) {
+ 					TIMEDELTA(wait_time, *wait_time_ptr,
+ 						  time_spent);
+ 					wait_time_ptr = &wait_time;
+ 					continue;
+ 				}
+ 				/* time is up */
+ 			    }
+ 			} else {
+ 			    char Errno[12];
+ 			    String param = Errno;
+ 			    Cardinal param_count = 1;
+ 
+ 			    sprintf( Errno, "%d", errno);
+ 			    XtAppWarningMsg(app, "communicationError","fwait",
+ 			       XtCXtToolkitError,"Select failed; error code %s",
+ 			       &param, &param_count);
+ 			    return -1;
+ 			}
+ 		} /* timed out or input available */
+ 		break;
+ 	}
+ 	
+ 	if (r == -1) {
+ 		if(howlong) *howlong = (unsigned long)0;  /* Timed out */
+ 		return -1;
+ 	}
+ 	assert(!ignoreEvents);
+ 	if(block && howlong != NULL) { /* adjust howlong */
+ 	    (void) gettimeofday (&new_time, NULL);
+ 	    FIXUP_TIMEVAL(new_time);
+ 	    TIMEDELTA(time_spent, new_time, start_time);
+ 	    if(*howlong <= (time_spent.tv_sec*1000+time_spent.tv_usec/1000))
+ 		*howlong = (unsigned long)0;  /* Timed out */
+ 	    else
+ 		*howlong -= (time_spent.tv_sec*1000+time_spent.tv_usec/1000);
+ 	}
+ 
+ 	for (d = 0; d < app->count; d++) {
+ 	    fd= MNX_XConnectionNumber(app->list[d]);
+ 	    if (fw.fw_fd != fd)
+ 		continue;
+ 	    assert(fw.fw_operation == ASIO_READ);
+ 	    XReplyReadStatus(app->list[d], fw.fw_result, fw.fw_errno);
+ 	    if (XEventsQueued( app->list[d], QueuedAfterReading ))
+ 		return d;
+ 	    /*
+ 	     * An error event could have arrived
+ 	     * without any real events, or events
+ 	     * could have been swallowed by Xlib,
+ 	     * or the connection may be broken.
+ 	     * We can't tell the difference, so
+ 	     * ssume Xlib will eventually discover
+ 	     * a broken connection.
+ 	     */
+ 	}
+ 	goto WaitLoop;	/* must have been only error events */
  }
+ #endif /* _MINIX */
  
  #define IeCallProc(ptr) \
      (*ptr->ie_proc) (ptr->ie_closure, &ptr->ie_source, (XtInputId*)&ptr);
***************
*** 483,488 ****
--- 783,789 ----
  	XtInputCallbackProc proc;
  	XtPointer closure;
  {
+ #ifndef _MINIX
  	InputEvent* sptr;
  	XtInputMask condition = (XtInputMask) Condition;
  	
***************
*** 510,528 ****
  	sptr->ie_next = app->input_list[source];
  	app->input_list[source] = sptr;
  
! 	if (condition & XtInputReadMask)   FD_SET(source, &app->fds.rmask);
! 	if (condition & XtInputWriteMask)  FD_SET(source, &app->fds.wmask);
! 	if (condition & XtInputExceptMask) FD_SET(source, &app->fds.emask);
  
  	if (app->fds.nfds < (source+1)) app->fds.nfds = source+1;
  	app->fds.count++;
  	return((XtInputId)sptr);
  
  }
  
  void XtRemoveInput( id )
  	register XtInputId  id;
  {
    	register InputEvent *sptr, *lptr;
  	XtAppContext app = ((InputEvent *)id)->app;
  	register int source = ((InputEvent *)id)->ie_source;
--- 811,834 ----
  	sptr->ie_next = app->input_list[source];
  	app->input_list[source] = sptr;
  
! 	if (condition & XtInputReadMask)   FD_SET(source, (fd_set *)&app->fds.rmask);
! 	if (condition & XtInputWriteMask)  FD_SET(source, (fd_set *)&app->fds.wmask);
! 	if (condition & XtInputExceptMask) FD_SET(source, (fd_set *)&app->fds.emask);
  
  	if (app->fds.nfds < (source+1)) app->fds.nfds = source+1;
  	app->fds.count++;
  	return((XtInputId)sptr);
  
+ #else  /* _MINIX */
+ 	printf("XtAppAddInput not implemented\n");
+ 	abort();
+ #endif /* _MINIX */
  }
  
  void XtRemoveInput( id )
  	register XtInputId  id;
  {
+ #ifndef _MINIX
    	register InputEvent *sptr, *lptr;
  	XtAppContext app = ((InputEvent *)id)->app;
  	register int source = ((InputEvent *)id)->ie_source;
***************
*** 552,564 ****
  				    condition |= lptr->ie_condition;
  				if ((sptr->ie_condition & XtInputReadMask) &&
  				    !(condition & XtInputReadMask))
! 				   FD_CLR(source, &app->fds.rmask);
  				if ((sptr->ie_condition & XtInputWriteMask) &&
  				    !(condition & XtInputWriteMask))
! 				   FD_CLR(source, &app->fds.wmask);
  				if ((sptr->ie_condition & XtInputExceptMask) &&
  				    !(condition & XtInputExceptMask))
! 				   FD_CLR(source, &app->fds.emask);
  				XtFree((char *) sptr);
  				found = True;
  				break;
--- 858,870 ----
  				    condition |= lptr->ie_condition;
  				if ((sptr->ie_condition & XtInputReadMask) &&
  				    !(condition & XtInputReadMask))
! 				   FD_CLR(source, (fd_set *)&app->fds.rmask);
  				if ((sptr->ie_condition & XtInputWriteMask) &&
  				    !(condition & XtInputWriteMask))
! 				   FD_CLR(source, (fd_set *)&app->fds.wmask);
  				if ((sptr->ie_condition & XtInputExceptMask) &&
  				    !(condition & XtInputExceptMask))
! 				   FD_CLR(source, (fd_set *)&app->fds.emask);
  				XtFree((char *) sptr);
  				found = True;
  				break;
***************
*** 573,578 ****
--- 879,888 ----
  	XtAppWarningMsg(app, "invalidProcedure","inputHandler",XtCXtToolkitError,
                     "XtRemoveInput: Input handler not found",
  		   (String *)NULL, (Cardinal *)NULL);
+ #else  /* _MINIX */
+ 	printf("XtRemoveInput not implemented\n");
+ 	abort();
+ #endif /* _MINIX */
  }
  
  void _XtRemoveAllInputs(app)
***************
*** 934,936 ****
--- 1244,1310 ----
  	event->xany.window = 0;
  	return FALSE;
  }	
+ 
+ #ifdef _MINIX
+ #include <time.h>
+ 
+ void sig_func(sig)
+ int sig;
+ {
+ 	signal(SIGALRM, sig_func);
+ 	alarm(1);
+ }
+ 
+ int timed_fwait(fwp, tvp)
+ struct fwait *fwp;
+ struct timeval *tvp;
+ {
+ 	struct timeval end_tim, curr_tim, diff_tim;
+ 	time_t start_time, alarm_time, curr_time;
+ 	void (*sigf) _ARGS(( int sig ));
+ 	int r, err;
+ 
+ 	gettimeofday(&curr_tim, NULL);
+ 	ADD_TIME(end_tim, *tvp, curr_tim);
+ 	start_time= time(NULL);
+ 	sigf= signal(SIGALRM, sig_func);
+ 	alarm_time= alarm(0);
+ 	for(;;)
+ 	{
+ 		if (IS_AT_OR_AFTER(end_tim, curr_tim))
+ 		{	
+ 			err = EINTR;
+ 			r = -1;
+ 			break;
+ 		}
+ 		TIMEDELTA(diff_tim, end_tim, curr_tim);
+ 		if (diff_tim.tv_usec)
+ 			diff_tim.tv_sec++;
+ 		assert(diff_tim.tv_sec > 0);
+ 		alarm(diff_tim.tv_sec);
+ 		r= fwait(fwp);
+ 		if (r == -1 && errno == EINTR) {
+ 			gettimeofday(&curr_tim, NULL);
+ 		} else {
+ 			err= errno;
+ 			break;
+ 		}
+ 	}
+ 
+ 	/* Restore alarm pending when timed_fwait was called */
+ 	alarm(0);
+ 	signal(SIGALRM, sigf);
+ 	if (alarm_time)
+ 	{
+ 		curr_time= time(NULL);
+ 		if (curr_time < start_time + alarm_time)
+ 			alarm((start_time + alarm_time) - curr_time);
+ 		else
+ 			alarm(1);	/* best we can do */
+ 	}
+ 
+ 	errno= err;
+ 	return r;
+ }
+ 
+ #endif /* _MINIX */
diff -c mit/lib/Xt/Object.c:1.1.1.1 mit/lib/Xt/Object.c:1.3
*** mit/lib/Xt/Object.c:1.1.1.1	Sat Mar 12 00:39:17 1994
--- mit/lib/Xt/Object.c	Sat Mar 12 00:39:19 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Object.c,v 1.3 1993/03/27 09:12:35 dawes Exp $ */
  /* $XConsortium: Object.c,v 1.19 91/06/10 15:08:05 converse Exp $ */
  
  /***********************************************************
***************
*** 75,82 ****
--- 76,87 ----
  }
  };
  
+ #ifndef SVR3SHLIB
  externaldef(objectClass) WidgetClass objectClass
                            = (WidgetClass)&objectClassRec;
+ #else
+ externalref WidgetClass objectClass;
+ #endif
  
  /*
   * Start of object routines.
diff -c mit/lib/Xt/RectObj.c:1.1.1.1 mit/lib/Xt/RectObj.c:1.3
*** mit/lib/Xt/RectObj.c:1.1.1.1	Sat Mar 12 00:39:19 1994
--- mit/lib/Xt/RectObj.c	Sat Mar 12 00:39:19 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/RectObj.c,v 1.3 1993/03/27 09:12:37 dawes Exp $ */
  /* $XConsortium: RectObj.c,v 1.14 91/06/11 20:11:45 converse Exp $ */
  
  /***********************************************************
***************
*** 62,68 ****
--- 63,73 ----
  
  externaldef(rectobjclassrec) RectObjClassRec rectObjClassRec = {
    {
+ #ifndef SVR3SHLIB
      /* superclass	  */	(WidgetClass)&objectClassRec,
+ #else
+     /* superclass         */	NULL,	/* binded on runtime */
+ #endif
      /* class_name	  */	"Rect",
      /* widget_size	  */	sizeof(RectObjRec),
      /* class_initialize   */    NULL,
***************
*** 97,104 ****
--- 102,114 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  externaldef(rectObjClass)
  WidgetClass rectObjClass = (WidgetClass)&rectObjClassRec;
+ #else
+ externalref WidgetClass rectObjClass;
+ #define _XtInherit  (*_libXt__XtInherit)
+ #endif
  
  /*ARGSUSED*/
  static void XtCopyAncestorSensitive(widget, offset, value)
diff -c mit/lib/Xt/Shell.c:1.1.1.3 mit/lib/Xt/Shell.c:1.4
*** mit/lib/Xt/Shell.c:1.1.1.3	Sat Mar 12 00:39:20 1994
--- mit/lib/Xt/Shell.c	Sat Mar 12 00:39:21 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Shell.c,v 1.4 1993/05/26 02:12:42 dawes Exp $ */
  /* $XConsortium: Shell.c,v 1.134 93/05/25 10:38:24 kaleb Exp $ */
  
  /***********************************************************
***************
*** 131,137 ****
--- 132,142 ----
  
  externaldef(shellclassrec) ShellClassRec shellClassRec = {
    {   /* Core */
+ #ifndef SVR3SHLIB
      /* superclass	  */	(WidgetClass) &compositeClassRec,
+ #else
+     /* superclass         */	NULL,	/* binded on runtime */
+ #endif
      /* class_name	  */	"Shell",
      /* size		  */	sizeof(ShellRec),
      /* Class Initializer  */	NULL,
***************
*** 174,180 ****
--- 179,189 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  externaldef(shellwidgetclass) WidgetClass shellWidgetClass = (WidgetClass) (&shellClassRec);
+ #else
+ externalref WidgetClass shellWidgetClass;
+ #endif
  
  /***************************************************************************
   *
***************
*** 238,245 ****
--- 247,258 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  externaldef(overrideshellwidgetclass) WidgetClass overrideShellWidgetClass = 
  	(WidgetClass) (&overrideShellClassRec);
+ #else
+ externalref WidgetClass overrideShellWidgetClass;
+ #endif
  
  /***************************************************************************
   *
***************
*** 383,389 ****
--- 396,406 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  externaldef(wmshellwidgetclass) WidgetClass wmShellWidgetClass = (WidgetClass) (&wmShellClassRec);
+ #else
+ externalref WidgetClass wmShellWidgetClass;
+ #endif
  
  /***************************************************************************
   *
***************
*** 409,415 ****
--- 426,436 ----
  
  externaldef(transientshellclassrec) TransientShellClassRec transientShellClassRec = {
    {
+ #ifndef SVR3SHLIB
      /* superclass	  */	(WidgetClass) &vendorShellClassRec,
+ #else
+     /* superclass	  */	NULL,	/* binded on runtime */
+ #endif
      /* class_name	  */	"TransientShell",
      /* size		  */	sizeof(TransientShellRec),
      /* Class Initializer  */	NULL,
***************
*** 458,465 ****
--- 479,490 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  externaldef(transientshellwidgetclass) WidgetClass transientShellWidgetClass =
  	(WidgetClass) (&transientShellClassRec);
+ #else
+ externalref WidgetClass transientShellWidgetClass;
+ #endif
  
  /***************************************************************************
   *
***************
*** 487,493 ****
--- 512,522 ----
  
  externaldef(toplevelshellclassrec) TopLevelShellClassRec topLevelShellClassRec = {
    {
+ #ifndef SVR3SHLIB
      /* superclass         */    (WidgetClass) &vendorShellClassRec,
+ #else
+     /* superclass         */	NULL,	/* binded on runtime */
+ #endif
      /* class_name         */    "TopLevelShell",
      /* size               */    sizeof(TopLevelShellRec),
      /* Class Initializer  */	NULL,
***************
*** 536,543 ****
--- 565,576 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  externaldef(toplevelshellwidgetclass) WidgetClass topLevelShellWidgetClass =
  	(WidgetClass) (&topLevelShellClassRec);
+ #else
+ externalref WidgetClass topLevelShellWidgetClass;
+ #endif
  
  /***************************************************************************
   *
***************
*** 623,630 ****
--- 656,668 ----
    }
  };
  
+ #ifndef SVR3SHLIB
  externaldef(applicationshellwidgetclass) WidgetClass applicationShellWidgetClass =
  	(WidgetClass) (&applicationShellClassRec);
+ #else
+ externalref WidgetClass applicationShellWidgetClass;
+ #define _XtInherit  (*_libXt__XtInherit)
+ #endif
  
  /****************************************************************************
   * Whew!
diff -c mit/lib/Xt/TMgrab.c:1.1.1.2 mit/lib/Xt/TMgrab.c:1.5
*** mit/lib/Xt/TMgrab.c:1.1.1.2	Sat Mar 12 00:39:22 1994
--- mit/lib/Xt/TMgrab.c	Sat Mar 12 00:39:22 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/TMgrab.c,v 1.5 1993/05/19 05:30:29 dawes Exp $ */
  /* $XConsortium: TMgrab.c,v 1.9 92/12/24 10:41:47 converse Exp $ */
  /*LINTLIBRARY*/
  
diff -c mit/lib/Xt/TMparse.c:1.1.1.3 mit/lib/Xt/TMparse.c:2.0
*** mit/lib/Xt/TMparse.c:1.1.1.3	Sat Mar 12 00:39:23 1994
--- mit/lib/Xt/TMparse.c	Sat Mar 12 00:39:23 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/TMparse.c,v 2.0 1993/11/13 04:23:38 dawes Exp $ */
  /* $XConsortium: TMparse.c,v 1.135 93/08/05 11:54:10 kaleb Exp $ */
  
  /***********************************************************
***************
*** 23,28 ****
--- 24,33 ----
  SOFTWARE.
  
  ******************************************************************/
+ 
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
  
  #include "IntrinsicI.h"
  #include "StringDefs.h"
diff -c mit/lib/Xt/TMstate.c:1.1.1.2 mit/lib/Xt/TMstate.c:1.4
*** mit/lib/Xt/TMstate.c:1.1.1.2	Sat Mar 12 00:39:24 1994
--- mit/lib/Xt/TMstate.c	Sat Mar 12 00:39:24 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/TMstate.c,v 1.4 1993/05/19 05:30:34 dawes Exp $ */
  /* $XConsortium: TMstate.c,v 1.164 93/02/05 16:47:46 converse Exp $ */
  /*LINTLIBRARY*/
  
***************
*** 42,48 ****
--- 43,51 ----
  
  static String XtNtranslationError = "translationError";
  
+ #ifndef SVR3SHLIB
  TMGlobalRec _XtGlobalTM; /* initialized to zero K&R */
+ #endif
  
  #define MatchIncomingEvent(tmEvent, typeMatch, modMatch) \
    (typeMatch->eventType == tmEvent->event.eventType && \
diff -c mit/lib/Xt/VarCreate.c:1.1.1.2 mit/lib/Xt/VarCreate.c:1.4
*** mit/lib/Xt/VarCreate.c:1.1.1.2	Sat Mar 12 00:39:25 1994
--- mit/lib/Xt/VarCreate.c	Sat Mar 12 00:39:25 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/VarCreate.c,v 1.4 1993/05/19 05:30:37 dawes Exp $ */
  /* $XConsortium: VarCreate.c,v 1.26 93/05/13 16:20:25 kaleb Exp $ */
  
  /*
***************
*** 18,23 ****
--- 19,28 ----
  without express or implied warranty.
  
  */
+ 
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
  
  #include "IntrinsicI.h"
  #include "StringDefs.h"
diff -c mit/lib/Xt/VarGet.c:1.1.1.1 mit/lib/Xt/VarGet.c:1.3
*** mit/lib/Xt/VarGet.c:1.1.1.1	Sat Mar 12 00:39:25 1994
--- mit/lib/Xt/VarGet.c	Sat Mar 12 00:39:25 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/VarGet.c,v 1.3 1993/03/27 09:12:53 dawes Exp $ */
  /* $XConsortium: VarGet.c,v 1.17 91/06/13 18:07:07 converse Exp $ */
  /*
  
***************
*** 17,22 ****
--- 18,27 ----
  without express or implied warranty.
  
  */
+ 
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
  
  #include "IntrinsicI.h"
  #include "VarargsI.h"
diff -c mit/lib/Xt/Vendor.c:1.1.1.1 mit/lib/Xt/Vendor.c:1.3
*** mit/lib/Xt/Vendor.c:1.1.1.1	Sat Mar 12 00:39:26 1994
--- mit/lib/Xt/Vendor.c	Sat Mar 12 00:39:26 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/Xt/Vendor.c,v 1.3 1993/03/27 09:12:54 dawes Exp $ */
  /* $XConsortium: Vendor.c,v 1.43 91/07/23 16:10:30 converse Exp $ */
  
  /***********************************************************
***************
*** 42,48 ****
--- 43,53 ----
  
  externaldef(vendorshellclassrec) VendorShellClassRec vendorShellClassRec = {
    {
+ #ifndef SVR3SHLIB
      /* superclass         */    (WidgetClass) &wmShellClassRec,
+ #else
+     /* superclass         */	NULL,	/* binded on runtime */
+ #endif
      /* class_name         */    "VendorShell",
      /* size               */    sizeof(VendorShellRec),
      /* Class Initializer  */	NULL,
***************
*** 89,95 ****
    }
  };
  
! #if !defined(AIXSHLIB) || !defined(SHAREDCODE)
  externaldef(vendorshellwidgetclass) WidgetClass vendorShellWidgetClass =
  	(WidgetClass) (&vendorShellClassRec);
  #endif
--- 94,100 ----
    }
  };
  
! #if (!defined(AIXSHLIB) || !defined(SHAREDCODE)) && !defined(SVR3SHLIB)
  externaldef(vendorshellwidgetclass) WidgetClass vendorShellWidgetClass =
  	(WidgetClass) (&vendorShellClassRec);
  #endif
diff -c mit/lib/Xt/Xtos.h:1.1.1.2 mit/lib/Xt/Xtos.h:1.2
*** mit/lib/Xt/Xtos.h:1.1.1.2	Sat Mar 12 00:39:26 1994
--- mit/lib/Xt/Xtos.h	Sat Mar 12 00:39:26 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+ * $XFree86: mit/lib/Xt/Xtos.h,v 1.2 1993/06/03 15:27:48 dawes Exp $
  * $XConsortium: Xtos.h,v 1.11 91/11/08 17:55:15 gildea Exp $
  */
  
***************
*** 50,56 ****
  
  #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 */
--- 51,57 ----
  
  #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 */
diff -c /dev/null mit/lib/Xt/dummyBind.c:1.2
*** /dev/null	Sat Mar 12 00:39:27 1994
--- mit/lib/Xt/dummyBind.c	Sat Mar 12 00:39:27 1994
***************
*** 0 ****
--- 1,16 ----
+ /* libXt: dummyBind.c
+  *
+  * This dummy function is only linked to the client if the client
+  * doesn't supply one
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xt/dummyBind.c,v 1.2 1993/03/27 09:12:56 dawes Exp $
+  */
+ 
+ void _bind_to_sv3shlib_()
+ {
+    /* do nothing */
+ 
+ }
+ 
diff -c mit/lib/Xt/fd.h:1.1.1.2 mit/lib/Xt/fd.h:2.1
*** mit/lib/Xt/fd.h:1.1.1.2	Sat Mar 12 00:39:27 1994
--- mit/lib/Xt/fd.h	Sat Mar 12 00:39:27 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+ * $XFree86: mit/lib/Xt/fd.h,v 2.1 1993/11/13 04:23:41 dawes Exp $
  * $XConsortium: fd.h,v 1.15 93/07/08 13:29:55 kaleb Exp $
  * $oHeader: fd.h,v 1.4 88/08/26 14:49:54 asente Exp $
  */
***************
*** 34,39 ****
--- 35,42 ----
  #include <sys/select.h>		/* defines FD stuff except howmany() */
  #endif
  
+ #ifndef _MINIX
+ 
  #ifndef NBBY
  #define	NBBY	8		/* number of bits in a byte */
  #endif
***************
*** 71,75 ****
--- 74,86 ----
  #ifndef FD_ZERO
  #define FD_ZERO(p)	bzero((char *)(p), sizeof(*(p)))
  #endif
+ 
+ #else /* _MINIX */
+ 
+ /* Minix has it own set manipulation stuff in <fcntl.h> which is incompatible
+  * with standard the fd_sets used for select.
+  */
+ 
+ #endif /* !_MINIX */
  
  #endif /*_Xt_fd_set*/
diff -c /dev/null mit/lib/Xt/globals.c:1.3
*** /dev/null	Sat Mar 12 00:39:27 1994
--- mit/lib/Xt/globals.c	Sat Mar 12 00:39:27 1994
***************
*** 0 ****
--- 1,147 ----
+ /* libXt : libXt.c
+  * exported data
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/Xt/globals.c,v 1.3 1993/03/20 03:40:55 dawes Exp $
+  */
+ 
+ #include "IntrinsicI.h"         /* to get XrmQuark,      */
+                                 /* TMGlobalRec, String   */
+ 
+ #ifdef SVR3SHLIB
+ 
+ #ifdef __STDC__
+ #define Const const
+ #else
+ #define Const /**/
+ #endif
+ 
+ #define VoidInit(var) void *var = 0
+ 
+ Const char *_shared_libXt_version = SOXTREV;  char __libXt__sp1__[16] = "";
+ 
+ String XtCXtToolkitError = "XtToolkitError";  char __libXt__sp2__[32] = "";
+ TMGlobalRec _XtGlobalTM = {0};
+ int _XtInheritTranslations = 0;
+ XrmQuark  _XtQString = 0;
+ 
+ VoidInit(_libXt__aux__);
+ VoidInit(_libXt__ctype);
+ VoidInit(_libXt__iob);
+ VoidInit(_libXt_access);
+ VoidInit(_libXt_atof);
+ VoidInit(_libXt_calloc);
+ VoidInit(_libXt_errno);
+ VoidInit(_libXt_exit);
+ VoidInit(_libXt_fclose);
+ VoidInit(_libXt_fopen);
+ VoidInit(_libXt_fprintf);
+ VoidInit(_libXt_free);
+ VoidInit(_libXt_getenv);
+ VoidInit(_libXt_gethostname);
+ VoidInit(_libXt_getpwnam);
+ VoidInit(_libXt_getpwuid);
+ VoidInit(_libXt_gettimeofday);
+ VoidInit(_libXt_getuid);
+ VoidInit(_libXt_malloc);
+ VoidInit(_libXt_memset);
+ VoidInit(_libXt_printf);
+ VoidInit(_libXt_qsort);
+ VoidInit(_libXt_realloc);
+ VoidInit(_libXt_select);
+ VoidInit(_libXt_sprintf);
+ VoidInit(_libXt_stat);
+ VoidInit(_libXt_strcat);
+ VoidInit(_libXt_strchr);
+ VoidInit(_libXt_strcmp);
+ VoidInit(_libXt_strcpy);
+ VoidInit(_libXt_strncpy);
+ VoidInit(_libXt_strrchr);
+ VoidInit(_libXt__XtInherit);	/* must be imported */
+ VoidInit(_libXt__XtCXtToolkitError);
+ VoidInit(_libXt__XtGlobalTM);
+ /* VoidInit(_libXt__XtInheritTranslations); */
+ VoidInit(_libXt__XtQString);
+ /*
+ VoidInit(_libXt_XtShellStrings);
+ VoidInit(_libXt_XtStrings);
+ */
+ 
+ /*
+  * Composite.c
+  */
+ VoidInit(_libXt_compositeWidgetClass);
+ 
+ /*
+  * Constraint.c
+  */
+ VoidInit(_libXt_constraintWidgetClass);
+ 
+ /*
+  * Core.c
+  */
+ VoidInit(_libXt_coreWidgetClass);
+ 
+ /*
+  * Object.c
+  */
+ /* objectClass not referenced in .text section of any libXt Source */
+ 
+ /*
+  * RectObj.c
+  */
+ VoidInit(_libXt_rectObjClass);
+ 
+ /*
+  * Shell.c
+  */
+ VoidInit(_libXt_shellWidgetClass);
+ VoidInit(_libXt_overrideShellWidgetClass);
+ VoidInit(_libXt_wmShellWidgetClass);
+ VoidInit(_libXt_transientShellWidgetClass);
+ VoidInit(_libXt_topLevelShellWidgetClass);
+ VoidInit(_libXt_applicationShellWidgetClass);
+ 
+ /*
+  * Vendor.c
+  */
+ VoidInit(_libXt_vendorShellWidgetClass);
+ 
+ 
+ 
+ #ifndef __GNUC__
+ /*
+  * If we are working with floating point aritmetic, stock AT&T cc generates
+  * an unresolved reference to __fltused. But we want to make a shared lib from
+  * this here and don't want to reference /lib/libc_s.a, just define this sym as
+  * (shared lib) static.
+  * The trick is that while building the shared lib all references to this
+  * symbol are resolved internally. But the symbol will be outside only visible
+  * as a static one, so preventing a name conflict with other shared libs.
+  */
+ long __fltused = 0;
+ #endif
+ 
+ /* A dummy function for free branchtab-slots.
+  * This would be a great place for an error-check mechanism for shared libs.
+  * (Print error message if not existent function is called.)
+  */
+ extern void _libXt_dummy() {};
+ 
+ /*
+  * This function is for future versions of the library which could
+  * want initialize pointers to default values, which clients linked with
+  * the old version don't initialize. It's called from inside the
+  * .init section of the clients.
+  */
+ void __default_libXt_init_()
+ {
+ 
+ }
+ 
+ #endif
+ 
+ 
diff -c /dev/null mit/lib/Xt/import.h:2.0
*** /dev/null	Sat Mar 12 00:39:28 1994
--- mit/lib/Xt/import.h	Sat Mar 12 00:39:28 1994
***************
*** 0 ****
--- 1,207 ----
+ /* libXt : import.h
+  * indirection defines
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/Xt/import.h,v 2.0 1993/09/22 15:33:05 dawes Exp $
+  */
+ 
+ #ifndef _libXt_import
+ #define _libXt_import
+ #ifdef SVR3SHLIB
+ 
+ #define _ctype  (*_libXt__ctype)
+ #define _iob  (*_libXt__iob)
+ #define access  (*_libXt_access)
+ #define atof  (*_libXt_atof)
+ #define calloc  (*_libXt_calloc)
+ #define errno  (*_libXt_errno)
+ #define exit  (*_libXt_exit)
+ #define fclose  (*_libXt_fclose)
+ #define fopen  (*_libXt_fopen)
+ #define fprintf  (*_libXt_fprintf)
+ /* prevent name conflict with member free of XFontSetMethods */
+ #define free(ptr) (*_libXt_free)(ptr)
+ #define getenv  (*_libXt_getenv)
+ #define gethostname  (*_libXt_gethostname)
+ #define getpwnam  (*_libXt_getpwnam)
+ #define getpwuid  (*_libXt_getpwuid)
+ #define gettimeofday  (*_libXt_gettimeofday)
+ #define getuid  (*_libXt_getuid)
+ #define malloc  (*_libXt_malloc)
+ #define memset  (*_libXt_memset)
+ #define printf  (*_libXt_printf)
+ #define qsort  (*_libXt_qsort)
+ #define realloc  (*_libXt_realloc)
+ /* prevent name conflict with bitfield select of _XtEventRec */
+ #define select(max, rd, wr, ex, to) (*_libXt_select)(max, rd, wr, ex, to)
+ #define sprintf  (*_libXt_sprintf)
+ /* prevent name conflict with struct stat */
+ #define stat(path, buf) (*_libXt_stat)(path, buf)
+ #define strcat  (*_libXt_strcat)
+ #define strchr  (*_libXt_strchr)
+ #define strcmp  (*_libXt_strcmp)
+ #define strcpy  (*_libXt_strcpy)
+ #define strncpy  (*_libXt_strncpy)
+ #define strrchr  (*_libXt_strrchr)
+ /* #define _XtInherit  (*_libXt__XtInherit)  /* must be imported */
+ #define XtCXtToolkitError  (*_libXt__XtCXtToolkitError)
+ #define _XtGlobalTM  (*_libXt__XtGlobalTM)
+ /* #define _XtInheritTranslations  (*_libXt__XtInheritTranslations) */
+ #define _XtQString  (*_libXt__XtQString)
+ /*
+ #define XtShellStrings  (*_libXt_XtShellStrings)
+ #define XtStrings  (*_libXt_XtStrings)
+ */
+ 
+ /*
+  * Composite.c
+  */
+ #define compositeWidgetClass  (*_libXt_compositeWidgetClass)
+ 
+ /*
+  * Constraint.c
+  */
+ #define constraintWidgetClass  (*_libXt_constraintWidgetClass)
+ 
+ /*
+  * Core.c
+  */
+ #define coreWidgetClass  (*_libXt_coreWidgetClass)
+ 
+ /*
+  * Object.c
+  */
+ 
+ /*
+  * RectObj.c
+  */
+ #define rectObjClass  (*_libXt_rectObjClass)
+ 
+ /*
+  * Shell.c
+  */
+ #define shellWidgetClass  (*_libXt_shellWidgetClass)
+ #define overrideShellWidgetClass  (*_libXt_overrideShellWidgetClass)
+ #define wmShellWidgetClass  (*_libXt_wmShellWidgetClass)
+ #define transientShellWidgetClass  (*_libXt_transientShellWidgetClass)
+ #define topLevelShellWidgetClass  (*_libXt_topLevelShellWidgetClass)
+ #define applicationShellWidgetClass  (*_libXt_applicationShellWidgetClass)
+ 
+ /*
+  * Vendor.c
+  */
+ #define vendorShellWidgetClass  (*_libXt_vendorShellWidgetClass)
+ 
+ 
+ /* Imported functions declarations
+  * Why declaring some imported functions here?
+  * This should be done gracefully through including of the systems
+  * header files. Unfortunatly there are some source files don't
+  * include all headers they should include, there are also some functions
+  * nowhere declared in the systems headers and some are declared
+  * without extern and cause problems since the names are redefined
+  * and these declarations then become undesired false pointer definitions.
+  */
+ 
+ /* This section needs editing! It's only an example for the X libs. */
+ 
+ #ifdef __STDC__
+ extern int creat(char const *, unsigned short);
+ extern void exit(int);
+ #ifndef SCO
+ extern int printf(char const *, ...);
+ extern int sprintf(char *, char const *, ...);
+ extern int sscanf(char *, char const *, ...);
+ #endif
+ extern int atoi(char const *);
+ extern int access(char const *, int);
+ extern unsigned int alarm(unsigned int);
+ extern unsigned int sleep(unsigned int);
+ extern int close(int);
+ extern int read(int, char *, unsigned int);
+ extern int write(int, char const *, unsigned int);
+ extern int grantpt(int);
+ extern char *ptsname(int);
+ extern int unlockpt(int);
+ extern char *getenv(char const *);
+ #else
+ extern int creat();
+ extern void exit();
+ #ifndef SCO
+ extern int printf();
+ extern int sprintf();
+ extern int sscanf();
+ #endif
+ extern int atoi();
+ extern int access();
+ extern unsigned int alarm();
+ extern unsigned int sleep();
+ extern int close();
+ extern int read();
+ extern int write();
+ extern int grantpt();
+ extern char *ptsname();
+ extern int unlockpt();
+ extern char *getenv();
+ #endif
+ 
+ /* use char * also for __STDC__, the sources want it */ 
+ extern char *malloc(), *realloc(), *calloc();
+ 
+ #include <string.h>
+ 
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ 
+ extern void qsort();
+ #ifndef ISC40
+ extern int _flsbuf();
+ extern int _filbuf();
+ #endif
+ extern int ioctl();
+ extern int getmsg();
+ extern int putmsg();
+ 
+ extern unsigned short ntohs(), htons();
+ extern unsigned long ntohl(), htonl();
+ extern unsigned long inet_addr();
+ extern int connect();
+ extern int gethostname();
+ extern int setsockopt();
+ extern int socket();
+ extern int writev();
+ extern int gettimeofday();
+ 
+ #if defined(ISC202) || defined(ATT)
+ extern int (*_libXt_stat)();
+ #endif
+ 
+ /* Functions with ambiguous names */
+ 
+ #ifdef __STDC__
+ extern int close(int);
+ extern void free(void *);
+ #include <sys/time.h>
+ #include <sys/bsdtypes.h>
+ #ifdef SCO
+ #include <sys/types.h>
+ #endif /* SCO */
+ extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+ #else
+ extern int (*_libXt_close)();
+ extern void (*_libXt_free)();
+ extern int (*_libXt_select)();
+ #endif
+ 
+ extern void (*_libXt__XtInherit)(
+ #if NeedFunctionPrototypes
+     void
+ #endif
+ );
+ 
+ #endif
+ #endif
+ 
diff -c /dev/null mit/lib/Xt/jump_funcs:2.0
*** /dev/null	Sat Mar 12 00:39:28 1994
--- mit/lib/Xt/jump_funcs	Sat Mar 12 00:39:29 1994
***************
*** 0 ****
--- 1,585 ----
+ # $XFree86: mit/lib/Xt/jump_funcs,v 2.0 1993/08/23 12:19:39 dawes Exp $
+ #
+ 00000000 T _XtAppAddActionHook  libXt          ActionHook
+ 00000000 T _XtRemoveActionHook  libXt          ActionHook
+ 00000000 T __XtAllocError       libXt          Alloc
+ 00000000 T __XtHeapInit         libXt          Alloc
+ 00000000 T _XtMalloc            libXt          Alloc
+ 00000000 T _XtRealloc           libXt          Alloc
+ 00000000 T _XtCalloc            libXt          Alloc
+ 00000000 T _XtFree              libXt          Alloc
+ 00000000 T __XtHeapAlloc        libXt          Alloc
+ 00000000 T __XtHeapFree         libXt          Alloc
+ 00000000 T _XtMergeArgLists     libXt          ArgList
+ 00000000 T __XtAddCallback      libXt          Callback
+ 00000000 T __XtAddCallbackOnce  libXt          Callback
+ 00000000 T _XtAddCallback       libXt          Callback
+ 00000000 T _XtAddCallbacks      libXt          Callback
+ 00000000 T __XtRemoveCallback   libXt          Callback
+ 00000000 T _XtRemoveCallback    libXt          Callback
+ 00000000 T _XtRemoveCallbacks   libXt          Callback
+ 00000000 T __XtRemoveAllCallbacks libXt          Callback
+ 00000000 T _XtRemoveAllCallbacks libXt          Callback
+ 00000000 T __XtCompileCallbackList libXt          Callback
+ 00000000 T __XtGetCallbackList  libXt          Callback
+ 00000000 T _XtCallCallbacks     libXt          Callback
+ 00000000 T _XtHasCallbacks      libXt          Callback
+ 00000000 T _XtCallCallbackList  libXt          Callback
+ 00000000 T _XtSetMultiClickTime libXt          ClickTime
+ 00000000 T _XtGetMultiClickTime libXt          ClickTime
+ 00000000 T __XtSetDefaultConverterTable libXt          Convert
+ 00000000 T __XtFreeConverterTable libXt          Convert
+ 00000000 T __XtTableAddConverter libXt          Convert
+ 00000000 T _XtSetTypeConverter  libXt          Convert
+ 00000000 T _XtAppSetTypeConverter libXt          Convert
+ 00000000 T _XtAddConverter      libXt          Convert
+ 00000000 T _XtAppAddConverter   libXt          Convert
+ 00000000 T __XtCacheFlushTag    libXt          Convert
+ 00000000 T _XtDirectConvert     libXt          Convert
+ 00000000 T _XtCallConverter     libXt          Convert
+ 00000000 T __XtConvert          libXt          Convert
+ 00000000 T _XtConvert           libXt          Convert
+ 00000000 T _XtConvertAndStore   libXt          Convert
+ 00000000 T _XtAppReleaseCacheRefs libXt          Convert
+ 00000000 T _XtCallbackReleaseCacheRefList libXt          Convert
+ 00000000 T _XtCallbackReleaseCacheRef libXt          Convert
+ 00000000 T __XtConvertInitialize libXt          Converters
+ 00000000 T _XtDisplayStringConversionWarning libXt          Converters
+ 00000000 T _XtStringConversionWarning libXt          Converters
+ 00000000 T _XtCvtIntToBoolean   libXt          Converters
+ 00000000 T _XtCvtIntToShort     libXt          Converters
+ 00000000 T _XtCvtStringToBoolean libXt          Converters
+ 00000000 T _XtCvtIntToBool      libXt          Converters
+ 00000000 T _XtCvtStringToBool   libXt          Converters
+ 00000000 T _XtCvtIntToColor     libXt          Converters
+ 00000000 T _XtCvtStringToPixel  libXt          Converters
+ 00000000 T _XtCvtStringToCursor libXt          Converters
+ 00000000 T _XtCvtStringToDisplay libXt          Converters
+ 00000000 T _XtCvtStringToFile   libXt          Converters
+ 00000000 T _XtCvtIntToFloat     libXt          Converters
+ 00000000 T _XtCvtStringToFloat  libXt          Converters
+ 00000000 T _XtCvtStringToFont   libXt          Converters
+ 00000000 T _XtCvtIntToFont      libXt          Converters
+ 00000000 T _XtCvtStringToFontSet libXt          Converters
+ 00000000 T _XtCvtStringToFontStruct libXt          Converters
+ 00000000 T _XtCvtStringToInt    libXt          Converters
+ 00000000 T _XtCvtStringToShort  libXt          Converters
+ 00000000 T _XtCvtStringToDimension libXt          Converters
+ 00000000 T _XtCvtIntToUnsignedChar libXt          Converters
+ 00000000 T _XtCvtStringToUnsignedChar libXt          Converters
+ 00000000 T _XtCvtColorToPixel   libXt          Converters
+ 00000000 T _XtCvtIntToPixel     libXt          Converters
+ 00000000 T _XtCvtIntToPixmap    libXt          Converters
+ 00000000 T _LowerCase           libXt          Converters
+ 00000000 T _XtCvtStringToInitialState libXt          Converters
+ 00000000 T _XtCvtStringToVisual libXt          Converters
+ 00000000 T _XtCvtStringToAtom   libXt          Converters
+ 00000000 T __XtAddDefaultConverters libXt          Converters
+ 00000000 T _XtInitializeWidgetClass libXt          Create
+ 00000000 T __XtCreateWidget     libXt          Create
+ 00000000 T _XtCreateWidget      libXt          Create
+ 00000000 T _XtCreateManagedWidget libXt          Create
+ 00000000 T __XtCreatePopupShell libXt          Create
+ 00000000 T _XtCreatePopupShell  libXt          Create
+ 00000000 T __XtAppCreateShell   libXt          Create
+ 00000000 T _XtAppCreateShell    libXt          Create
+ 00000000 T _XtCreateApplicationShell libXt          Create
+ 00000000 T __XtDoPhase2Destroy  libXt          Destroy
+ 00000000 T _XtDestroyWidget     libXt          Destroy
+ 00000000 T __XtGetProcessContext libXt          Display
+ 00000000 T __XtDefaultAppContext libXt          Display
+ 00000000 T _XtOpenDisplay       libXt          Display
+ 00000000 T __XtAppInit          libXt          Display
+ 00000000 T _XtDisplayInitialize libXt          Display
+ 00000000 T _XtCreateApplicationContext libXt          Display
+ 00000000 T _XtDestroyApplicationContext libXt          Display
+ 00000000 T __XtDestroyAppContexts libXt          Display
+ 00000000 T _XtDatabase          libXt          Display
+ 00000000 T __XtSortPerDisplayList libXt          Display
+ 00000000 T _XtDisplayToApplicationContext libXt          Display
+ 00000000 T _XtCloseDisplay      libXt          Display
+ 00000000 T __XtCloseDisplays    libXt          Display
+ 00000000 T _XtWidgetToApplicationContext libXt          Display
+ 00000000 T _XtGetApplicationNameAndClass libXt          Display
+ 00000000 T _XtGetErrorDatabase  libXt          Error
+ 00000000 T _XtAppGetErrorDatabase libXt          Error
+ 00000000 T _XtGetErrorDatabaseText libXt          Error
+ 00000000 T _XtAppGetErrorDatabaseText libXt          Error
+ 00000000 T __XtInitErrorHandling libXt          Error
+ 00000000 T __XtDefaultErrorMsg  libXt          Error
+ 00000000 T __XtDefaultWarningMsg libXt          Error
+ 00000000 T _XtErrorMsg          libXt          Error
+ 00000000 T _XtAppErrorMsg       libXt          Error
+ 00000000 T _XtWarningMsg        libXt          Error
+ 00000000 T _XtAppWarningMsg     libXt          Error
+ 00000000 T _XtSetErrorMsgHandler libXt          Error
+ 00000000 T _XtAppSetErrorMsgHandler libXt          Error
+ 00000000 T _XtSetWarningMsgHandler libXt          Error
+ 00000000 T _XtAppSetWarningMsgHandler libXt          Error
+ 00000000 T __XtDefaultError     libXt          Error
+ 00000000 T __XtDefaultWarning   libXt          Error
+ 00000000 T _XtError             libXt          Error
+ 00000000 T _XtAppError          libXt          Error
+ 00000000 T _XtWarning           libXt          Error
+ 00000000 T _XtAppWarning        libXt          Error
+ 00000000 T _XtSetErrorHandler   libXt          Error
+ 00000000 T _XtAppSetErrorHandler libXt          Error
+ 00000000 T _XtSetWarningHandler libXt          Error
+ 00000000 T _XtAppSetWarningHandler libXt          Error
+ 00000000 T __XtSetDefaultErrorHandlers libXt          Error
+ 00000000 T _XtBuildEventMask    libXt          Event
+ 00000000 T _XtRemoveEventHandler libXt          Event
+ 00000000 T _XtAddEventHandler   libXt          Event
+ 00000000 T _XtInsertEventHandler libXt          Event
+ 00000000 T _XtRemoveRawEventHandler libXt          Event
+ 00000000 T _XtInsertRawEventHandler libXt          Event
+ 00000000 T _XtAddRawEventHandler libXt          Event
+ 00000000 T __XtRegisterWindow   libXt          Event
+ 00000000 T __XtUnregisterWindow libXt          Event
+ 00000000 T _XtWindowToWidget    libXt          Event
+ 00000000 T __XtAllocWWTable     libXt          Event
+ 00000000 T __XtFreeWWTable      libXt          Event
+ 00000000 T __XtConvertTypeToMask libXt          Event
+ 00000000 T __XtOnGrabList       libXt          Event
+ 00000000 T _XtDispatchEvent     libXt          Event
+ 00000000 T _XtAddGrab           libXt          Event
+ 00000000 T _XtRemoveGrab        libXt          Event
+ 00000000 T _XtMainLoop          libXt          Event
+ 00000000 T _XtAppMainLoop       libXt          Event
+ 00000000 T __XtEventInitialize  libXt          Event
+ 00000000 T _XtAddExposureToRegion libXt          Event
+ 00000000 T __XtFreeEventTable   libXt          Event
+ 00000000 T _XtLastTimestampProcessed libXt          Event
+ 00000000 T __XtSendFocusEvent   libXt          Event
+ 00000000 T __XtFreePerWidgetInput libXt          EventUtil
+ 00000000 T __XtGetPerWidgetInput libXt          EventUtil
+ 00000000 T __XtFillAncestorList libXt          EventUtil
+ 00000000 T __XtFindRemapWidget  libXt          EventUtil
+ 00000000 T __XtUngrabBadGrabs   libXt          EventUtil
+ 00000000 T _XtIsRectObj         libXt          Functions
+ 00000000 T _XtIsWidget          libXt          Functions
+ 00000000 T _XtIsComposite       libXt          Functions
+ 00000000 T _XtIsConstraint      libXt          Functions
+ 00000000 T _XtIsShell           libXt          Functions
+ 00000000 T _XtIsOverrideShell   libXt          Functions
+ 00000000 T _XtIsWMShell         libXt          Functions
+ 00000000 T _XtIsVendorShell     libXt          Functions
+ 00000000 T _XtIsTransientShell  libXt          Functions
+ 00000000 T _XtIsTopLevelShell   libXt          Functions
+ 00000000 T _XtIsApplicationShell libXt          Functions
+ 00000000 T _XtMapWidget         libXt          Functions
+ 00000000 T _XtUnmapWidget       libXt          Functions
+ 00000000 T _XtNewString         libXt          Functions
+ 00000000 T __XtGClistFree       libXt          GCManager
+ 00000000 T _XtAllocateGC        libXt          GCManager
+ 00000000 T _XtGetGC             libXt          GCManager
+ 00000000 T _XtReleaseGC         libXt          GCManager
+ 00000000 T _XtDestroyGC         libXt          GCManager
+ 00000000 T __XtMakeGeometryRequest libXt          Geometry
+ 00000000 T _XtMakeGeometryRequest libXt          Geometry
+ 00000000 T _XtMakeResizeRequest libXt          Geometry
+ 00000000 T _XtResizeWindow      libXt          Geometry
+ 00000000 T _XtResizeWidget      libXt          Geometry
+ 00000000 T _XtConfigureWidget   libXt          Geometry
+ 00000000 T _XtMoveWidget        libXt          Geometry
+ 00000000 T _XtTranslateCoords   libXt          Geometry
+ 00000000 T _XtQueryGeometry     libXt          Geometry
+ 00000000 T _XtGetActionKeysym   libXt          GetActKey
+ 00000000 T _XtGetResourceList   libXt          GetResList
+ 00000000 T _XtGetConstraintResourceList libXt          GetResList
+ 00000000 T _XtGetValues         libXt          GetValues
+ 00000000 T _XtGetSubvalues      libXt          GetValues
+ 00000000 T __XtInherit          libXt          Initialize
+ 00000000 T _XtToolkitInitialize libXt          Initialize
+ 00000000 T _XtSetLanguageProc   libXt          Initialize
+ 00000000 T _XtScreenDatabase    libXt          Initialize
+ 00000000 T __XtPreparseCommandLine libXt          Initialize
+ 00000000 T __XtDisplayInitialize libXt          Initialize
+ 00000000 T _XtAppSetFallbackResources libXt          Initialize
+ 00000000 T _XtAppInitialize     libXt          Initialize
+ 00000000 T _XtInitialize        libXt          Initialize
+ 00000000 T _XtIsSubclass        libXt          Intrinsic
+ 00000000 T __XtCheckSubclassFlag libXt          Intrinsic
+ 00000000 T __XtIsSubclassOf     libXt          Intrinsic
+ 00000000 T _XtRealizeWidget     libXt          Intrinsic
+ 00000000 T _XtUnrealizeWidget   libXt          Intrinsic
+ 00000000 T _XtCreateWindow      libXt          Intrinsic
+ 00000000 T _XtNameToWidget      libXt          Intrinsic
+ 00000000 T _XtDisplayOfObject   libXt          Intrinsic
+ 00000000 T _XtDisplay           libXt          Intrinsic
+ 00000000 T _XtScreenOfObject    libXt          Intrinsic
+ 00000000 T _XtScreen            libXt          Intrinsic
+ 00000000 T _XtWindowOfObject    libXt          Intrinsic
+ 00000000 T _XtWindow            libXt          Intrinsic
+ 00000000 T _XtSuperclass        libXt          Intrinsic
+ 00000000 T _XtClass             libXt          Intrinsic
+ 00000000 T _XtIsManaged         libXt          Intrinsic
+ 00000000 T _XtIsRealized        libXt          Intrinsic
+ 00000000 T _XtIsSensitive       libXt          Intrinsic
+ 00000000 T __XtWindowedAncestor libXt          Intrinsic
+ 00000000 T _XtParent            libXt          Intrinsic
+ 00000000 T _XtName              libXt          Intrinsic
+ 00000000 T _XtIsObject          libXt          Intrinsic
+ 00000000 T _XtFindFile          libXt          Intrinsic
+ 00000000 T _XtResolvePathname   libXt          Intrinsic
+ 00000000 T _XtCallAcceptFocus   libXt          Intrinsic
+ 00000000 T __XtProcessKeyboardEvent libXt          Keyboard
+ 00000000 T __XtHandleFocus      libXt          Keyboard
+ 00000000 T _XtSetKeyboardFocus  libXt          Keyboard
+ 00000000 T _XtUnmanageChildren  libXt          Manage
+ 00000000 T _XtUnmanageChild     libXt          Manage
+ 00000000 T _XtManageChildren    libXt          Manage
+ 00000000 T _XtManageChild       libXt          Manage
+ 00000000 T _XtSetMappedWhenManaged libXt          Manage
+ 00000000 T __XtwaitForSomething libXt          NextEvent
+ 00000000 T _XtAddTimeOut        libXt          NextEvent
+ 00000000 T _XtAppAddTimeOut     libXt          NextEvent
+ 00000000 T _XtRemoveTimeOut     libXt          NextEvent
+ 00000000 T _XtAddWorkProc       libXt          NextEvent
+ 00000000 T _XtAppAddWorkProc    libXt          NextEvent
+ 00000000 T _XtRemoveWorkProc    libXt          NextEvent
+ 00000000 T _XtAddInput          libXt          NextEvent
+ 00000000 T _XtAppAddInput       libXt          NextEvent
+ 00000000 T _XtRemoveInput       libXt          NextEvent
+ 00000000 T __XtRemoveAllInputs  libXt          NextEvent
+ 00000000 T _XtNextEvent         libXt          NextEvent
+ 00000000 T __XtRefreshMapping   libXt          NextEvent
+ 00000000 T _XtAppNextEvent      libXt          NextEvent
+ 00000000 T _XtProcessEvent      libXt          NextEvent
+ 00000000 T _XtAppProcessEvent   libXt          NextEvent
+ 00000000 T _XtPending           libXt          NextEvent
+ 00000000 T _XtAppPending        libXt          NextEvent
+ 00000000 T _XtPeekEvent         libXt          NextEvent
+ 00000000 T _XtAppPeekEvent      libXt          NextEvent
+ 00000000 T __XtDestroyServerGrabs libXt          PassivGrab
+ 00000000 T __XtCheckServerGrabsOnWidget libXt          PassivGrab
+ 00000000 T _XtGrabKey           libXt          PassivGrab
+ 00000000 T _XtGrabButton        libXt          PassivGrab
+ 00000000 T _XtUngrabKey         libXt          PassivGrab
+ 00000000 T _XtUngrabButton      libXt          PassivGrab
+ 00000000 T _XtGrabKeyboard      libXt          PassivGrab
+ 00000000 T _XtUngrabKeyboard    libXt          PassivGrab
+ 00000000 T _XtGrabPointer       libXt          PassivGrab
+ 00000000 T _XtUngrabPointer     libXt          PassivGrab
+ 00000000 T __XtProcessPointerEvent libXt          Pointer
+ 00000000 T __XtPopup            libXt          Popup
+ 00000000 T _XtPopup             libXt          Popup
+ 00000000 T _XtPopupSpringLoaded libXt          Popup
+ 00000000 T _XtPopdown           libXt          Popup
+ 00000000 T _XtCallbackPopdown   libXt          Popup
+ 00000000 T _XtCallbackNone      libXt          PopupCB
+ 00000000 T _XtCallbackNonexclusive libXt          PopupCB
+ 00000000 T _XtCallbackExclusive libXt          PopupCB
+ 00000000 T __XtCopyFromParent   libXt          Resources
+ 00000000 T __XtCopyFromArg      libXt          Resources
+ 00000000 T __XtCopyToArg        libXt          Resources
+ 00000000 T __XtCompileResourceList libXt          Resources
+ 00000000 T __XtDependencies     libXt          Resources
+ 00000000 T __XtResourceDependencies libXt          Resources
+ 00000000 T __XtConstraintResDependencies libXt          Resources
+ 00000000 T __XtCreateIndirectionTable libXt          Resources
+ 00000000 T __XtGetResources     libXt          Resources
+ 00000000 T _XtGetSubresources   libXt          Resources
+ 00000000 T _XtGetApplicationResources libXt          Resources
+ 00000000 T __XtResourceListInitialize libXt          Resources
+ 00000000 T __XtSetDefaultSelectionTimeout libXt          Selection
+ 00000000 T _XtSetSelectionTimeout libXt          Selection
+ 00000000 T _XtAppSetSelectionTimeout libXt          Selection
+ 00000000 T _XtGetSelectionTimeout libXt          Selection
+ 00000000 T _XtAppGetSelectionTimeout libXt          Selection
+ 00000000 T _XtOwnSelection      libXt          Selection
+ 00000000 T _XtOwnSelectionIncremental libXt          Selection
+ 00000000 T _XtDisownSelection   libXt          Selection
+ 00000000 T _XtGetSelectionValue libXt          Selection
+ 00000000 T _XtGetSelectionValueIncremental libXt          Selection
+ 00000000 T _XtGetSelectionValues libXt          Selection
+ 00000000 T _XtGetSelectionValuesIncremental libXt          Selection
+ 00000000 T _XtGetSelectionRequest libXt          Selection
+ 00000000 T _XtSetSensitive      libXt          SetSens
+ 00000000 T _XtSetSubvalues      libXt          SetValues
+ 00000000 T _XtSetValues         libXt          SetValues
+ 00000000 T _XtSetWMColormapWindows libXt          SetWMCW
+ 00000000 T __XtShellGetCoordinates libXt          Shell
+ 00000000 T __XtInitializeActionData libXt          TMaction
+ 00000000 T __XtBindActions      libXt          TMaction
+ 00000000 T __XtUnbindActions    libXt          TMaction
+ 00000000 T __XtFreeActions      libXt          TMaction
+ 00000000 T _XtAddActions        libXt          TMaction
+ 00000000 T _XtAppAddActions     libXt          TMaction
+ 00000000 T _XtGetActionList     libXt          TMaction
+ 00000000 T _XtMenuPopupAction   libXt          TMaction
+ 00000000 T __XtActionInitialize libXt          TMaction
+ 00000000 T _XtCallActionProc    libXt          TMaction
+ 00000000 T __XtRegisterGrabs    libXt          TMgrab
+ 00000000 T _XtRegisterGrabAction libXt          TMgrab
+ 00000000 T __XtGrabInitialize   libXt          TMgrab
+ 00000000 T __XtComputeLateBindings libXt          TMkey
+ 00000000 T __XtAllocTMContext   libXt          TMkey
+ 00000000 T __XtMatchUsingDontCareMods libXt          TMkey
+ 00000000 T _XtConvertCase       libXt          TMkey
+ 00000000 T __XtMatchUsingStandardMods libXt          TMkey
+ 00000000 T __XtBuildKeysymTables libXt          TMkey
+ 00000000 T _XtTranslateKeycode  libXt          TMkey
+ 00000000 T _XtTranslateKey      libXt          TMkey
+ 00000000 T _XtSetKeyTranslator  libXt          TMkey
+ 00000000 T _XtRegisterCaseConverter libXt          TMkey
+ 00000000 T _XtGetKeysymTable    libXt          TMkey
+ 00000000 T _XtKeysymToKeycodeList libXt          TMkey
+ 00000000 T _XtCvtStringToAcceleratorTable libXt          TMparse
+ 00000000 T _XtCvtStringToTranslationTable libXt          TMparse
+ 00000000 T _XtParseAcceleratorTable libXt          TMparse
+ 00000000 T _XtParseTranslationTable libXt          TMparse
+ 00000000 T __XtTranslateInitialize libXt          TMparse
+ 00000000 T __XtAddTMConverters  libXt          TMparse
+ 00000000 T __XtPrintXlations    libXt          TMprint
+ 00000000 T __XtDisplayTranslations libXt          TMprint
+ 00000000 T __XtDisplayAccelerators libXt          TMprint
+ 00000000 T __XtDisplayInstalledAccelerators libXt          TMprint
+ 00000000 T __XtPrintActions     libXt          TMprint
+ 00000000 T __XtPrintState       libXt          TMprint
+ 00000000 T __XtPrintEventSeq    libXt          TMprint
+ 00000000 T __XtGetQuarkIndex    libXt          TMstate
+ 00000000 T __XtGetTypeIndex     libXt          TMstate
+ 00000000 T __XtGetModifierIndex libXt          TMstate
+ 00000000 T __XtRegularMatch     libXt          TMstate
+ 00000000 T __XtMatchAtom        libXt          TMstate
+ 00000000 T __XtTranslateEvent   libXt          TMstate
+ 00000000 T __XtTraverseStateTree libXt          TMstate
+ 00000000 T __XtInstallTranslations libXt          TMstate
+ 00000000 T __XtRemoveTranslations libXt          TMstate
+ 00000000 T __XtDestroyTMData    libXt          TMstate
+ 00000000 T _XtUninstallTranslations libXt          TMstate
+ 00000000 T __XtCreateXlations   libXt          TMstate
+ 00000000 T __XtParseTreeToStateTree libXt          TMstate
+ 00000000 T __XtAddEventSeqToStateTree libXt          TMstate
+ 00000000 T __XtCvtMergeTranslations libXt          TMstate
+ 00000000 T __XtGetTranslationValue libXt          TMstate
+ 00000000 T __XtRemoveStateTreeByIndex libXt          TMstate
+ 00000000 T __XtFreeTranslations libXt          TMstate
+ 00000000 T _XtInstallAccelerators libXt          TMstate
+ 00000000 T _XtInstallAllAccelerators libXt          TMstate
+ 00000000 T _XtAugmentTranslations libXt          TMstate
+ 00000000 T _XtOverrideTranslations libXt          TMstate
+ 00000000 T __XtMergeTranslations libXt          TMstate
+ 00000000 T __XtUnmergeTranslations libXt          TMstate
+ 00000000 T __XtPopupInitialize  libXt          TMstate
+ 00000000 T _XtVaCreateWidget    libXt          VarCreate
+ 00000000 T _XtVaCreateManagedWidget libXt          VarCreate
+ 00000000 T _XtVaAppCreateShell  libXt          VarCreate
+ 00000000 T _XtVaCreatePopupShell libXt          VarCreate
+ 00000000 T _XtVaSetValues       libXt          VarCreate
+ 00000000 T _XtVaSetSubvalues    libXt          VarCreate
+ 00000000 T __XtVaAppInitialize  libXt          VarCreate
+ 00000000 T _XtVaAppInitialize   libXt          VarCreate
+ 00000000 T _XtVaGetSubresources libXt          VarGet
+ 00000000 T _XtVaGetApplicationResources libXt          VarGet
+ 00000000 T _XtVaGetValues       libXt          VarGet
+ 00000000 T _XtVaGetSubvalues    libXt          VarGet
+ 00000000 T __XtCountVaList      libXt          Varargs
+ 00000000 T _XtVaCreateArgsList  libXt          Varargs
+ 00000000 T __XtVaCreateTypedArgList libXt          Varargs
+ 00000000 T __XtVaToArgList      libXt          Varargs
+ 00000000 T __XtVaToTypedArgList libXt          Varargs
+ 00000000 T _XmuAllStandardColormaps libXmu         AllCmap
+ 00000000 T _XmuMakeAtom         libXmu         Atoms
+ 00000000 T _XmuNameOfAtom       libXmu         Atoms
+ 00000000 T _XmuInternAtom       libXmu         Atoms
+ 00000000 T _XmuGetAtomName      libXmu         Atoms
+ 00000000 T _XmuInternStrings    libXmu         Atoms
+ 00000000 T _XmuClientWindow     libXmu         ClientWin
+ 00000000 T _XmuAddCloseDisplayHook libXmu         CloseHook
+ 00000000 T _XmuRemoveCloseDisplayHook libXmu         CloseHook
+ 00000000 T _XmuLookupCloseDisplayHook libXmu         CloseHook
+ 00000000 T _XmuGetColormapAllocation libXmu         CmapAlloc
+ 00000000 T _XmuCreateColormap   libXmu         CrCmap
+ 00000000 T _XmuCreatePixmapFromBitmap libXmu         CrPixFBit
+ 00000000 T _XmuCursorNameToIndex libXmu         CursorName
+ 00000000 T __XmuCCLookupDisplay libXmu         CvtCache
+ 00000000 T _XmuConvertStandardSelection libXmu         CvtStdSel
+ 00000000 T _XmuPrintDefaultErrorMessage libXmu         DefErrMsg
+ 00000000 T _XmuSimpleErrorHandler libXmu         DefErrMsg
+ 00000000 T _XmuDeleteStandardColormap libXmu         DelCmap
+ 00000000 T _XmuDQCreate         libXmu         DisplayQue
+ 00000000 T _XmuDQDestroy        libXmu         DisplayQue
+ 00000000 T _XmuDQLookupDisplay  libXmu         DisplayQue
+ 00000000 T _XmuDQAddDisplay     libXmu         DisplayQue
+ 00000000 T _XmuDQRemoveDisplay  libXmu         DisplayQue
+ 00000000 T _XmuDistinguishableColors libXmu         Distinct
+ 00000000 T _XmuDistinguishablePixels libXmu         Distinct
+ 00000000 T _XmuDrawLogo         libXmu         DrawLogo
+ 00000000 T _XmuDrawRoundedRectangle libXmu         DrRndRect
+ 00000000 T _XmuFillRoundedRectangle libXmu         DrRndRect
+ 00000000 T __XEditResCheckMessages libXmu         EditresCom
+ 00000000 T __XEditResPutString8 libXmu         EditresCom
+ 00000000 T __XEditResPut8       libXmu         EditresCom
+ 00000000 T __XEditResPut16      libXmu         EditresCom
+ 00000000 T __XEditResPut32      libXmu         EditresCom
+ 00000000 T __XEditResPutWidgetInfo libXmu         EditresCom
+ 00000000 T __XEditResResetStream libXmu         EditresCom
+ 00000000 T __XEditResGet8       libXmu         EditresCom
+ 00000000 T __XEditResGet16      libXmu         EditresCom
+ 00000000 T __XEditResGetSigned16 libXmu         EditresCom
+ 00000000 T __XEditResGet32      libXmu         EditresCom
+ 00000000 T __XEditResGetString8 libXmu         EditresCom
+ 00000000 T __XEditResGetWidgetInfo libXmu         EditresCom
+ 00000000 T _XmuCvtFunctionToCallback libXmu         FToCback
+ 00000000 T _XmuGetHostname      libXmu         GetHost
+ 00000000 T _XmuCreateStippledPixmap libXmu         GrayPixmap
+ 00000000 T _XmuReleaseStippledPixmap libXmu         GrayPixmap
+ 00000000 T _XmuAddInitializer   libXmu         Initer
+ 00000000 T _XmuCallInitializers libXmu         Initer
+ 00000000 T _XmuLocateBitmapFile libXmu         LocBitmap
+ 00000000 T _XmuLocatePixmapFile libXmu         LocBitmap
+ 00000000 T __XmuStringToBitmapInitCache libXmu         LocBitmap
+ 00000000 T __XmuStringToBitmapFreeCache libXmu         LocBitmap
+ 00000000 T _XmuLookupString     libXmu         Lookup
+ 00000000 T _XmuLookupLatin1     libXmu         Lookup
+ 00000000 T _XmuLookupLatin2     libXmu         Lookup
+ 00000000 T _XmuLookupLatin3     libXmu         Lookup
+ 00000000 T _XmuLookupLatin4     libXmu         Lookup
+ 00000000 T _XmuLookupKana       libXmu         Lookup
+ 00000000 T _XmuLookupJISX0201   libXmu         Lookup
+ 00000000 T _XmuLookupArabic     libXmu         Lookup
+ 00000000 T _XmuLookupCyrillic   libXmu         Lookup
+ 00000000 T _XmuLookupGreek      libXmu         Lookup
+ 00000000 T _XmuLookupAPL        libXmu         Lookup
+ 00000000 T _XmuLookupHebrew     libXmu         Lookup
+ 00000000 T _XmuLookupStandardColormap libXmu         LookupCmap
+ 00000000 T _XmuCopyISOLatin1Lowered libXmu         Lower
+ 00000000 T _XmuCopyISOLatin1Uppered libXmu         Lower
+ 00000000 T _XmuCompareISOLatin1 libXmu         Lower
+ 00000000 T _XmuReadBitmapData   libXmu         RdBitF
+ 00000000 T _XmuReadBitmapDataFromFile libXmu         RdBitF
+ 00000000 T _XmuScreenOfWindow   libXmu         ScrOfWin
+ 00000000 T _XmuReshapeWidget    libXmu         ShapeWidg
+ 00000000 T _XmuStandardColormap libXmu         StdCmap
+ 00000000 T _XmuCvtStringToBackingStore libXmu         StrToBS
+ 00000000 T _XmuCvtStringToBitmap libXmu         StrToBmap
+ 00000000 T _XmuCvtStringToCursor libXmu         StrToCurs
+ 00000000 T _XmuCvtStringToColorCursor libXmu         StrToCurs
+ 00000000 T _XmuCvtStringToGravity libXmu         StrToGrav
+ 00000000 T _XmuCvtStringToJustify libXmu         StrToJust
+ 00000000 T _XmuCvtStringToLong  libXmu         StrToLong
+ 00000000 T _XmuCvtStringToOrientation libXmu         StrToOrnt
+ 00000000 T _XmuCvtStringToShapeStyle libXmu         StrToShap
+ 00000000 T _XmuCvtStringToWidget libXmu         StrToWidg
+ 00000000 T _XmuNewCvtStringToWidget libXmu         StrToWidg
+ 00000000 T _XmuUpdateMapHints   libXmu         UpdMapHint
+ 00000000 T _XmuVisualStandardColormaps libXmu         VisCmap
+ 00000000 T _XmuWnInitializeNodes libXmu         WidgetNode
+ 00000000 T _XmuWnFetchResources libXmu         WidgetNode
+ 00000000 T _XmuWnCountOwnedResources libXmu         WidgetNode
+ 00000000 T _XmuWnNameToNode     libXmu         WidgetNode
+ 00000000 T _XctCreate           libXmu         Xct
+ 00000000 T _XctReset            libXmu         Xct
+ 00000000 T _XctNextItem         libXmu         Xct
+ 00000000 T _XctFree             libXmu         Xct
+ 00000000 T _XextCreateExtension libXext        extutil
+ 00000000 T _XextDestroyExtension libXext        extutil
+ 00000000 T _XextAddDisplay      libXext        extutil
+ 00000000 T _XextRemoveDisplay   libXext        extutil
+ 00000000 T _XextFindDisplay     libXext        extutil
+ 00000000 T _XSetExtensionErrorHandler libXext        extutil
+ 00000000 T _XMissingExtension   libXext        extutil
+ 00000000 T _XmbufQueryExtension libXext        XMultibuf
+ 00000000 T _XmbufGetVersion     libXext        XMultibuf
+ 00000000 T _XmbufCreateBuffers  libXext        XMultibuf
+ 00000000 T _XmbufDestroyBuffers libXext        XMultibuf
+ 00000000 T _XmbufDisplayBuffers libXext        XMultibuf
+ 00000000 T _XmbufGetWindowAttributes libXext        XMultibuf
+ 00000000 T _XmbufChangeWindowAttributes libXext        XMultibuf
+ 00000000 T _XmbufGetBufferAttributes libXext        XMultibuf
+ 00000000 T _XmbufChangeBufferAttributes libXext        XMultibuf
+ 00000000 T _XmbufGetScreenInfo  libXext        XMultibuf
+ 00000000 T _XmbufCreateStereoWindow libXext        XMultibuf
+ 00000000 T _XShapeQueryExtension libXext        XShape
+ 00000000 T _XShapeQueryVersion  libXext        XShape
+ 00000000 T _XShapeCombineRegion libXext        XShape
+ 00000000 T _XShapeCombineRectangles libXext        XShape
+ 00000000 T _XShapeCombineMask   libXext        XShape
+ 00000000 T _XShapeCombineShape  libXext        XShape
+ 00000000 T _XShapeOffsetShape   libXext        XShape
+ 00000000 T _XShapeQueryExtents  libXext        XShape
+ 00000000 T _XShapeSelectInput   libXext        XShape
+ 00000000 T _XShapeInputSelected libXext        XShape
+ 00000000 T _XShapeGetRectangles libXext        XShape
+ 00000000 T _XMITMiscQueryExtension libXext        MITMisc
+ 00000000 T _XMITMiscSetBugMode  libXext        MITMisc
+ 00000000 T _XMITMiscGetBugMode  libXext        MITMisc
+ 00000000 T _XTestFakeInput      libXext        XTestExt1
+ 00000000 T _XTestGetInput       libXext        XTestExt1
+ 00000000 T _XTestStopInput      libXext        XTestExt1
+ 00000000 T _XTestReset          libXext        XTestExt1
+ 00000000 T _XTestQueryInputSize libXext        XTestExt1
+ 00000000 T _XTestPressKey       libXext        XTestExt1
+ 00000000 T _XTestPressButton    libXext        XTestExt1
+ 00000000 T _XTestMovePointer    libXext        XTestExt1
+ 00000000 T _XTestFlush          libXext        XTestExt1
+ 00000000 T _XAllowDeviceEvents  libXi          XAllowDv
+ 00000000 T _XChangeDeviceControl libXi          XChgDCtl
+ 00000000 T _XChangeFeedbackControl libXi          XChgFCtl
+ 00000000 T _XChangeKeyboardDevice libXi          XChgKbd
+ 00000000 T _XChangeDeviceKeyMapping libXi          XChgKMap
+ 00000000 T _XChangePointerDevice libXi          XChgPnt
+ 00000000 T _XChangeDeviceDontPropagateList libXi          XChgProp
+ 00000000 T _XCloseDevice        libXi          XCloseDev
+ 00000000 T _XDeviceBell         libXi          XDevBell
+ 00000000 T _XInputEventToWire   libXi          XExtToWire
+ 00000000 T _XGetDeviceButtonMapping libXi          XGetBMap
+ 00000000 T _XGetDeviceControl   libXi          XGetDCtl
+ 00000000 T _XFreeDeviceControl  libXi          XGetDCtl
+ 00000000 T _XGetFeedbackControl libXi          XGetFCtl
+ 00000000 T _XFreeFeedbackList   libXi          XGetFCtl
+ 00000000 T _XGetDeviceKeyMapping libXi          XGetKMap
+ 00000000 T _XGetDeviceModifierMapping libXi          XGetMMap
+ 00000000 T _XGetDeviceDontPropagateList libXi          XGetProp
+ 00000000 T _XGetExtensionVersion libXi          XGetVers
+ 00000000 T _XGetDeviceMotionEvents libXi          XGMotion
+ 00000000 T _XFreeDeviceMotionEvents libXi          XGMotion
+ 00000000 T _XGrabDevice         libXi          XGrabDev
+ 00000000 T _XGrabDeviceButton   libXi          XGrDvBut
+ 00000000 T _XGrabDeviceKey      libXi          XGrDvKey
+ 00000000 T _XGetDeviceFocus     libXi          XGtFocus
+ 00000000 T _XGetSelectedExtensionEvents libXi          XGtSelect
+ 00000000 T _XListInputDevices   libXi          XListDev
+ 00000000 T _XFreeDeviceList     libXi          XListDev
+ 00000000 T _XOpenDevice         libXi          XOpenDev
+ 00000000 T _XQueryDeviceState   libXi          XQueryDv
+ 00000000 T _XFreeDeviceState    libXi          XQueryDv
+ 00000000 T _XSelectExtensionEvent libXi          XSelect
+ 00000000 T _XSetDeviceButtonMapping libXi          XSetBMap
+ 00000000 T _XSetDeviceValuators libXi          XSetDVal
+ 00000000 T _XSetDeviceModifierMapping libXi          XSetMMap
+ 00000000 T _XSetDeviceMode      libXi          XSetMode
+ 00000000 T _XSendExtensionEvent libXi          XSndExEv
+ 00000000 T _XSetDeviceFocus     libXi          XStFocus
+ 00000000 T _XUngrabDevice       libXi          XUngrDev
+ 00000000 T _XUngrabDeviceButton libXi          XUngrDvB
+ 00000000 T _XUngrabDeviceKey    libXi          XUngrDvK
+ 00000000 T _XInput_find_display libXi          XExtInt
+ 00000000 T __xibaddevice        libXi          XExtInt
+ 00000000 T __xibadclass         libXi          XExtInt
+ 00000000 T __xibadevent         libXi          XExtInt
+ 00000000 T __xibadmode          libXi          XExtInt
+ 00000000 T __xidevicebusy       libXi          XExtInt
+ 00000000 T _CheckExtInit        libXi          XExtInt
+ 00000000 T _XTestQueryExtension libXtst        XTest
+ 00000000 T _XTestCompareCursorWithWindow libXtst        XTest
+ 00000000 T _XTestCompareCurrentCursorWithWindow libXtst        XTest
+ 00000000 T _XTestFakeKeyEvent   libXtst        XTest
+ 00000000 T _XTestFakeButtonEvent libXtst        XTest
+ 00000000 T _XTestFakeMotionEvent libXtst        XTest
+ 00000000 T _XTestFakeRelativeMotionEvent libXtst        XTest
+ 00000000 T _XTestSetGContextOfGC libXtst        XTest
+ 00000000 T _XTestSetVisualIDOfVisual libXtst        XTest
+ 00000000 T _XTestDiscard        libXtst        XTest
+ 00000000 T _XShmQueryExtension  libXext        XShm
+ 00000000 T _XShmGetEventBase    libXext        XShm
+ 00000000 T _XShmQueryVersion    libXext        XShm
+ 00000000 T _XShmPixmapFormat    libXext        XShm
+ 00000000 T _XShmAttach          libXext        XShm
+ 00000000 T _XShmDetach          libXext        XShm
+ 00000000 T _XShmCreateImage     libXext        XShm
+ 00000000 T _XShmPutImage        libXext        XShm
+ 00000000 T _XShmGetImage        libXext        XShm
+ 00000000 T _XShmCreatePixmap    libXext        XShm
diff -c /dev/null mit/lib/Xt/jump_ignore:1.1
*** /dev/null	Sat Mar 12 00:39:30 1994
--- mit/lib/Xt/jump_ignore	Sat Mar 12 00:39:30 1994
***************
*** 0 ****
--- 1 ----
+ # $XFree86: mit/lib/Xt/jump_ignore,v 1.1 1993/04/17 02:44:36 dawes Exp $
diff -c /dev/null mit/lib/Xt/jump_vars:1.1
*** /dev/null	Sat Mar 12 00:39:30 1994
--- mit/lib/Xt/jump_vars	Sat Mar 12 00:39:30 1994
***************
*** 0 ****
--- 1,64 ----
+ # $XFree86: mit/lib/Xt/jump_vars,v 1.1 1993/04/16 14:21:14 dawes Exp $
+ #
+ 00000100 D _compositeClassRec   libXt          Composite
+ 00000004 D _compositeWidgetClass libXt          Composite
+ 00000140 D _constraintClassRec  libXt          Constraint
+ 00000004 D _constraintWidgetClass libXt          Constraint
+ 00000040 D _colorConvertArgs    libXt          Converters
+ 00000020 D _screenConvertArg    libXt          Converters
+ 00000004 D __XtQString          libXt          Converters
+ 00000004 D __XtInheritTranslations libXt          Core
+ 00000100 D _widgetClassRec      libXt          Core
+ 00000004 D _widgetClass         libXt          Core
+ 00000004 D _coreWidgetClass     libXt          Core
+ 00000004 D __XtAppDestroyCount  libXt          Display
+ 00000004 D __XtperDisplayList   libXt          Display
+ 00000004 D __XtDpyDestroyCount  libXt          Display
+ 00000004 D _XtCXtToolkitError   libXt          Intrinsic
+ 00000100 D _objectClassRec      libXt          Object
+ 00000004 D _objectClass         libXt          Object
+ 00000100 D _rectObjClassRec     libXt          RectObj
+ 00000004 D _rectObjClass        libXt          RectObj
+ 00000100 D _shellClassRec       libXt          Shell
+ 00000004 D _shellWidgetClass    libXt          Shell
+ 00000100 D _overrideShellClassRec libXt          Shell
+ 00000004 D _overrideShellWidgetClass libXt          Shell
+ 00000100 D _wmShellClassRec     libXt          Shell
+ 00000004 D _wmShellWidgetClass  libXt          Shell
+ 00000100 D _transientShellClassRec libXt          Shell
+ 00000004 D _transientShellWidgetClass libXt          Shell
+ 00000100 D _topLevelShellClassRec libXt          Shell
+ 00000004 D _topLevelShellWidgetClass libXt          Shell
+ 00000100 D _applicationShellClassRec libXt          Shell
+ 00000004 D _applicationShellWidgetClass libXt          Shell
+ 00001000 D _XtStrings           libXt          StringDefs
+ 00000800 D _XtShellStrings      libXt          StringDefs
+ 00000040 D __XtGlobalTM         libXt          TMstate
+ 00000100 D _vendorShellClassRec libXt          Vendor
+ 00000004 D _vendorShellWidgetClass libXt          Vendor
+ 00000004 D __XA_ATOM_PAIR       libXmu         Atoms
+ 00000004 D __XA_CHARACTER_POSITION libXmu         Atoms
+ 00000004 D __XA_CLASS           libXmu         Atoms
+ 00000004 D __XA_CLIENT_WINDOW   libXmu         Atoms
+ 00000004 D __XA_CLIPBOARD       libXmu         Atoms
+ 00000004 D __XA_COMPOUND_TEXT   libXmu         Atoms
+ 00000004 D __XA_DECNET_ADDRESS  libXmu         Atoms
+ 00000004 D __XA_DELETE          libXmu         Atoms
+ 00000004 D __XA_FILENAME        libXmu         Atoms
+ 00000004 D __XA_HOSTNAME        libXmu         Atoms
+ 00000004 D __XA_IP_ADDRESS      libXmu         Atoms
+ 00000004 D __XA_LENGTH          libXmu         Atoms
+ 00000004 D __XA_LIST_LENGTH     libXmu         Atoms
+ 00000004 D __XA_NAME            libXmu         Atoms
+ 00000004 D __XA_NET_ADDRESS     libXmu         Atoms
+ 00000004 D __XA_NULL            libXmu         Atoms
+ 00000004 D __XA_OWNER_OS        libXmu         Atoms
+ 00000004 D __XA_SPAN            libXmu         Atoms
+ 00000004 D __XA_TARGETS         libXmu         Atoms
+ 00000004 D __XA_TEXT            libXmu         Atoms
+ 00000004 D __XA_TIMESTAMP       libXmu         Atoms
+ 00000004 D __XA_USER            libXmu         Atoms
+ 00000004 D __XExtensionErrorFunction libXext        globals
+ 00000004 D _XTestInputActionType libXext        XTestExt1
+ 00000004 D _XTestFakeAckType    libXext        XTestExt1
+ 00000060 D _versions            libXi          XExtInt
diff -c /dev/null mit/lib/Xt/libXt.def:1.3
*** /dev/null	Sat Mar 12 00:39:30 1994
--- mit/lib/Xt/libXt.def	Sat Mar 12 00:39:33 1994
***************
*** 0 ****
--- 1,587 ----
+ /* libXt : libXt.def
+  * shared library description file
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/lib/Xt/libXt.def,v 1.3 1993/03/20 03:40:57 dawes Exp $
+  */
+ 
+ /**/#address .text 0xB0800000
+ /**/#address .data 0xB0C00000
+ 
+ 
+ /**/#objects noload
+ ../X/libX11_s.a
+ 
+ /**/#branch
+ LowerCase 1
+ XtAddActions 2
+ XtAddCallback 3
+ XtAddCallbacks 4
+ XtAddConverter 5
+ XtAddEventHandler 6
+ XtAddExposureToRegion 7
+ XtAddGrab 8
+ XtAddInput 9
+ XtAddRawEventHandler 10
+ XtAddTimeOut 11
+ XtAddWorkProc 12
+ XtAllocateGC 13
+ XtAppAddActionHook 14
+ XtAppAddActions 15
+ XtAppAddConverter 16
+ XtAppAddInput 17
+ XtAppAddTimeOut 18
+ XtAppAddWorkProc 19
+ XtAppCreateShell 20
+ XtAppError 21
+ XtAppErrorMsg 22
+ XtAppGetErrorDatabase 23
+ XtAppGetErrorDatabaseText 24
+ XtAppGetSelectionTimeout 25
+ XtAppInitialize 26
+ XtAppMainLoop 27
+ XtAppNextEvent 28
+ XtAppPeekEvent 29
+ XtAppPending 30
+ XtAppProcessEvent 31
+ XtAppReleaseCacheRefs 32
+ XtAppSetErrorHandler 33
+ XtAppSetErrorMsgHandler 34
+ XtAppSetFallbackResources 35
+ XtAppSetSelectionTimeout 36
+ XtAppSetTypeConverter 37
+ XtAppSetWarningHandler 38
+ XtAppSetWarningMsgHandler 39
+ XtAppWarning 40
+ XtAppWarningMsg 41
+ XtAugmentTranslations 42
+ XtBuildEventMask 43
+ XtCallAcceptFocus 44
+ XtCallActionProc 45
+ XtCallCallbackList 46
+ XtCallCallbacks 47
+ XtCallConverter 48
+ XtCallbackExclusive 49
+ XtCallbackNone 50
+ XtCallbackNonexclusive 51
+ XtCallbackPopdown 52
+ XtCallbackReleaseCacheRef 53
+ XtCallbackReleaseCacheRefList 54
+ XtCalloc 55
+ XtClass 56
+ XtCloseDisplay 57
+ XtConfigureWidget 58
+ XtConvert 59
+ XtConvertAndStore 60
+ XtConvertCase 61
+ XtCreateApplicationContext 62
+ XtCreateApplicationShell 63
+ XtCreateManagedWidget 64
+ XtCreatePopupShell 65
+ XtCreateWidget 66
+ XtCreateWindow 67
+ XtCvtColorToPixel 68
+ XtCvtIntToBool 69
+ XtCvtIntToBoolean 70
+ XtCvtIntToColor 71
+ XtCvtIntToFloat 72
+ XtCvtIntToFont 73
+ XtCvtIntToPixel 74
+ XtCvtIntToPixmap 75
+ XtCvtIntToShort 76
+ XtCvtIntToUnsignedChar 77
+ XtCvtStringToAcceleratorTable 78
+ XtCvtStringToAtom 79
+ XtCvtStringToBool 80
+ XtCvtStringToBoolean 81
+ XtCvtStringToCursor 82
+ XtCvtStringToDimension 83
+ XtCvtStringToDisplay 84
+ XtCvtStringToFile 85
+ XtCvtStringToFloat 86
+ XtCvtStringToFont 87
+ XtCvtStringToFontSet 88
+ XtCvtStringToFontStruct 89
+ XtCvtStringToInitialState 90
+ XtCvtStringToInt 91
+ XtCvtStringToPixel 92
+ XtCvtStringToShort 93
+ XtCvtStringToTranslationTable 94
+ XtCvtStringToUnsignedChar 95
+ XtCvtStringToVisual 96
+ XtDatabase 97
+ XtDestroyApplicationContext 98
+ XtDestroyGC 99
+ XtDestroyWidget 100
+ XtDirectConvert 101
+ XtDisownSelection 102
+ XtDispatchEvent 103
+ XtDisplay 104
+ XtDisplayInitialize 105
+ XtDisplayOfObject 106
+ XtDisplayStringConversionWarning 107
+ XtDisplayToApplicationContext 108
+ XtError 109
+ XtErrorMsg 110
+ XtFindFile 111
+ XtFree 112
+ XtGetActionKeysym 113
+ XtGetActionList 114
+ XtGetApplicationNameAndClass 115
+ XtGetApplicationResources 116
+ XtGetConstraintResourceList 117
+ XtGetErrorDatabase 118
+ XtGetErrorDatabaseText 119
+ XtGetGC 120
+ XtGetKeysymTable 121
+ XtGetMultiClickTime 122
+ XtGetResourceList 123
+ XtGetSelectionRequest 124
+ XtGetSelectionTimeout 125
+ XtGetSelectionValue 126
+ XtGetSelectionValueIncremental 127
+ XtGetSelectionValues 128
+ XtGetSelectionValuesIncremental 129
+ XtGetSubresources 130
+ XtGetSubvalues 131
+ XtGetValues 132
+ XtGrabButton 133
+ XtGrabKey 134
+ XtGrabKeyboard 135
+ XtGrabPointer 136
+ XtHasCallbacks 137
+ XtInitialize 138
+ XtInitializeWidgetClass 139
+ XtInsertEventHandler 140
+ XtInsertRawEventHandler 141
+ XtInstallAccelerators 142
+ XtInstallAllAccelerators 143
+ XtIsApplicationShell 144
+ XtIsComposite 145
+ XtIsConstraint 146
+ XtIsManaged 147
+ XtIsObject 148
+ XtIsOverrideShell 149
+ XtIsRealized 150
+ XtIsRectObj 151
+ XtIsSensitive 152
+ XtIsShell 153
+ XtIsSubclass 154
+ XtIsTopLevelShell 155
+ XtIsTransientShell 156
+ XtIsVendorShell 157
+ XtIsWMShell 158
+ XtIsWidget 159
+ XtKeysymToKeycodeList 160
+ XtLastTimestampProcessed 161
+ XtMainLoop 162
+ XtMakeGeometryRequest 163
+ XtMakeResizeRequest 164
+ XtMalloc 165
+ XtManageChild 166
+ XtManageChildren 167
+ XtMapWidget 168
+ XtMenuPopupAction 169
+ XtMergeArgLists 170
+ XtMoveWidget 171
+ XtName 172
+ XtNameToWidget 173
+ XtNewString 174
+ XtNextEvent 175
+ XtOpenDisplay 176
+ XtOverrideTranslations 177
+ XtOwnSelection 178
+ XtOwnSelectionIncremental 179
+ XtParent 180
+ XtParseAcceleratorTable 181
+ XtParseTranslationTable 182
+ XtPeekEvent 183
+ XtPending 184
+ XtPopdown 185
+ XtPopup 186
+ XtPopupSpringLoaded 187
+ XtProcessEvent 188
+ XtQueryGeometry 189
+ XtRealizeWidget 190
+ XtRealloc 191
+ XtRegisterCaseConverter 192
+ XtRegisterGrabAction 193
+ XtReleaseGC 194
+ XtRemoveActionHook 195
+ XtRemoveAllCallbacks 196
+ XtRemoveCallback 197
+ XtRemoveCallbacks 198
+ XtRemoveEventHandler 199
+ XtRemoveGrab 200
+ XtRemoveInput 201
+ XtRemoveRawEventHandler 202
+ XtRemoveTimeOut 203
+ XtRemoveWorkProc 204
+ XtResizeWidget 205
+ XtResizeWindow 206
+ XtResolvePathname 207
+ XtScreen 208
+ XtScreenDatabase 209
+ XtScreenOfObject 210
+ XtSetErrorHandler 211
+ XtSetErrorMsgHandler 212
+ XtSetKeyTranslator 213
+ XtSetKeyboardFocus 214
+ XtSetLanguageProc 215
+ XtSetMappedWhenManaged 216
+ XtSetMultiClickTime 217
+ XtSetSelectionTimeout 218
+ XtSetSensitive 219
+ XtSetSubvalues 220
+ XtSetTypeConverter 221
+ XtSetValues 222
+ XtSetWMColormapWindows 223
+ XtSetWarningHandler 224
+ XtSetWarningMsgHandler 225
+ XtStringConversionWarning 226
+ XtSuperclass 227
+ XtToolkitInitialize 228
+ XtTranslateCoords 229
+ XtTranslateKey 230
+ XtTranslateKeycode 231
+ XtUngrabButton 232
+ XtUngrabKey 233
+ XtUngrabKeyboard 234
+ XtUngrabPointer 235
+ XtUninstallTranslations 236
+ XtUnmanageChild 237
+ XtUnmanageChildren 238
+ XtUnmapWidget 239
+ XtUnrealizeWidget 240
+ XtVaAppCreateShell 241
+ XtVaAppInitialize 242
+ XtVaCreateArgsList 243
+ XtVaCreateManagedWidget 244
+ XtVaCreatePopupShell 245
+ XtVaCreateWidget 246
+ XtVaGetApplicationResources 247
+ XtVaGetSubresources 248
+ XtVaGetSubvalues 249
+ XtVaGetValues 250
+ XtVaSetSubvalues 251
+ XtVaSetValues 252
+ XtWarning 253
+ XtWarningMsg 254
+ XtWidgetToApplicationContext 255
+ XtWindow 256
+ XtWindowOfObject 257
+ XtWindowToWidget 258
+ _XtActionInitialize 259
+ _XtAddCallback 260
+ _XtAddCallbackOnce 261
+ _XtAddDefaultConverters 262
+ _XtAddEventSeqToStateTree 263
+ _XtAddTMConverters 264
+ _XtAllocError 265
+ _XtAllocTMContext 266
+ _XtAllocWWTable 267
+ _XtAppCreateShell 268
+ _XtAppInit 269
+ _XtBCopy 270
+ _XtBindActions 271
+ _XtBuildKeysymTables 272
+ _XtCacheFlushTag 273
+ _XtCheckServerGrabsOnWidget 274
+ _XtCheckSubclassFlag 275
+ _XtCloseDisplays 276
+ _XtCompileCallbackList 277
+ _XtCompileResourceList 278
+ _XtComputeLateBindings 279
+ _XtConstraintResDependencies 280
+ _XtConvert 281
+ _XtConvertInitialize 282
+ _XtConvertTypeToMask 283
+ _XtCopyFromArg 284
+ _XtCopyFromParent 285
+ _XtCopyToArg 286
+ _XtCountVaList 287
+ _XtCreateIndirectionTable 288
+ _XtCreatePopupShell 289
+ _XtCreateWidget 290
+ _XtCreateXlations 291
+ _XtCvtMergeTranslations 292
+ _XtDefaultAppContext 293
+ _XtDefaultError 294
+ _XtDefaultErrorMsg 295
+ _XtDefaultWarning 296
+ _XtDefaultWarningMsg 297
+ _XtDependencies 298
+ _XtDestroyAppContexts 299
+ _XtDestroyServerGrabs 300
+ _XtDestroyTMData 301
+ _XtDisplayAccelerators 302
+ _XtDisplayInitialize 303
+ _XtDisplayInstalledAccelerators 304
+ _XtDisplayTranslations 305
+ _XtDoPhase2Destroy 306
+ _XtEventInitialize 307
+ _XtFillAncestorList 308
+ _XtFindRemapWidget 309
+ _XtFreeActions 310
+ _XtFreeConverterTable 311
+ _XtFreeEventTable 312
+ _XtFreePerWidgetInput 313
+ _XtFreeTranslations 314
+ _XtFreeWWTable 315
+ _XtGClistFree 316
+ _XtGetCallbackList 317
+ _XtGetModifierIndex 318
+ _XtGetPerWidgetInput 319
+ _XtGetProcessContext 320
+ _XtGetQuarkIndex 321
+ _XtGetResources 322
+ _XtGetTranslationValue 323
+ _XtGetTypeIndex 324
+ _XtGrabInitialize 325
+ _XtHandleFocus 326
+ _XtHeapAlloc 327
+ _XtHeapFree 328
+ _XtHeapInit 329
+ _XtInherit 330
+ _XtInitErrorHandling 331
+ _XtInitializeActionData 332
+ _XtInstallTranslations 333
+ _XtIsSubclassOf 334
+ _XtMakeGeometryRequest 335
+ _XtMatchAtom 336
+ _XtMatchUsingDontCareMods 337
+ _XtMatchUsingStandardMods 338
+ _XtMergeTranslations 339
+ _XtOnGrabList 340
+ _XtParseTreeToStateTree 341
+ _XtPopup 342
+ _XtPopupInitialize 343
+ _XtPreparseCommandLine 344
+ _XtPrintActions 345
+ _XtPrintEventSeq 346
+ _XtPrintState 347
+ _XtPrintXlations 348
+ _XtProcessKeyboardEvent 349
+ _XtProcessPointerEvent 350
+ _XtRefreshMapping 351
+ _XtRegisterGrabs 352
+ _XtRegisterWindow 353
+ _XtRegularMatch 354
+ _XtRemoveAllCallbacks 355
+ _XtRemoveAllInputs 356
+ _XtRemoveCallback 357
+ _XtRemoveStateTreeByIndex 358
+ _XtRemoveTranslations 359
+ _XtResourceDependencies 360
+ _XtResourceListInitialize 361
+ _XtSendFocusEvent 362
+ _XtSetDefaultConverterTable 363
+ _XtSetDefaultErrorHandlers 364
+ _XtSetDefaultSelectionTimeout 365
+ _XtShellGetCoordinates 366
+ _XtSortPerDisplayList 367
+ _XtTableAddConverter 368
+ _XtTranslateEvent 369
+ _XtTranslateInitialize 370
+ _XtTraverseStateTree 371
+ _XtUnbindActions 372
+ _XtUngrabBadGrabs 373
+ _XtUnmergeTranslations 374
+ _XtUnregisterWindow 375
+ _XtVaAppInitialize 376
+ _XtVaCreateTypedArgList 377
+ _XtVaToArgList 378
+ _XtVaToTypedArgList 379
+ _XtWindowedAncestor 380
+ _XtwaitForSomething 381
+ __default_libXt_init_ 382
+ 
+ _libXt_dummy 383-450
+ 
+ 
+ /**/#objects
+ DOWN/globals.o  /* All objects with global data must be come at first!*/
+ DOWN/pComposite.o
+ DOWN/pConstraint.o
+ DOWN/pCore.o
+ DOWN/pObject.o
+ DOWN/pRectObj.o
+ DOWN/pShell.o
+ DOWN/pVendor.o
+ /*
+  * StringDefs.o contains only 'const' data
+  */
+ DOWN/StringDefs.o
+ /*
+  * Any additional global data must be inserted below this
+  * point to maintain the address in the objects before
+  */
+ DOWN/Composite.o
+ DOWN/Constraint.o
+ DOWN/Core.o
+ DOWN/Object.o
+ DOWN/RectObj.o
+ DOWN/Shell.o
+ DOWN/Vendor.o
+ /*
+  */
+ DOWN/ActionHook.o
+ DOWN/Alloc.o
+ DOWN/ArgList.o
+ DOWN/Callback.o
+ DOWN/ClickTime.o
+ DOWN/Convert.o
+ DOWN/Converters.o
+ DOWN/Create.o
+ DOWN/Destroy.o
+ DOWN/Display.o
+ DOWN/Error.o
+ DOWN/Event.o
+ DOWN/EventUtil.o
+ DOWN/Functions.o
+ DOWN/GCManager.o
+ DOWN/Geometry.o
+ DOWN/GetActKey.o
+ DOWN/GetResList.o
+ DOWN/GetValues.o
+ DOWN/Initialize.o
+ DOWN/Intrinsic.o
+ DOWN/Keyboard.o
+ DOWN/Manage.o
+ DOWN/NextEvent.o
+ DOWN/PassivGrab.o
+ DOWN/Pointer.o
+ DOWN/Popup.o
+ DOWN/PopupCB.o
+ DOWN/Resources.o
+ DOWN/Selection.o
+ DOWN/SetSens.o
+ DOWN/SetValues.o
+ DOWN/SetWMCW.o
+ DOWN/TMaction.o
+ DOWN/TMgrab.o
+ DOWN/TMkey.o
+ DOWN/TMparse.o
+ DOWN/TMprint.o
+ DOWN/TMstate.o
+ DOWN/VarCreate.o
+ DOWN/VarGet.o
+ DOWN/Varargs.o
+ 
+ 
+ /* init sections needs editing!
+  */
+ 
+ /**/#init globals.o
+ _libXt_getenv  getenv
+ _libXt_memset  memset
+ _libXt_sprintf  sprintf
+ _libXt_strchr  strchr
+ _libXt_strcmp  strcmp
+ _libXt_strcpy  strcpy
+ _libXt_strncpy  strncpy
+ _libXt__XtInherit  _XtInherit
+ _libXt__XtCXtToolkitError  XtCXtToolkitError
+ _libXt__XtGlobalTM  _XtGlobalTM
+ /*
+ _libXt__XtInheritTranslations  _XtInheritTranslations
+  */
+ _libXt__XtQString  _XtQString
+ /*
+ _libXt_XtShellStrings  XtShellStrings
+ _libXt_XtStrings  XtStrings
+ */
+ _libXt_compositeWidgetClass  compositeWidgetClass
+ _libXt_constraintWidgetClass  constraintWidgetClass
+ _libXt_coreWidgetClass  coreWidgetClass
+ _libXt_rectObjClass  rectObjClass
+ _libXt_shellWidgetClass  shellWidgetClass
+ _libXt_overrideShellWidgetClass  overrideShellWidgetClass
+ _libXt_wmShellWidgetClass  wmShellWidgetClass
+ _libXt_transientShellWidgetClass  transientShellWidgetClass
+ _libXt_topLevelShellWidgetClass  topLevelShellWidgetClass
+ _libXt_applicationShellWidgetClass  applicationShellWidgetClass
+ _libXt_vendorShellWidgetClass  vendorShellWidgetClass
+ _libXt__aux__  __libXt_init_stub_
+ 
+ 
+ /**/#init Alloc.o
+ _libXt_calloc  calloc
+ _libXt_free  free
+ _libXt_malloc  malloc
+ _libXt_realloc  realloc
+ 
+ /**/#init Converters.o
+ _libXt_atof  atof
+ _libXt_fclose  fclose
+ _libXt_fopen  fopen
+ 
+ /**/#init Display.o
+ _libXt_strrchr  strrchr
+ 
+ /**/#init Error.o
+ _libXt__iob  _iob
+ _libXt_exit  exit
+ _libXt_fprintf  fprintf
+ 
+ /**/#init Initialize.o
+ _libXt_gethostname  gethostname
+ _libXt_getpwnam  getpwnam
+ _libXt_getpwuid  getpwuid
+ _libXt_getuid  getuid
+ _libXt_strcat  strcat
+ 
+ /**/#init Intrinsic.o
+ _libXt_access  access
+ _libXt_stat  stat
+ 
+ /**/#init NextEvent.o
+ _libXt_errno  errno
+ _libXt_gettimeofday  gettimeofday
+ _libXt_select  select
+ 
+ /**/#init TMparse.o
+ _libXt__ctype  _ctype
+ _libXt_qsort  qsort
+ 
+ /**/#init TMprint.o
+ _libXt_printf  printf
+ 
+ /**/#init Vendor.o
+ _libXt__aux__  __libXt_init_stub_
+ 
+ 
+ 
+ /**/#libraries
+ /* Here can objects be specified, which will extracted from
+  * an specified archive library and then linked to the shared
+  * library. This can avoid unwanted referencing of other
+  * shared libraries.
+  * NOTE: this objects must be listed also under #objects!
+  * e.g.:
+ /lib/libc.a memcpy.o
+  * or e.g.:
+ #ifdef __GNUC__
+ GNULIB  _fixdfsi.o
+ #endif
+  *
+  * NOT USED YET
+  *
+  */
+ 
+ /**/#externals
+ /* Here you can specify objects which will only linked to the
+  * host shared library.
+  * That are e.g. objects which contain only big data you want
+  * to seperate from the text section. (See mit/util/mksv3shlib/README.)
+  */
+ InitLibStub.o
+ InitClnStub.o
+ DOWN/InitLib.o
+ DOWN/ChkShlibRev.o
+ DOWN/dummyBind.o
+ 
+ /* There must be a comment as last line */
diff -c /dev/null mit/lib/Xt/pComposite.c:1.2
*** /dev/null	Sat Mar 12 00:39:35 1994
--- mit/lib/Xt/pComposite.c	Sat Mar 12 00:39:36 1994
***************
*** 0 ****
--- 1,21 ----
+ 
+ /* pComposite.c
+  * ------------
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xt/pComposite.c,v 1.2 1993/03/27 09:12:57 dawes Exp $
+  */
+ #define COMPOSITE
+ #include "IntrinsicI.h"
+ #include "StringDefs.h"
+ 
+ #ifdef SVR3SHLIB
+ 
+ #undef compositeWidgetClass
+ 
+ externaldef(compositewidgetclass) WidgetClass compositeWidgetClass = (WidgetClass) &compositeClassRec;
+ 
+ 
+ #endif
+ 
diff -c /dev/null mit/lib/Xt/pConstraint.c:1.2
*** /dev/null	Sat Mar 12 00:39:36 1994
--- mit/lib/Xt/pConstraint.c	Sat Mar 12 00:39:36 1994
***************
*** 0 ****
--- 1,22 ----
+ 
+ /* pConstraint.c
+  * -------------
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xt/pConstraint.c,v 1.2 1993/03/27 09:12:59 dawes Exp $
+  */
+ #define CONSTRAINT
+ #include "IntrinsicI.h"
+ #include "StringDefs.h"
+ 
+ #ifdef SVR3SHLIB
+ 
+ #undef constraintWidgetClass
+ 
+ externaldef(constraintwidgetclass) WidgetClass constraintWidgetClass =
+         (WidgetClass) &constraintClassRec;
+ 
+ 
+ #endif
+ 
diff -c /dev/null mit/lib/Xt/pCore.c:1.3
*** /dev/null	Sat Mar 12 00:39:36 1994
--- mit/lib/Xt/pCore.c	Sat Mar 12 00:39:36 1994
***************
*** 0 ****
--- 1,35 ----
+ 
+ /* pCore.c
+  * -------
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xt/pCore.c,v 1.3 1993/03/20 03:40:59 dawes Exp $
+  */
+ 
+ #define _XT_CORE_C
+ 
+ #include "IntrinsicP.h"
+ #include "EventI.h"
+ #include "TranslateI.h"
+ #include "ResourceI.h"
+ #include "RectObj.h"
+ #include "RectObjP.h"
+ #include "StringDefs.h"
+ 
+ #ifdef SVR3SHLIB
+ 
+ externalref WidgetClass _libXtCore_unNamedObjClassRec;
+ 
+ #undef widgetClass
+ #undef coreWidgetClass
+ 
+ externaldef(WidgetClass) WidgetClass _libXtCore_unNamedObjClass =
+         (WidgetClass) &_libXtCore_unNamedObjClassRec;
+ 
+ externaldef (WidgetClass) WidgetClass widgetClass = &widgetClassRec;
+ 
+ externaldef (WidgetClass) WidgetClass coreWidgetClass = &widgetClassRec;
+ 
+ #endif
+ 
diff -c /dev/null mit/lib/Xt/pObject.c:1.2
*** /dev/null	Sat Mar 12 00:39:36 1994
--- mit/lib/Xt/pObject.c	Sat Mar 12 00:39:36 1994
***************
*** 0 ****
--- 1,22 ----
+ 
+ /* pObject.c
+  * ---------
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xt/pObject.c,v 1.2 1993/03/27 09:13:00 dawes Exp $
+  */
+ 
+ #define OBJECT
+ #include "IntrinsicI.h"
+ #include "StringDefs.h"
+ 
+ #ifdef SVR3SHLIB
+ 
+ #undef objectClass
+ 
+ externaldef(objectClass) WidgetClass objectClass
+ 	 = (WidgetClass)&objectClassRec;
+ 
+ #endif
+ 
diff -c /dev/null mit/lib/Xt/pRectObj.c:1.2
*** /dev/null	Sat Mar 12 00:39:37 1994
--- mit/lib/Xt/pRectObj.c	Sat Mar 12 00:39:37 1994
***************
*** 0 ****
--- 1,23 ----
+ 
+ /* pRectObj.c
+  * ----------
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xt/pRectObj.c,v 1.2 1993/03/27 09:13:02 dawes Exp $
+  */
+ 
+ #define RECTOBJ
+ #include "IntrinsicI.h"
+ #include "StringDefs.h"
+ 
+ #ifdef SVR3SHLIB
+ 
+ #undef rectObjClass
+ 
+ externaldef(rectObjClass)
+ WidgetClass rectObjClass = (WidgetClass)&rectObjClassRec;
+ 
+ 
+ #endif
+ 
diff -c /dev/null mit/lib/Xt/pShell.c:1.2
*** /dev/null	Sat Mar 12 00:39:37 1994
--- mit/lib/Xt/pShell.c	Sat Mar 12 00:39:37 1994
***************
*** 0 ****
--- 1,53 ----
+ 
+ /* pShell.c
+  * --------
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xt/pShell.c,v 1.2 1993/03/27 09:13:04 dawes Exp $
+  */
+ 
+ #define SHELL
+ 
+ #ifndef DEFAULT_WM_TIMEOUT
+ #define DEFAULT_WM_TIMEOUT 5000
+ #endif
+ 
+ #include "IntrinsicI.h"
+ #include "StringDefs.h"
+ #include "Shell.h"
+ #include "ShellP.h"
+ #include "Vendor.h"
+ #include "VendorP.h"
+ #include <X11/Xatom.h>
+ #include <X11/Xlocale.h>
+ #include <stdio.h>
+ 
+ #ifdef SVR3SHLIB
+ 
+ #undef shellWidgetClass
+ #undef overrideShellWidgetClass
+ #undef wmShellWidgetClass
+ #undef transientShellWidgetClass
+ #undef topLevelShellWidgetClass
+ #undef applicationShellWidgetClass
+ 
+ externaldef(shellwidgetclass) WidgetClass shellWidgetClass =
+ 	(WidgetClass) (&shellClassRec);
+ 
+ externaldef(overrideshellwidgetclass) WidgetClass overrideShellWidgetClass =
+         (WidgetClass) (&overrideShellClassRec);
+ 
+ externaldef(wmshellwidgetclass) WidgetClass wmShellWidgetClass =
+ 	(WidgetClass) (&wmShellClassRec);
+ 
+ externaldef(transientshellwidgetclass) WidgetClass transientShellWidgetClass =
+         (WidgetClass) (&transientShellClassRec);
+ 
+ externaldef(toplevelshellwidgetclass) WidgetClass topLevelShellWidgetClass =
+         (WidgetClass) (&topLevelShellClassRec);
+ 
+ externaldef(applicationshellwidgetclass) WidgetClass applicationShellWidgetClass =
+         (WidgetClass) (&applicationShellClassRec);
+ 
+ #endif
diff -c /dev/null mit/lib/Xt/pVendor.c:1.2
*** /dev/null	Sat Mar 12 00:39:37 1994
--- mit/lib/Xt/pVendor.c	Sat Mar 12 00:39:37 1994
***************
*** 0 ****
--- 1,26 ----
+ 
+ /* pVendor.c
+  * ---------
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  *
+  * $XFree86: mit/lib/Xt/pVendor.c,v 1.2 1993/03/27 09:13:05 dawes Exp $
+  */
+ 
+ #include "IntrinsicI.h"
+ #include "StringDefs.h"
+ #include "Shell.h"
+ #include "ShellP.h"
+ #include "Vendor.h"
+ #include "VendorP.h"
+ #include <stdio.h>
+ 
+ #ifdef SVR3SHLIB
+ 
+ #undef vendorShellWidgetClass
+ 
+ externaldef(vendorshellwidgetclass) WidgetClass vendorShellWidgetClass =
+         (WidgetClass) (&vendorShellClassRec);
+ 
+ #endif
+ 
diff -c mit/lib/nls/Imakefile:1.1.1.1 mit/lib/nls/Imakefile:1.2
*** mit/lib/nls/Imakefile:1.1.1.1	Sat Mar 12 00:39:39 1994
--- mit/lib/nls/Imakefile	Sat Mar 12 00:39:39 1994
***************
*** 1,4 ****
--- 1,8 ----
+ XCOMM $XFree86: mit/lib/nls/Imakefile,v 1.2 1993/03/20 03:42:55 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.8 91/07/16 22:44:07 gildea Exp $
+ 
+ #ifndef Amoeba
+ 
  #define IHaveSubdirs
  #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
  
***************
*** 23,25 ****
--- 27,39 ----
  
  MakeSubdirs($(SUBDIRS))
  DependSubdirs($(SUBDIRS))
+ 
+ #else  /* Amoeba */
+ /*
+  * Do not install the nls libraries for Amoeba, since the parsing
+  * routines in the X library require a lot of stack space (256Kb)
+  * when parsing these files. This is only a temporary measure.
+  */
+ all:;
+ depend:;
+ #endif /* Amoeba */
diff -c mit/lib/oldX/XDelAssoc.c:1.1.1.1 mit/lib/oldX/XDelAssoc.c:1.3
*** mit/lib/oldX/XDelAssoc.c:1.1.1.1	Sat Mar 12 00:39:49 1994
--- mit/lib/oldX/XDelAssoc.c	Sat Mar 12 00:39:49 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/oldX/XDelAssoc.c,v 1.3 1993/03/27 09:06:52 dawes Exp $ */
  /* $XConsortium: XDelAssoc.c,v 10.19 91/01/06 12:06:39 rws Exp $ */
  /* Copyright    Massachusetts Institute of Technology    1985	*/
  
***************
*** 16,26 ****
--- 17,29 ----
  #include "Xlibint.h"
  #include "X10.h"
  void remque();
+ #ifndef linux
  struct qelem {
  	struct    qelem *q_forw;
  	struct    qelem *q_back;
  	char q_data[1];
  };
+ #endif
  
  /*
   * XDeleteAssoc - Delete an association in an XAssocTable keyed on
diff -c mit/lib/oldX/XMakeAssoc.c:1.1.1.1 mit/lib/oldX/XMakeAssoc.c:1.5
*** mit/lib/oldX/XMakeAssoc.c:1.1.1.1	Sat Mar 12 00:39:50 1994
--- mit/lib/oldX/XMakeAssoc.c	Sat Mar 12 00:39:50 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/lib/oldX/XMakeAssoc.c,v 1.5 1993/04/21 09:55:52 dawes Exp $ */
  /* $XConsortium: XMakeAssoc.c,v 10.18 91/01/06 12:09:28 rws Exp $ */
  /* Copyright    Massachusetts Institute of Technology    1985	*/
  
***************
*** 16,27 ****
--- 17,34 ----
  #include "Xlibint.h"
  #include "X10.h"
  
+ #ifdef ISC
+ #define insque _insque
+ #endif
+ 
  void insque();
+ #ifndef linux
  struct qelem {
  	struct    qelem *q_forw;
  	struct    qelem *q_back;
  	char q_data[1];
  };
+ #endif
  /*
   * XMakeAssoc - Insert data into an XAssocTable keyed on an XId.
   * Data is inserted into the table only once.  Redundant inserts are
diff -c mit/rgb/Imakefile:1.1.1.2 mit/rgb/Imakefile:2.2
*** mit/rgb/Imakefile:1.1.1.2	Sat Mar 12 00:39:51 1994
--- mit/rgb/Imakefile	Sat Mar 12 00:39:51 1994
***************
*** 1,20 ****
  XCOMM $XConsortium: Imakefile,v 1.23 91/09/09 16:09:09 rws Exp $
          RGB_DB = DefaultRGBDatabase
     SITE_RGB_DB = -DRGB_DB=\"$(RGB_DB)\"
        DEPLIBS = 
        DEFINES = NdbmDefines $(SITE_RGB_DB)
-      INCLUDES = -I$(SERVERSRC)/include
-  INSTALLFLAGS = $(INSTLIBFLAGS)
          SRCS1 = rgb.c
          OBJS1 = rgb.o
          SRCS2 = showrgb.c
          OBJS2 = showrgb.o
           SRCS = $(SRCS1) $(SRCS2)
           OBJS = $(OBJS1) $(OBJS2)
       PROGRAMS = rgb showrgb
      DATAFILES = rgb.pag rgb.dir
        DATADEP = rgb.dir		/* just want one run of rgb */
! #if !(defined(SGIArchitecture) || SystemV4)
         DBMLIB = -ldbm
  #endif
  #if defined(SparcArchitecture) && HasGcc
--- 1,33 ----
+ XCOMM $XFree86: mit/rgb/Imakefile,v 2.2 1993/11/07 14:07:09 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.23 91/09/09 16:09:09 rws Exp $
          RGB_DB = DefaultRGBDatabase
     SITE_RGB_DB = -DRGB_DB=\"$(RGB_DB)\"
        DEPLIBS = 
+ #ifdef XFree86Version
+       DEFINES = -DUSE_RGB_TXT $(SITE_RGB_DB)
+ #else
        DEFINES = NdbmDefines $(SITE_RGB_DB)
          SRCS1 = rgb.c
          OBJS1 = rgb.o
+ #endif
+      INCLUDES = -I$(SERVERSRC)/include
+  INSTALLFLAGS = $(INSTLIBFLAGS)
          SRCS2 = showrgb.c
          OBJS2 = showrgb.o
           SRCS = $(SRCS1) $(SRCS2)
           OBJS = $(OBJS1) $(OBJS2)
+ #ifdef XFree86Version
+      PROGRAMS = showrgb
+ #else /* !XFree86Version */
       PROGRAMS = rgb showrgb
+ #if i386Bsd
+     DATAFILES = rgb.db
+       DATADEP = rgb.db
+ #else
      DATAFILES = rgb.pag rgb.dir
        DATADEP = rgb.dir		/* just want one run of rgb */
! #endif
! #if !(defined(SGIArchitecture) || SystemV4 || i386Bsd || Amoeba || Minix)
         DBMLIB = -ldbm
  #endif
  #if defined(SparcArchitecture) && HasGcc
***************
*** 22,41 ****
      CCOPTIONS = /**/
      EXTRA_LOAD_FLAGS = /**/
  #endif
! #if defined(i386SVR4Architecture)
!        DBMLIB = -ldbm -lucb
  #endif
  
  all:: $(PROGRAMS) $(DATADEP)
  
  SingleProgramTarget(rgb,$(OBJS1),NullParameter,$(DBMLIB))
  SingleProgramTarget(showrgb,$(OBJS2),NullParameter,$(DBMLIB))
! SpecialObjectRule(rgb.o,$(ICONFIGFILES),$(_NOOP_))
! SpecialObjectRule(showrgb.o,$(ICONFIGFILES),$(_NOOP_))
  InstallMultiple($(DATAFILES) rgb.txt,$(LIBDIR))
  InstallProgramWithFlags(showrgb,$(BINDIR),)
  InstallManPage(showrgb,$(MANDIR))
  
  $(DATADEP):  rgb rgb.txt
  	$(RM) $(DATAFILES)
  	./rgb rgb < rgb.txt
--- 35,83 ----
      CCOPTIONS = /**/
      EXTRA_LOAD_FLAGS = /**/
  #endif
! #if HasSdbm
!        DBMLIB = -lsdbm
  #endif
+ #if Amoeba || Minix
+        DBMLIB = ../lib/sdbm/libsdbm.a
+ #endif
+ #endif /* !XFree86Version */
  
+ #if !CrossCompiling
  all:: $(PROGRAMS) $(DATADEP)
+ #else
+ all:: showrgb
+ #endif
  
+ #ifdef XFree86Version
+ SingleProgramTarget(showrgb,$(OBJS2),NullParameter,NullParameter)
+ SpecialObjectRule(showrgb.o,showrgb.c $(ICONFIGFILES),$(_NOOP_))
+ #else
+ #if Amoeba || Minix
+ SingleProgramTarget(rgb,$(OBJS1),$(DBMLIB),NullParameter)
+ SingleProgramTarget(showrgb,$(OBJS2),$(DBMLIB),NullParameter)
+ #else
  SingleProgramTarget(rgb,$(OBJS1),NullParameter,$(DBMLIB))
  SingleProgramTarget(showrgb,$(OBJS2),NullParameter,$(DBMLIB))
! #endif
! SpecialObjectRule(rgb.o,rgb.c $(ICONFIGFILES),$(_NOOP_))
! SpecialObjectRule(showrgb.o,showrgb.c $(ICONFIGFILES),$(_NOOP_))
! #endif
! #if !CrossCompiling
  InstallMultiple($(DATAFILES) rgb.txt,$(LIBDIR))
+ #else
+ #if Amoeba
+ install::
+ 	$(MKXDIRHIER) $(LIBDIR)/rgb/$(ARCH)
+ 
+ InstallMultiple($(DATAFILES),$(LIBDIR)/rgb/$(ARCH))
+ #endif
+ #endif
  InstallProgramWithFlags(showrgb,$(BINDIR),)
  InstallManPage(showrgb,$(MANDIR))
  
+ #ifndef XFree86Version
+ #if !CrossCompiling
  $(DATADEP):  rgb rgb.txt
  	$(RM) $(DATAFILES)
  	./rgb rgb < rgb.txt
***************
*** 42,46 ****
--- 84,90 ----
  
  clean::
  	$(RM) $(DATAFILES)
+ #endif
+ #endif
  
  DependTarget()
diff -c mit/rgb/rgb.c:1.1.1.1 mit/rgb/rgb.c:2.1
*** mit/rgb/rgb.c:1.1.1.1	Sat Mar 12 00:39:51 1994
--- mit/rgb/rgb.c	Sat Mar 12 00:39:51 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/rgb/rgb.c,v 2.1 1994/02/10 21:24:09 dawes Exp $ */
  /* Copyright 1985, Massachusetts Institute of Technology */
  
  /* reads from standard input lines of the form:
***************
*** 9,17 ****
  #endif
  
  #ifdef NDBM
  #include <ndbm.h>
  #else
! #ifdef SVR4
  #include <rpcsvc/dbm.h>
  #else
  #include <dbm.h>
--- 10,22 ----
  #endif
  
  #ifdef NDBM
+ #ifdef SDBM
+ #include <sdbm.h>
+ #else
  #include <ndbm.h>
+ #endif
  #else
! #if defined(SVR4) || defined(ISC)
  #include <rpcsvc/dbm.h>
  #else
  #include <dbm.h>
***************
*** 24,29 ****
--- 29,39 ----
  #undef NULL
  #include <stdio.h>
  #include <X11/Xos.h>
+ 
+ #if (BSD >= 199103)
+ #include <sys/types.h>
+ #endif
+ 
  #include "rgb.h"
  #include "site.h"
  #include <ctype.h>
***************
*** 30,44 ****
--- 40,68 ----
  
  #include <errno.h>
  extern int errno;			/* some systems are still stupid */
+ #ifdef X_NO_STRERROR
  extern int sys_nerr;
  extern char *sys_errlist[];
+ #else
+ #include <string.h>
+ #endif
+ 
+ #ifndef X_NOT_STDC_ENV
+ #include <stdlib.h>
+ #else
+ extern char *getenv();
+ #endif
  
  char *ProgramName;
  
+ #ifdef X_NO_STRERROR
  char *SysError ()
  {
      return ((errno >= 0 && errno < sys_nerr) ? sys_errlist[errno] : "?");
  }
+ #else
+ #define SysError() strerror(errno)
+ #endif
  
  main(argc, argv)
      int argc;
***************
*** 50,55 ****
--- 74,81 ----
      RGB rgb;
      datum key, content;
      char name[512];
+     char dbpath[512];
+     char *xwinhome = NULL;
      int items;
      int lineno;
      int i, n;
***************
*** 64,72 ****
  
      if (argc == 2)
  	dbname = argv[1];
!     else
! 	dbname = RGB_DB;
  
      strcpy (name, dbname);
      strcat (name, ".dir");
      fd = open (name, O_WRONLY|O_CREAT, 0666);
--- 90,106 ----
  
      if (argc == 2)
  	dbname = argv[1];
!     else {
! 	if ((xwinhome = getenv("XWINHOME")) != NULL) {
! 	    sprintf(dbpath, "%s/lib/X11/rgb", xwinhome);
! 	    dbname = dbpath;
! 	}
! 	else {
! 	    dbname = RGB_DB;
! 	}
!     }
  
+ #if !(BSD >= 199103)
      strcpy (name, dbname);
      strcat (name, ".dir");
      fd = open (name, O_WRONLY|O_CREAT, 0666);
***************
*** 90,95 ****
--- 124,132 ----
      (void) close (fd);
  
      rgb_dbm = dbm_open (dbname, O_RDWR, 0666);
+ #else
+     rgb_dbm = dbm_open (dbname, O_RDWR | O_CREAT, 0666);
+ #endif
      if (!rgb_dbm) {
  	fprintf (stderr,
  		 "%s:  unable to open dbm database \"%s\" (error %d, %s)\n",
diff -c mit/rgb/showrgb.c:1.1.1.1 mit/rgb/showrgb.c:2.2
*** mit/rgb/showrgb.c:1.1.1.1	Sat Mar 12 00:39:52 1994
--- mit/rgb/showrgb.c	Sat Mar 12 00:39:52 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/rgb/showrgb.c,v 2.2 1994/02/10 21:24:10 dawes Exp $
   * $XConsortium: showrgb.c,v 1.8 91/06/30 16:39:03 rws Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 23,32 ****
   * Author:  Jim Fulton, MIT X Consortium
   */
  
  #ifdef NDBM
  #include <ndbm.h>
  #else
! #ifdef SVR4
  #include <rpcsvc/dbm.h>
  #else
  #include <dbm.h>
--- 24,38 ----
   * Author:  Jim Fulton, MIT X Consortium
   */
  
+ #ifndef USE_RGB_TXT
  #ifdef NDBM
+ #ifdef SDBM
+ #include <sdbm.h>
+ #else
  #include <ndbm.h>
+ #endif
  #else
! #if defined(SVR4) || defined(ISC)
  #include <rpcsvc/dbm.h>
  #else
  #include <dbm.h>
***************
*** 36,49 ****
--- 42,67 ----
  #define dbm_fetch(db,key) (fetch(key))
  #define dbm_close(db) dbmclose()
  #endif
+ #endif
  
  #undef NULL
  #include <stdio.h>
  #include <X11/Xos.h>
+ 
+ #if (BSD >= 199103)
+ #include <sys/types.h>
+ #endif
+ 
  #include "rgb.h"			/* off in server/include/ */
  #include "site.h"
  #include <X11/Xfuncs.h>
  
+ #ifndef X_NOT_STDC_ENV
+ #include <stdlib.h>
+ #else
+ extern char *getenv();
+ #endif
+ 
  char *ProgramName;
  
  main (argc, argv)
***************
*** 51,65 ****
      char *argv[];
  {
      char *dbname = RGB_DB;
  
      ProgramName = argv[0];
      if (argc == 2)
  	dbname = argv[1];
! 
      dumprgb (dbname);
      exit (0);
  }
  
  dumprgb (filename)
      char *filename;
  {
--- 69,91 ----
      char *argv[];
  {
      char *dbname = RGB_DB;
+     char dbpath[512];
+     char *xwinhome = NULL;
  
      ProgramName = argv[0];
      if (argc == 2)
  	dbname = argv[1];
!     else
! 	if ((xwinhome = getenv("XWINHOME")) != NULL) {
! 	    sprintf(dbpath, "%s/lib/X11/rgb", xwinhome);
! 	    dbname = dbpath;
! 	}
      dumprgb (dbname);
      exit (0);
  }
  
+ #ifndef USE_RGB_TXT
+ 
  dumprgb (filename)
      char *filename;
  {
***************
*** 107,109 ****
--- 133,181 ----
  
      dbm_close (rgb_dbm);
  }
+ 
+ #else /* USE_RGB_TXT */
+ 
+ dumprgb (filename)
+     char *filename;
+ {
+     FILE *rgb;
+     char *path;
+     char line[BUFSIZ];
+     char name[BUFSIZ];
+     int lineno = 0;
+     int red, green, blue;
+    
+     path = (char *)malloc(strlen(filename) + 5);
+     strcpy(path, filename);
+     strcat(path, ".txt");
+ 
+     if (!(rgb = fopen(path, "r"))) {
+ 	fprintf (stderr, "%s:  unable to open rgb database \"%s\"\n",
+ 		 ProgramName, filename);
+ 	free(path);
+ 	exit (1);
+     }
+ 
+     while(fgets(line, sizeof(line), rgb)) {
+ 	lineno++;
+ 	if (sscanf(line, "%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4) {
+ 	    if (red >= 0 && red <= 0xff &&
+ 		green >= 0 && green <= 0xff &&
+ 		blue >= 0 && blue <= 0xff) {
+ 		printf ("%3u %3u %3u\t\t%s\n", red, green, blue, name);
+ 	    } else {
+ 		fprintf(stderr, "%s:  value for \"%s\" out of range: %s:%d\n",
+ 		        ProgramName, name, path, lineno);
+ 	    }
+ 	} else if (*line && *line != '#') {
+ 	    fprintf(stderr, "%s:  syntax error: %s:%d\n", ProgramName,
+ 		    path, lineno);
+ 	}
+     }
+ 
+     free(path);
+     fclose(rgb);
+ }
+ 
+ #endif /* USE_RGB_TXT */
diff -c mit/util/makedepend/Imakefile:1.1.1.1 mit/util/makedepend/Imakefile:2.0
*** mit/util/makedepend/Imakefile:1.1.1.1	Sat Mar 12 00:39:57 1994
--- mit/util/makedepend/Imakefile	Sat Mar 12 00:39:57 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/util/makedepend/Imakefile,v 2.0 1993/07/28 11:59:44 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.15 91/12/02 08:48:08 rws Exp $
  /*
   * NOTE: CppSourcesPresent IS NO LONGER TESTED OR SUPPORTED,
***************
*** 24,29 ****
--- 25,36 ----
      OBJS = include.o main.o parse.o pr.o cppsetup.o
  #endif
  
+ #define INoCrossCompilation
+ 
+ #if defined(AckToolset) && !defined(CrossCompiling)
+ LDOPTIONS = AckNoCrossLdFlags
+ #endif
+ 
  INCLUDES = -I$(CONFIGSRC)
   DEFINES = $(CPPDEFS) '-DINCLUDEDIR="/usr/include"' $(SIGNAL_DEFINES)
   DEPLIBS =
***************
*** 32,42 ****
--- 39,61 ----
   XBSDLIB = /**/
  #endif
  
+ #if NeedBerklib
+  XBSDLIB = /**/
+ #endif
+ 
+ #if NeedInetEmulLib
+ XINETLIB = /**/
+ #endif
+ 
  all:: makedepend
  
  #undef InstallManPage
  #define InstallManPage(file,dest) /* as nothing */
+ #if CrossCompiling
+ ComplexCrossProgramTarget(makedepend)
+ #else
  ComplexProgramTarget(makedepend)
+ #endif
  
  InstallManPageLong(mkdepend,$(MANDIR),makedepend)
  
***************
*** 43,49 ****
  
  #if CppSourcesPresent
  cpy.c: cpy.y yylex.c
! 	yacc cpy.y
  	sed -e '/^# *line/d' < y.tab.c > cpy.c
  	$(RM) y.tab.c
  
--- 62,68 ----
  
  #if CppSourcesPresent
  cpy.c: cpy.y yylex.c
! 	$(YACC) $(YFLAGS) cpy.y
  	sed -e '/^# *line/d' < y.tab.c > cpy.c
  	$(RM) y.tab.c
  
diff -c mit/util/makedepend/def.h:1.1.1.1 mit/util/makedepend/def.h:2.1
*** mit/util/makedepend/def.h:1.1.1.1	Sat Mar 12 00:39:57 1994
--- mit/util/makedepend/def.h	Sat Mar 12 00:39:57 1994
***************
*** 1,14 ****
  /*
   * $XConsortium: def.h,v 1.17 91/05/13 10:23:29 rws Exp $
   */
! #include <X11/Xosdefs.h>
  #include <stdio.h>
  #include <ctype.h>
  #ifndef X_NOT_POSIX
  #ifndef _POSIX_SOURCE
  #define _POSIX_SOURCE
  #endif
  #endif
  #include <sys/types.h>
  #include <fcntl.h>
  #include <sys/stat.h>
--- 1,17 ----
  /*
+  * $XFree86: mit/util/makedepend/def.h,v 2.1 1994/02/10 21:27:52 dawes Exp $
   * $XConsortium: def.h,v 1.17 91/05/13 10:23:29 rws Exp $
   */
! #include <X11/Xos.h>
  #include <stdio.h>
  #include <ctype.h>
  #ifndef X_NOT_POSIX
  #ifndef _POSIX_SOURCE
+ #if !(BSD >= 199103)
  #define _POSIX_SOURCE
  #endif
  #endif
+ #endif
  #include <sys/types.h>
  #include <fcntl.h>
  #include <sys/stat.h>
***************
*** 15,21 ****
  
  #define MAXDEFINES	512
  #define MAXFILES	512
! #define MAXDIRS		20
  #define SYMTABINC	10	/* must be > 1 for define() to work right */
  #define	TRUE		1
  #define	FALSE		0
--- 18,24 ----
  
  #define MAXDEFINES	512
  #define MAXFILES	512
! #define MAXDIRS		30
  #define SYMTABINC	10	/* must be > 1 for define() to work right */
  #define	TRUE		1
  #define	FALSE		0
diff -c mit/util/makedepend/main.c:1.1.1.1 mit/util/makedepend/main.c:2.0
*** mit/util/makedepend/main.c:1.1.1.1	Sat Mar 12 00:39:57 1994
--- mit/util/makedepend/main.c	Sat Mar 12 00:39:58 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/util/makedepend/main.c,v 2.0 1994/02/10 21:27:54 dawes Exp $
   * $XConsortium: main.c,v 1.56 91/07/25 11:50:59 rws Exp $
   */
  #include "def.h"
***************
*** 8,16 ****
--- 9,19 ----
  
  #ifndef X_NOT_POSIX
  #ifndef _POSIX_SOURCE
+ #if !(BSD >= 199103)
  #define _POSIX_SOURCE
  #endif
  #endif
+ #endif
  #include <signal.h>
  
  #ifdef DEBUG
***************
*** 258,266 ****
--- 261,273 ----
  	signal (SIGINT, catch);
  	signal (SIGQUIT, catch);
  	signal (SIGILL, catch);
+ #ifdef SIGBUS
  	signal (SIGBUS, catch);
+ #endif
  	signal (SIGSEGV, catch);
+ #ifdef SIGSYS
  	signal (SIGSYS, catch);
+ #endif
  #else
  	sig_act.sa_handler = catch;
  #ifdef _POSIX_SOURCE
***************
*** 267,278 ****
--- 274,289 ----
  	sigemptyset(&sig_act.sa_mask);
  	sigaddset(&sig_act.sa_mask, SIGINT);
  	sigaddset(&sig_act.sa_mask, SIGQUIT);
+ #ifdef SIGBUS
  	sigaddset(&sig_act.sa_mask, SIGBUS);
+ #endif
  	sigaddset(&sig_act.sa_mask, SIGILL);
  	sigaddset(&sig_act.sa_mask, SIGSEGV);
  	sigaddset(&sig_act.sa_mask, SIGHUP);
  	sigaddset(&sig_act.sa_mask, SIGPIPE);
+ #ifdef SIGSYS
  	sigaddset(&sig_act.sa_mask, SIGSYS);
+ #endif
  #else
  	sig_act.sa_mask = ((1<<(SIGINT -1))
  			   |(1<<(SIGQUIT-1))
***************
*** 288,296 ****
--- 299,311 ----
  	sigaction(SIGINT, &sig_act, (struct sigaction *)0);
  	sigaction(SIGQUIT, &sig_act, (struct sigaction *)0);
  	sigaction(SIGILL, &sig_act, (struct sigaction *)0);
+ #ifdef SIGBUS
  	sigaction(SIGBUS, &sig_act, (struct sigaction *)0);
+ #endif
  	sigaction(SIGSEGV, &sig_act, (struct sigaction *)0);
+ #ifdef SIGSYS
  	sigaction(SIGSYS, &sig_act, (struct sigaction *)0);
+ #endif
  #endif /* USGISH */
  
  	/*
diff -c /dev/null mit/util/mksv3shlib/README:1.1
*** /dev/null	Sat Mar 12 00:39:59 1994
--- mit/util/mksv3shlib/README	Sat Mar 12 00:39:59 1994
***************
*** 0 ****
--- 1,253 ----
+ 
+ SVR3 shared library building help kit version 1.4
+ ----------------------------------------------------------------------------
+ 
+ Files
+ ----------------------------------------------------------------------------
+ 
+ filename		purpose
+ -----------------------------------------------------------------------------
+ mkshtmpl.sh		This is a script to create the necessary description
+ XlibsMakefile		files from the respective archive library version,
+ sv3ShlibAddr		an auxiliary makefile used by the script and a file
+ 			containing the address range definitions for the
+ 			various X libraries.
+ 
+ chkimports.sh		This script is usefull to check a generated
+ 			shared library for (incorrect) differences of the
+ 			imported symbols to the archive version.
+ 
+ datasize		This is a small script which evaluates the size
+ 			of the .data section of an archiv library.
+ 
+ libX11/addImports	These files containg explicit imported symbols
+ libXt/addImports	for libX11 and libXt. (They are examples.)
+ 
+ libX11/constData	These files containg data symbol definitions of
+ libXt/constData		(ANSI-C) constant data, which goes to .text section.
+ 			To avoid that mkshtmpl.sh creates a bad branch
+ 			entry table for such symbols they must be putted
+ 			here. (The files are examples.)
+ 
+ 
+ 			
+ Creating a shared library
+ -----------------------------------------------------------------------------
+ NOTE: 1. RTFM of your system!!!
+ 
+       Mkshtmpl.sh script is not perfect. The files generated by mkshtmpl.sh
+       must be edited by hand. On simple libraries (e.g. libXext) less, on
+       complex libraries (e.g. libXaw) more. And more bad, in most cases
+       you must make changes in the library sources.
+ 
+       <lib> in the following description stands for libXm, libxview
+       or whichever library do you want make shareable.
+ 
+ 
+ mkshtmpl.sh
+ -----------
+ Before you running the script you must do some things.
+ First list the address ranges of the shared library in sv3ShlibAddr if
+ they doesn't already exist.
+ Second think over whether you want reference symbols from other
+ shared libraries directly via the #object noload directive.
+ Then you have to choices: you can write a auxilary makefile similar
+ the included XlibsMakefile. Then mkshtmpl.sh will use it (you must edit
+ mkshtmpl.sh to put your filename in) and such symbols are removed
+ automatically from the generated description files.
+ Or you must do this by hand after running mkshtmpl.sh.
+ 
+ Third if you know some global "const"ant data symbols list them
+ in a file <lib>/constData. Check the sources for 
+ E.g. the file libX11/constData contains:
+ 
+ 	evtomask.o D _Xevent_to_mask
+ 	XStrKeysym.o D _XkeyTable
+ 
+ The "D" stands for "D"ata. The problem is that ANSI C compilers
+ put "const" data to .text section and hence mkshtmpl.sh generates
+ a bad branch table entry. The file overrides these symbols.
+ 
+ Second, if you want explicit import some symbols (e.g. from the
+ library itself) put these to a file <lib>/addImports.
+ E.g. the file libX11/addImports contains:
+ 
+ 	100 XauDisposeAuth globals.o
+ 	100 XauFileName globals.o
+ 	100 XauGetBestAuthByAddr globals.o
+ 	100 XauReadAuth globals.o
+ 
+ Although it is possible, you should not use something other than "100"
+ and "globals.o".
+ Then call with the path name of the respective archive library.
+ E.g.
+ 	cd mit/util/mksv3shlib
+ 	mkshtmpl.sh ../../lib/X/libX11.a
+ 
+ This creates at first a directory <lib> and within that the files <lib>.def,
+ <lib>.h and <lib>.c. <Lib>.def is the shared library description file in a
+ format to process it during building of the library with the preprocessor to
+ evaluate some defines (DOWN, __GNUC__) and it can contain two optional sections
+ "#externals" and "#libraries" which are used during the library built and
+ removed before mkshlib is called. (Compare with the rules in
+ mit/config/sv3Lib.rules.) <Lib>.h contains contains indirection #define's
+ and <lib>.c the definitions of the pointers.
+ (In addition two files <lib>/exports.out and <lib>/imports.out are created.
+  These files are input files for chkimports.sh. See below.)
+ 
+ NOTE: The generated files need editing! Not all things are right. See
+       also comments in the created files. 
+ 
+ Trying to build a shared library:
+ Copy <lib>.def, <lib>.h, <lib>.c in the <lib> source directory. Rename <lib>.h
+ to imports.h. If there is no other globals.c rename <lib>.c to globals.c, if
+ there is another globals.c put
+ 
+ #include "<lib>.c"
+ 
+ to it. Note, the needed guards:
+ #ifdef SVR3SHLIB
+ ...
+ #endif
+ are inside <lib>.c. This is to get a dependence in the Makefile. 
+ List globals.c/globals.o in the Imakefile of the library under SRCS/OBJS or
+ whatever the respective variable names are called.
+ Put a special rule for globals.o in the Imakefile (best after
+ LibraryObjectRule(), Imakefile:
+ 
+ ...
+ LibraryObjectRule()
+ 
+ #if defined(i386SVR3Architecture) && DoSharedLib
+ SpecialLibObjectRule(globals.o,$(ICONFIGFILES),-D_libXext_import)
+ #endif
+ ...
+ 
+ 
+ Be aware that you must probably also change source files of the library.
+ (See Hints).
+ 
+ 
+ chkimports.sh
+ -------------
+ 
+ This scripts checks whether a created shared library imports other symbols
+ then the archive version and vice versa. I wrote it to find mean errors
+ caused by double used names (like syscall "stat" and structure "stat")
+ and a certain style of extern declarations, like:
+ ...
+ char *
+ XauFileName ()
+ {
+     char    *name, *malloc (), *getenv ();
+     char    *strcat (), *strcpy ();
+ ...
+ Very bad if we want "#define malloc  (*_libX11_malloc)" ...
+ Check the sources for that! All what you must do is putting the friendly
+ word "extern" before the function declaration. Otherwise this causes
+ mysterious core dumps.
+ 
+ The script needs <lib>/exports.out and <lib>/imports.out previously generated
+ by mkshtmpl.sh and of course a created shared library.
+ E.g.
+ 	chkimports.sh ../../lib/X/libX11_s.a
+ 
+ If there are errors printed out these are probably really errors. Probably you
+ get also a lot of warnings. Most of them come from globals.o, ignore them.
+ Check the others exactly. E.g. if our nice gcc 2.x.x optimizes it uses some-
+ times its in-built strcmp(3)/strcpy(3). But if it's redefined e.g.
+ "_libX11_strcmp" gcc don't do it and therefore there is difference between
+ the archive and the shared version. We could ignore it but for performance
+ its better to put following to the appropriate source file:
+ 
+ (e.g.)
+ 
+ #if defined(SVR3SHLIB) && (__GNUC__ == 2) && defined(__OPTIMIZE__)
+ #undef strcmp
+ #endif
+ 
+ Other differences come from declarations of external functions without the
+ keyword "extern". Due to redefinition these symbols become pointer definitions.
+ They are uninitialized and hence the compiler create common symbols (which
+ cause the warnings of the script). But since they are common this is no
+ problem. Ignore them. Prime candidats are: gethostbyname and other stuff from
+ BSD style headers, XauDisposeAuth, XauFileName, XauGetBestAuthByAddr,
+ XauReadAuth.
+ 
+ Remaining warnings could be real errors.
+ 
+ 
+ Hints
+ -----
+ 
+ If the library is simple and has less global data you don't must change
+ much in the automatically generated files. But you should care to put
+ global data to the top of the shared library, to avoid breaking
+ clients if you replace the target shared lib in the future.
+ 
+ If you have big data in some less used objects in the library you can
+ seperate it from the code in put it only to the host shared library.
+ The advantage is that this data goes only to clients which really
+ needs it instead to the data section of the shared lib which is
+ copied for every client.
+ But there is also a big disadvantage. If a future library version changes
+ its internal data structures the client will break. (One example
+ for that is libXaw and libXaw3d.)
+ But to do it you must split the respective source file with #ifdefs.
+ There are predifined defines for that.
+ E.g. foo.c:
+ 
+ ...
+ 
+ #if !defined(SVR3SHLIB) || defined(SVR3SHDAT)
+ ...
+ struct HugeStruct huge_struct = {0};
+ char mega[1024*1024] = "";
+ 
+ #endif
+ 
+ #ifndef SVR3SHDAT
+ extern struct HugeStruct huge_struct;
+ extern char mega[];
+ ...
+ 
+ int foo() { 
+ ...
+ };
+ 
+ ...
+ #endif
+ 
+ The imake rules are prepared to compile such sources twice, if you are list
+ them in the Imakefile twice (one time with suffix .sd), Imakefile:
+ ...
+ OBJS = \
+ 	foo.o \
+ 	...
+ 	foo.sd
+ ...
+ The .sd file will contain the data. To put it in the host shared library
+ you must list it in the #externals section of <lib>.def:
+ ...
+ /**/externals
+ foo.sd
+ 
+ 
+ Note, actually this method is not used with the X libraries, because
+ of the above mentioned disadvantage.
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
diff -c /dev/null mit/util/mksv3shlib/XlibsMakefile:1.1
*** /dev/null	Sat Mar 12 00:39:59 1994
--- mit/util/mksv3shlib/XlibsMakefile	Sat Mar 12 00:39:59 1994
***************
*** 0 ****
--- 1,71 ----
+ ######################################################################
+ # XlibsMakefile                                                      #
+ # ------------------------------------------------------------------ #
+ # Copyright (c) 1992 by Thomas Wolfram, Berlin, Germany              #
+ # Auxiliary makefile for mkshtmpl.sh 1.4, version 1.2                #
+ # Author: Thomas Wolfram, thomas@aeon.in-berlin.de,                  #
+ #         wolf@prz.tu-berlin.de                                      #
+ ######################################################################
+ #
+ # This makefile creates for a certain X library a file with symbols
+ # defined in other X libraries, which can be sorted out from the
+ # set of imported symbols, these references will resolved via
+ # the #object noload directive
+ #
+ # WARNING! This makefile don't work with ISC's make!
+ # GNU make 3.62 is strongly recommended!
+ 
+       SHELL = /bin/sh
+ # Not really needed for GNU make, but looks better...
+   _NULLCMD_ = @echo -n
+ 
+ all:
+ 	@echo "This file should be called only from \
+ inside mkshtmpl.sh" >&2
+ 
+ # GNU make don't like empty rules, so give it $(_NULLCMD_)
+ libX11.A:  independent
+ 	$(_NULLCMD_)
+ libXt.A:   libX11.rule
+ 	$(_NULLCMD_)
+ libXmu.A:  libX11.rule libXt.rule
+ 	$(_NULLCMD_)
+ libXaw.A:  libX11.rule libXt.rule libXmu.rule
+ 	$(_NULLCMD_)
+ libXext.A: libX11.rule
+ 	$(_NULLCMD_)
+ libXi.A:   libX11.rule libXext.rule
+ 	$(_NULLCMD_)
+ 
+ independent:
+ 	@echo "$$LIB doesn't depend on another X lib... Nothing to do."
+ 
+ .SUFFIXES: .rule
+ .DEFAULT:
+ 	@echo -n "$$LIB is dependent on $*... " 
+ 	@(OBJNL=`echo "libX11 ../X libXt libXmu libXaw\n\
+ libX11 ../../lib/X libXext\n\
+ libX11 ../../../lib/X libXi\n\
+ libXt ../Xt libXmu libXaw\n\
+ libXmu ../Xmu libXaw\n\
+ libXext .. libXi\n\
+ " | nawk '$$1 == XLIB { print $$2, $$3, $$4, $$5 }' XLIB=$* | \
+ grep $$LIB | cut -f1 -d' '`; \
+ LIBPATH=`echo "\
+ libX11 ../../lib/X\n\
+ libXt ../../lib/Xt\n\
+ libXmu ../../lib/Xmu\n\
+ libXaw ../../lib/Xaw\n\
+ libXext ../../extensions/lib\n\
+ libXi ../../extensions/lib/xinput\n\
+ " | grep $* | cut -f3 -d' '` ; \
+ 	nm -ep $${LIBPATH}/$*.a | nawk '$$2 ~ /^[C|D|T]$$/ \
+ { print LIB " A " $$3 }' LIB=$*.a >>$${TMPDIR}/$${LIB}.A ; \
+ echo $${OBJNL}/$*_s.a >>$${TMPDIR}/$${LIB}.nol)
+ 	@echo Done.
+ 
+ # to avoid undesired things...
+ .c.o:
+ 	$(_NULLCMD_)
+ .c:
+ 	$(_NULLCMD_)
diff -c /dev/null mit/util/mksv3shlib/chkimports.sh:1.1
*** /dev/null	Sat Mar 12 00:40:00 1994
--- mit/util/mksv3shlib/chkimports.sh	Sat Mar 12 00:40:01 1994
***************
*** 0 ****
--- 1,91 ----
+ #!/bin/sh
+ ######################################################################
+ # chkimports.sh 1.4                                                  #
+ # ------------------------------------------------------------------ #
+ # Checking for incorrect differences of imported symbols between     #
+ # the archive and shared version of a library                        #
+ # Copyright (c) 1992 by Thomas Wolfram, Berlin, Germany              #
+ # (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de                   #
+ ######################################################################
+ 
+ if [ "$1" = "" -o "`echo $1 | cut -f2 -d_`" != "s.a" ] ; then
+         echo $0: no host shared library name specified. >&2
+         exit 1
+ fi
+ if [ ! -f $1 ] ; then
+         echo $0: named host shared library doesn\'t exist. >&2
+         exit 1
+ fi
+ 
+ version="1.4"
+ LIB=`basename $1 | cut -f1 -d_` ; export LIB
+ TMPDIR=${TMPDIR:=/usr/tmp} ; export TMPDIR
+ 
+ if [ ! -f ${LIB}/exports.out ] ; then
+         echo $0: ${LIB}/exports.out doesn\'t exist. Run mkshtmpl.sh first! >&2
+         exit 1
+ fi
+ if [ ! -f ${LIB}/imports.out ] ; then
+         echo $0: ${LIB}/imports.out doesn\'t exist. Run mkshtmpl.sh first! >&2
+         exit 1
+ fi
+ 
+ echo Checking for incorrect differences of imported symbols between the
+ echo archive and shared version of ${LIB}...
+ 
+ echo -n "Collecting all imported symbols of archive library... "
+ 
+ # creating modified file with imported symbols
+ nawk '{ print "IMPORTED 0 " $2 }' LIB=$LIB \
+  ${LIB}/imports.out >${TMPDIR}/${LIB}.imp2
+ 
+ # merge and sort by name and type
+ sort +2 +1 ${LIB}/exports.out ${TMPDIR}/${LIB}.imp2 >${TMPDIR}/${LIB}.oi
+ 
+ # create file of imported symbols with object names of all library members
+ # for archive version
+ 
+ nawk '{ if ($3 == IMP)  print ; \
+ 	else if ($1 == "IMPORTED") IMP=$3 ; \
+       }' \
+  ${TMPDIR}/${LIB}.oi >${TMPDIR}/${LIB}.aimp
+ 
+ # sort by object and function
+ sort +0 +2 -o${TMPDIR}/${LIB}.aimp ${TMPDIR}/${LIB}.aimp
+ echo Done.
+ 
+ 
+ echo -n "Collecting all imported symbols of shared library... "
+ 
+ # create file of imported symbols with object names of all library members
+ # for shared version
+ 
+ nm -ep $1 | \
+ nawk "\$1 ~ /lib.*\.a/ { OBJ=substr(\$1, index(\$1,\"[\")+1, \
+ index(\$1,\"]\")-index(\$1,\"[\")-1)  } ; \
+ \$3 ~ /^_${LIB}_.*/ { print OBJ, \"0\", substr(\$3, length(\"_${LIB}_\")+1) }"\
+   >${TMPDIR}/${LIB}.simp
+ 
+ # sort by object and function
+ sort +0 +2 -o${TMPDIR}/${LIB}.simp ${TMPDIR}/${LIB}.simp
+ echo Done.
+ 
+ echo "Comparing... "
+ 
+ # merge and sort, then remove adjacent lines
+ sort +2 +0 +1 ${TMPDIR}/${LIB}.aimp ${TMPDIR}/${LIB}.simp | \
+ nawk '{ print $2, $1, $3 }' | \
+ uniq -c -1 | \
+ nawk '$1 == 1 { if ($2 == "0") \
+                    print "WARNING: shared \"" $3 "\" imports \"" $4 \
+                          "\" not used in archive version" ; \
+                 else \
+                    print "ERROR: shared \"" $3 "\" DOES NOT import \"" $4 \
+                          "\" used in archive version" ; \
+ }' >${LIB}/check.out
+ cat ${LIB}/check.out
+ echo "
+ These messages are recorded in ${LIB}/check.out. Check the sources and recompile
+ if necessary!"
+ echo READY.
+ 
diff -c /dev/null mit/util/mksv3shlib/datasize:1.1
*** /dev/null	Sat Mar 12 00:40:01 1994
--- mit/util/mksv3shlib/datasize	Sat Mar 12 00:40:01 1994
***************
*** 0 ****
--- 1,34 ----
+ #!/bin/sh
+ ######################################################################
+ # datasize 1.4                                                       #
+ # ------------------------------------------------------------------ #
+ # Compute size of .data and .bss section of an archive library       #
+ # Copyright (c) 1992 by Thomas Wolfram, Berlin, Germany              #
+ # (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de                   #
+ ######################################################################
+ 
+ if [ "$1" = "" ] ; then
+         echo $0: no archive library name specified. >&2
+         exit 1
+ fi
+ if [ ! -f $1 ] ; then
+         echo $0: named archive library doesn\'t exist. >&2
+         exit 1
+ fi
+ version="1.4"
+ LIB=`basename $1 | cut -f1 -d.` ; export LIB
+ TMPDIR=${TMPDIR:=/usr/tmp} ; export TMPDIR
+ 
+ echo "objects in $LIB.a which data > 0:"
+ echo "    object file = .data+.bss  (.data,  .bss)"
+ echo "--------------------------------------------"
+ size $1 |
+ nawk '$3 + $5 > 0 { printf "%15s = %10d  (%5d, %5d)\n", substr($1, 1,\
+  index($1, ":")-1), $3+$5, $3, $5 }'
+ 
+ echo "
+ Summary for $LIB.a:"
+ size $1 |
+ nawk '{ DATA += $3 ; BSS += $5 }; END { print ".data=" DATA \
+ ", .bss=" BSS  ", .data+.bss=" DATA + BSS }'
+ 
diff -c /dev/null mit/util/mksv3shlib/mkshtmpl.sh:1.1
*** /dev/null	Sat Mar 12 00:40:01 1994
--- mit/util/mksv3shlib/mkshtmpl.sh	Sat Mar 12 00:40:01 1994
***************
*** 0 ****
--- 1,416 ----
+ #!/bin/sh
+ ######################################################################
+ # mkshtmpl.sh 1.4                                                    #
+ # ------------------------------------------------------------------ #
+ # Make shared library template files from archive library            #
+ # Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany        #
+ # (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de		     #
+ ######################################################################
+ 
+ if [ "$1" = "" ] ; then
+ 	echo $0: no archive library name specified. >&2
+ 	exit 1
+ fi
+ if [ ! -f $1 ] ; then
+ 	echo $0: named archive library doesn\'t exist. >&2
+ 	exit 1
+ fi
+ version="1.4"
+ LIB=`basename $1 | cut -f1 -d.` ; export LIB
+ TMPDIR=${TMPDIR:=/usr/tmp} ; export TMPDIR
+ SVR3SHLIBADDR=sv3ShlibAddr
+ DEPMAKEFILE=XlibsMakefile
+ 
+ 
+ if [ ! -d ${LIB} ] ; then
+     echo Making directory ${LIB}...
+     mkdir ${LIB}
+ fi
+ 
+ echo Creating shared library description template files from archive ${LIB}.a...
+ 
+ echo -n "Collecting all external references... "
+ # create file of all external symbols with object names
+ nm -ep $1 | \
+ nawk '$1 ~ /lib.*\.a/ { OBJ=substr($1, index($1,"[")+1, \
+ index($1,"]")-index($1,"[")-1)  } ; \
+ $2 ~ /^[C|D|T|U]$/ { print OBJ, $2, $3 }' >${LIB}/exports.out
+ echo "Done.
+ `cat ${LIB}/exports.out | wc -l` external references found"
+ 
+ echo "Getting symbols from other libraries... "
+ > ${TMPDIR}/${LIB}.A
+ > ${TMPDIR}/${LIB}.nol
+ if [ -f ${DEPMAKEFILE} ] ; then
+ 	make ${LIB}.A -f ${DEPMAKEFILE}
+ 	cat ${TMPDIR}/${LIB}.A >> ${LIB}/exports.out
+ 	echo Done.
+ else
+ 	echo Makefile not found.
+ 	echo "****************************************************************"
+ 	echo Please check whether ${LIB}.a imports symbols you could resolve
+ 	echo via the \"#oject noload\" directive. If you want to do that
+ 	echo you must create an auxiliary makefile similar XlibsMakefile.
+         echo "****************************************************************"
+ fi
+ 
+ echo -n "Getting explicit defined symbols from ${LIB}/constData... "
+ if [ -f ${LIB}/constData ] ; then
+ 	cat ${LIB}/constData >> ${LIB}/exports.out
+ 	echo Done.
+ else
+ 	echo Not found.
+ 	echo "****************************************************************"
+ 	echo WARNING! Check the library sources whether they use e.g. ANSI-C
+ 	echo style global \"const\"ant data! ANSI-C compilers place these to
+ 	echo the .text section, and this script generates then an incorrect
+ 	echo branch table entry. Hence you should create for such symbols
+ 	echo a file ${LIB}/constData containing explicit definitions like e.g.:
+ 	echo \"foo.o D size\"
+ 	echo "****************************************************************"
+ fi
+ 
+ echo -n "Collecting all external, inside defined .text symbols... "
+ # sort bei name and type
+ sort +2 +1 -o${LIB}/exports.out ${LIB}/exports.out
+ # count and remove adjacent lines, counters later needed for #init table
+ uniq -2 -c ${LIB}/exports.out ${TMPDIR}/${LIB}.e
+ 
+ nawk '$3 == "T" { print $4 }' ${TMPDIR}/${LIB}.e >${TMPDIR}/${LIB}.T
+ echo "Done.
+ `cat ${TMPDIR}/${LIB}.T | wc -l` inside defined .text symbols found"
+ 
+ echo -n "Collecting all external, inside defined .data symbols... "
+ nawk '$3 == "C" { print $2, $4 }' ${TMPDIR}/${LIB}.e >${LIB}/common.out
+ if [ -s ${LIB}/common.out ] ; then
+ 	echo ""
+ 	echo "****************************************************************"
+ 	echo WARNING! Following symbols are \"common\":
+ 	echo ""
+ 	cat ${LIB}/common.out
+ 	echo ""
+ 	echo "(These names are recorded in ${LIB}/common.out)"
+ 	echo Probably you must change the appropriate source files to
+ 	echo initialize them explicitly, to force the compiler to put them
+ 	echo to the .data section!!!
+ 	echo "****************************************************************"
+ fi
+ nawk '$3 ~ /[C|D]/ { print $4 }' ${TMPDIR}/${LIB}.e >${TMPDIR}/${LIB}.CD
+ echo "Done.
+ `cat ${TMPDIR}/${LIB}.CD | wc -l` inside defined .data symbols found"
+ 
+ echo "Collecting all outside references (imported symbols)... "
+ nawk '$3 == "U" { print $1, $4, $2 }' ${TMPDIR}/${LIB}.e >${LIB}/imports.out
+ 
+ echo -n "Getting additional imported symbols from ${LIB}/addImports... "
+ if [ -f ${LIB}/addImports ] ; then
+ 	cat ${LIB}/addImports >> ${LIB}/imports.out
+ 	echo Done.
+ else
+ 	echo File not found.
+ fi
+ echo "Done.
+ `cat ${LIB}/imports.out | wc -l` imported symbols found"
+ 
+ # create import.h
+ # -------------------------------------------------------------------
+ 
+ echo -n "Creating ${LIB}/${LIB}.h (this is import.h)... "
+ echo "/* ${LIB} : import.h
+  * indirection defines
+  * Template created by $0 $version
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived from work of Thomas Roell
+  */
+ 
+ #ifndef _${LIB}_import
+ #define _${LIB}_import
+ #if defined(SVR3SHLIB) && !defined(SVR3SHDAT)
+ " > ${LIB}/${LIB}.h
+ nawk '
+ { if ($2 == "stat") {
+      print "/* prevent name conflict with struct stat */" ; 
+      print "#define " $2 "(path, buf) (*_"  LIB "_" $2 ")(path, buf)"
+   } 
+   else { 
+      if ($2 == "free") { 
+         print "/* prevent name conflict with member free of XFontSetMethods */" ;
+         print "#define " $2 "(ptr) (*_"  LIB "_" $2 ")(ptr)"
+      }
+      else { 
+         if ($2 == "close") {
+            print "/* prevent name conflict with member close of XIM */" ;
+            print "#define " $2 "(fd) (*_"  LIB "_" $2 ")(fd)"
+         }
+ 	else {
+ 	  if ($2 == "select") {
+ 	     print "/* prevent name conflict with bitfield select of _XtEventRec */" ;
+              print "#define " $2 "(max, rd, wr, ex, to) (*_"  LIB "_" $2 ")(max, rd, wr, ex, to)"
+ 	  }
+ 	  else print "#define " $2 "  (*_" LIB "_" $2 ")"
+ 	}
+      }
+   }
+ }' LIB=${LIB} ${LIB}/imports.out >>${LIB}/${LIB}.h
+ 
+ echo "
+ 
+ /* Imported functions declarations
+  * Why declaring some imported functions here?
+  * This should be done gracefully through including of the systems
+  * header files. Unfortunatly there are some source files don't
+  * include all headers they should include, there are also some functions
+  * nowhere declared in the systems headers and some are declared
+  * without "extern" and cause problems since the names are redefined
+  * and these declarations then become undesired false pointer definitions.
+  */
+ 
+ /* This section needs editing! It's only an example for the X libs. */
+ 
+ #ifdef __STDC__
+ extern int creat(char const *, unsigned short);
+ extern void exit(int);
+ extern int printf(char const *, ...);
+ extern int sprintf(char *, char const *, ...);
+ extern int sscanf(char *, char const *, ...);
+ extern int atoi(char const *);
+ extern int access(char const *, int);
+ extern unsigned int alarm(unsigned int);
+ extern unsigned int sleep(unsigned int);
+ extern int close(int);
+ extern int read(int, char *, unsigned int);
+ extern int write(int, char const *, unsigned int);
+ extern int grantpt(int);
+ extern char *ptsname(int);
+ extern int unlockpt(int);
+ extern char *getenv(char const *);
+ #else
+ extern int creat();
+ extern void exit();
+ extern int printf();
+ extern int sprintf();
+ extern int sscanf();
+ extern int atoi();
+ extern int access();
+ extern unsigned int alarm();
+ extern unsigned int sleep();
+ extern int close();
+ extern int read();
+ extern int write();
+ extern int grantpt();
+ extern char *ptsname();
+ extern int unlockpt();
+ extern char *getenv();
+ #endif
+ 
+ /* use char * also for __STDC__, the sources want it */ 
+ extern char *malloc(), *realloc(), *calloc();
+ 
+ #include <string.h>
+ 
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ 
+ extern void qsort();
+ extern int _flsbuf();
+ extern int _filbuf();
+ extern int ioctl();
+ extern int getmsg();
+ extern int putmsg();
+ 
+ extern unsigned short ntohs(), htons();
+ extern unsigned long ntohl(), htonl();
+ extern unsigned long inet_addr();
+ extern int connect();
+ extern int gethostname();
+ extern int setsockopt();
+ extern int socket();
+ extern int writev();
+ extern int gettimeofday();
+ " >> ${LIB}/${LIB}.h
+ 
+ echo "
+ /* Functions with ambiguous names */
+ 
+ #ifdef __STDC__
+ extern int close(int);
+ extern void free(void *);
+ #include <sys/time.h>
+ #include <sys/bsdtypes.h>
+ extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+ #else
+ extern int (*_${LIB}_close)();
+ extern void (*_${LIB}_free)();
+ extern int (*_${LIB}_select)();
+ #endif
+ 
+ #endif
+ #endif
+ " >> ${LIB}/${LIB}.h
+ echo Done.
+ 
+ 
+ # create globals.c
+ # -------------------------------------------------------------------
+ 
+ echo -n "Creating ${LIB}/${LIB}.c (this is globals.c or part of globals.c)... "
+ echo "/* ${LIB} : ${LIB}.c
+  * exported data
+  * Template created by $0 $version
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived from work of Thomas Roell
+  */
+ 
+ #ifdef SVR3SHLIB
+ 
+ #define VoidInit(var) void *var = 0
+ " >${LIB}/${LIB}.c
+ nawk '{ print "VoidInit(_" LIB "_" $2 ");" }' LIB=${LIB} \
+  ${LIB}/imports.out >>${LIB}/${LIB}.c
+ echo "
+ 
+ #ifndef __GNUC__
+ /*
+  * If we are working with floating point aritmetic, stock AT&T cc generates
+  * an unresolved reference to __fltused. But we want to make a shared lib from
+  * this here and don't want to reference /lib/libc_s.a, just define this sym as
+  * (shared lib) static.
+  * The trick is that while building the shared lib all references to this
+  * symbol are resolved internally. But the symbol will be outside only visible
+  * as a static one, so preventing a name conflict with other shared libs.
+  */
+ long __fltused = 0;
+ #endif
+ 
+ /*
+  * A free place for free branchtab-slots.
+  * 
+  * This would be a great place for an error-check mechanism for shared libs ...
+  */
+ extern void _${LIB}_dummy() {};
+ 
+ #endif
+ 
+ " >>${LIB}/${LIB}.c
+ echo Done.
+ 
+ 
+ # create lib*.def
+ # -------------------------------------------------------------------
+ 
+ echo Creating ${LIB}/${LIB}.def...
+ echo -n "Creating #address statements... "
+ TEXT_ADR=`grep ${LIB} ${SVR3SHLIBADDR} | cut -f2 -d:`
+ DATA_ADR=`grep ${LIB} ${SVR3SHLIBADDR} | cut -f3 -d:`
+ echo "/* ${LIB} : ${LIB}.def
+  * shared library description file
+  * Template created by $0 $version
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived from work of Thomas Roell
+  */
+ 
+ /**/#address .text 0x${TEXT_ADR}
+ /**/#address .data 0x${DATA_ADR}
+ 
+ " > ${LIB}/${LIB}.def
+ 
+ if [ -s ${TMPDIR}/${LIB}.nol ] ; then
+ 	echo "/**/#objects noload" >> ${LIB}/${LIB}.def
+ 	cat ${TMPDIR}/${LIB}.nol >> ${LIB}/${LIB}.def
+ fi
+ 
+ echo "
+ /**/#branch" >> ${LIB}/${LIB}.def
+ echo Done.
+ 
+ echo -n "Creating #branch table from exported .text symbols... "
+ nawk '{ print $1, ++BRANCH }; END { print ; \
+ print "_" LIB "_dummy " ++BRANCH "-???" }' LIB=${LIB} ${TMPDIR}/${LIB}.T >> ${LIB}/${LIB}.def
+ echo "/* ^^^must be edited^^^ */" >> ${LIB}/${LIB}.def
+ echo Done.
+ 
+ echo -n "Creating #objects table... "
+ echo "
+ 
+ /**/#objects
+ DOWN/globals.o  /* All objects with global data must be at come first!*/" \
+  >> ${LIB}/${LIB}.def
+ ar t $1 | egrep -v '^globals.o$' | sort >${TMPDIR}/${LIB}.objs
+ nawk '{ print "DOWN/" $1 }' ${TMPDIR}/${LIB}.objs >> ${LIB}/${LIB}.def
+ echo Done.
+ 
+ # put initialization code of indirection defines to global.o if it is
+ # used more than once, if only once put it to respective object
+ # file (arbitrary algorithm)
+ echo -n "Creating #init tables... "
+ echo "
+ 
+ /* init sections needs editing!
+  */
+ 
+ /**/#init globals.o" >> ${LIB}/${LIB}.def
+ nawk '$1 > 1 { print "_" LIB "_" $2 "  " $2 }' LIB=${LIB} \
+  ${LIB}/imports.out >> ${LIB}/${LIB}.def
+ # sort by object name
+ sort +2 -o${LIB}/imports.out ${LIB}/imports.out
+ nawk '$1 == 1 { if ($3 != OBJ) { OBJ=$3 ; print "" ; \
+ print "/**/#init " $3 } ; print "_" LIB "_" $2 "  " $2 }' \
+ LIB=${LIB}  ${LIB}/imports.out >> ${LIB}/${LIB}.def
+ echo Done.
+ 
+ # here just guess...
+ echo -n "Creating #hide/#export linker section... "
+ echo "
+ 
+ /* This section needs editing! Check which
+  * symbols must be really extern.
+  */
+ 
+ /**/#hide linker *
+ /**/#export linker" >> ${LIB}/${LIB}.def
+ cat ${TMPDIR}/${LIB}.CD >>${LIB}/${LIB}.def
+ echo Done.
+ 
+ 
+ echo -n "Creating dummy trailer... "
+ echo "
+ 
+ /**/#libraries
+ /* Here can objects be specified, which will extracted from
+  * an specified archive library and then linked to the shared
+  * library. This can avoid unwanted referencing of other
+  * shared libraries.
+  * NOTE: this objects must be listed also under "#objects"!
+  * e.g.:
+ /lib/libc.a memcpy.o
+  * or e.g.:
+ #ifdef __GNUC__
+ GNULIB  _fixdfsi.o
+ #endif
+  *
+  * NOT USED YET
+  *
+  */
+ 
+ /**/#externals
+ /* Here you can specify objects which will only linked to the
+  * host shared library.
+  * That are e.g. objects which contain only big data you want
+  * to seperate from the text section. (See mit/util/mksv3shlib/README.)
+  */
+ 
+ /* There must be a comment as last line */" >> ${LIB}/${LIB}.def
+ echo Done.
+ 
+ #rm -f ${TMPDIR}/${LIB}.nol
+ #rm -f ${TMPDIR}/${LIB}.A
+ #rm -f ${TMPDIR}/${LIB}.T
+ #rm -f ${TMPDIR}/${LIB}.CD
+ #rm -f ${TMPDIR}/${LIB}.e
+ #rm -f ${TMPDIR}/${LIB}.objs
+ 
+ echo READY.
+ 
diff -c /dev/null mit/util/mksv3shlib/sv3ShlibAddr:1.1
*** /dev/null	Sat Mar 12 00:40:03 1994
--- mit/util/mksv3shlib/sv3ShlibAddr	Sat Mar 12 00:40:03 1994
***************
*** 0 ****
--- 1,32 ----
+ 
+ # sv3ShlibAddr
+ # ------------
+ # SVR3.2 shared library address ranges
+ # Author: Thomas Wolfram, thomas@aeon.in-berlin.de,
+ #         wolf@prz.tu-berlin.de
+ 
+ #Name   :  TEXT  :  DATA
+ # generic X libraries (XFree86 1.2)
+ libX11  :B0000000:B0400000
+ libXt   :B0800000:B0C00000
+ libXmu  :B1000000:B1400000
+ libXaw  :B1800000:B1C00000
+ libXext :B2000000:B2400000
+ 
+ # XView (these were the ranges in X386 1.1b)
+ libolgx :B2800000:B2C00000
+ libxview:B3000000:B3400000
+ 
+ # new R5 library (XFree86 1.2)
+ libXi   :B3800000:B3C00000
+ 
+ # empty slots
+         :B4000000:B4400000
+         :B4800000:B4C00000
+ 
+ # for Motif 1.2.1
+ libXm   :B5000000:B5400000
+ libUil  :B5800000:B5C00000
+ libMrm  :B6000000:B6400000
+ 
+ 
diff -c /dev/null mit/util/mksv3shlib/libX11/addImports:1.1
*** /dev/null	Sat Mar 12 00:40:04 1994
--- mit/util/mksv3shlib/libX11/addImports	Sat Mar 12 00:40:04 1994
***************
*** 0 ****
--- 1,5 ----
+ 100 XauDisposeAuth globals.o
+ 100 XauFileName globals.o
+ 100 XauGetBestAuthByAddr globals.o
+ 100 XauReadAuth globals.o
+ 100 _Xevent_to_mask globals.o
diff -c /dev/null mit/util/mksv3shlib/libX11/constData:1.1
*** /dev/null	Sat Mar 12 00:40:04 1994
--- mit/util/mksv3shlib/libX11/constData	Sat Mar 12 00:40:05 1994
***************
*** 0 ****
--- 1,2 ----
+ evtomask.o D _Xevent_to_mask
+ XStrKeysym.o D _XkeyTable
diff -c /dev/null mit/util/mksv3shlib/libXt/addImports:1.1
*** /dev/null	Sat Mar 12 00:40:05 1994
--- mit/util/mksv3shlib/libXt/addImports	Sat Mar 12 00:40:05 1994
***************
*** 0 ****
--- 1 ----
+ 100 _XtInherit globals.o
diff -c /dev/null mit/util/mksv3shlib/libXt/constData:1.1
*** /dev/null	Sat Mar 12 00:40:05 1994
--- mit/util/mksv3shlib/libXt/constData	Sat Mar 12 00:40:06 1994
***************
*** 0 ****
--- 1,4 ----
+ Converters.o D colorConvertArgs
+ Converters.o D screenConvertArg
+ StringDefs.o D XtStrings
+ StringDefs.o D XtShellStrings
diff -c mit/util/scripts/Imakefile:1.1.1.1 mit/util/scripts/Imakefile:2.2
*** mit/util/scripts/Imakefile:1.1.1.1	Sat Mar 12 00:40:08 1994
--- mit/util/scripts/Imakefile	Sat Mar 12 00:40:08 1994
***************
*** 1,30 ****
  XCOMM $XConsortium: Imakefile,v 1.23 92/04/14 18:46:59 rws Exp $
  #if UseCCMakeDepend
  MDEP_PROG = makedepend
  #endif
!          PROGRAMS = xmkmf $(MDEP_PROG) mergelib
  
  all:: $(PROGRAMS)
  
  CppScriptTarget(xmkmf,xmkmf.cpp,-DCONFIGDIRSPEC='"'"-I$(CONFIGDIR)"'"',$(ICONFIGFILES))
  #if UseCCMakeDepend
  CppScriptTarget(makedepend,mdepend.cpp,-DPREPROC='"'"$(PREPROCESSCMD)"'"',$(ICONFIGFILES))
  #endif
  CppScriptTarget(mergelib,mergelib.cpp,"-DARCMD=$(AR)" "-DRANLIB=$(RANLIB)",$(ICONFIGFILES))
  
! InstallNamedProg(xmkmf,xmkmf,$(BINDIR))
  InstallManPage(xmkmf,$(MANDIR))
! InstallNamedProg(mkdirhier.sh,mkdirhier,$(BINDIR))
  InstallManPage(mkdirhier,$(MANDIR))
  #if UseCCMakeDepend
! InstallNamedProg(makedepend,makedepend,$(BINDIR))
  #endif
! InstallNamedProg(lndir.sh,lndir,$(BINDIR))
  InstallManPage(lndir,$(MANDIR))
! InstallNamedProg(xon.sh,xon,$(BINDIR))
  InstallManPage(xon,$(MANDIR))
  #if SystemV || SystemV4
! InstallNamedProg(bsdinst.sh,bsdinst,$(BINDIR))
  #endif
  
  clean::
--- 1,58 ----
+ XCOMM $XFree86: mit/util/scripts/Imakefile,v 2.2 1994/02/19 09:32:33 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.23 92/04/14 18:46:59 rws Exp $
  #if UseCCMakeDepend
  MDEP_PROG = makedepend
  #endif
! #if HasGcc
! GMDEP_PROG = gccmakedep
! #endif
!          PROGRAMS = xmkmf $(MDEP_PROG) $(GMDEP_PROG) mergelib lndir xon
  
  all:: $(PROGRAMS)
  
+ #ifdef LinuxArchitecture
+          LSAFFLAG = -a
+ #else
+          LSAFFLAG = -af
+ #endif
+ 
+ #ifdef i386Sco
+            RSHCMD = rcmd 
+ #else
+            RSHCMD = rsh
+ #endif
+ 
  CppScriptTarget(xmkmf,xmkmf.cpp,-DCONFIGDIRSPEC='"'"-I$(CONFIGDIR)"'"',$(ICONFIGFILES))
  #if UseCCMakeDepend
  CppScriptTarget(makedepend,mdepend.cpp,-DPREPROC='"'"$(PREPROCESSCMD)"'"',$(ICONFIGFILES))
  #endif
+ #if HasGcc
+ CppScriptTarget(gccmakedep,gccmdep.cpp,-DCCCMD='"'"$(CC)"'"' -DRMCMD='"'"$(RM)"'"' -DLNCMD='"'"$(LN)"'"' -DMVCMD='"'"$(MV)"'"',$(ICONFIGFILES))
+ #endif
  CppScriptTarget(mergelib,mergelib.cpp,"-DARCMD=$(AR)" "-DRANLIB=$(RANLIB)",$(ICONFIGFILES))
+ CppScriptTarget(lndir,lndir.cpp,-DLSAF=$(LSAFFLAG),NullParameter)
+ CppScriptTarget(xon,xon.cpp,-DRSHCMD=$(RSHCMD),NullParameter)
+ 
+ #ifndef InstallNamedScript
+ #define InstallNamedScript	InstallNamedProg
+ #endif
  
! InstallNamedScript(xmkmf,xmkmf,$(BINDIR))
  InstallManPage(xmkmf,$(MANDIR))
! InstallNamedScript(mkdirhier.sh,mkdirhier,$(BINDIR))
  InstallManPage(mkdirhier,$(MANDIR))
  #if UseCCMakeDepend
! InstallNamedScript(makedepend,makedepend,$(BINDIR))
! #endif
! #if HasGcc
! InstallNamedScript(gccmakedep,gccmakedep,$(BINDIR))
  #endif
! InstallNamedScript(lndir,lndir,$(BINDIR))
  InstallManPage(lndir,$(MANDIR))
! InstallNamedScript(xon,xon,$(BINDIR))
  InstallManPage(xon,$(MANDIR))
  #if SystemV || SystemV4
! InstallNamedScript(bsdinst.sh,bsdinst,$(BINDIR))
  #endif
  
  clean::
diff -c /dev/null mit/util/scripts/aminstall.sh:1.1
*** /dev/null	Sat Mar 12 00:40:08 1994
--- mit/util/scripts/aminstall.sh	Sat Mar 12 00:40:08 1994
***************
*** 0 ****
--- 1,52 ----
+ #!/bin/sh
+ #
+ # $XFree86: mit/util/scripts/aminstall.sh,v 1.1 1993/03/20 02:36:18 dawes Exp $
+ #
+ # Usage: aminstall binary-directory unix-source amoeba-dest
+ #
+ 
+ #
+ # Default soap mask for files
+ #
+ SPMASK=0xFF:2:2
+ export SPMASK
+ 
+ #
+ # Argument check
+ #
+ case $# in
+ 3)	;;
+ *)	echo "Usage: $0 binary-directory unix-source amoeba-dest" >&2
+ 	exit 1
+ 	;;
+ esac
+ 
+ #
+ # Change /public .... into /super (just for installation)
+ #
+ dest=$3
+ stripped=`echo $dest | sed 's:^/public::'`
+ if [ X$dest != X$stripped ]; then
+     dest=/super$stripped
+ fi
+ 
+ #
+ # If the file already exists, then delete it
+ #
+ INFO=`$1/std_info $dest 2>&1`
+ case $INFO in
+ *"not found"*)	;;
+ *failed*)	;;
+ *bytes*)	$1/del -f $dest
+ 		;;
+ /??????)	echo $0: cannot install over directory 1>&2
+ 		exit
+ 		;;
+ *)		$1/del -d $dest
+ 		;;
+ esac
+ 
+ #
+ # Transfer the file to Amoeba
+ #
+ $1/tob $2 $dest
diff -c /dev/null mit/util/scripts/ammkdirhier.sh:1.1
*** /dev/null	Sat Mar 12 00:40:08 1994
--- mit/util/scripts/ammkdirhier.sh	Sat Mar 12 00:40:08 1994
***************
*** 0 ****
--- 1,43 ----
+ #!/bin/sh
+ #
+ # $XFree86: mit/util/scripts/ammkdirhier.sh,v 1.1 1993/03/20 02:36:20 dawes Exp $
+ #
+ # Create a hierarchy of directories
+ #
+ # Usage: ammkdirhier binary-directory directories ...
+ #
+ abin=$1
+ shift
+ 
+ #
+ # Default soap mask for directories
+ #
+ SPMASK=0xFF:2:4
+ export SPMASK
+ 
+ #
+ # All the references to /public... are changed in /super...
+ #
+ for f in $*; do
+     parts=`echo $f | sed 's,\(.\)/\(.\),\1 \2,g' | sed 's,/$,,'`;
+     path="";
+     for p in $parts; do
+ 	if [ x"$path" = x ]; then
+ 	    if [ x$p = x/public ]; then
+ 		dir=/super
+ 	    else
+ 		dir=$p;
+ 	    fi
+ 	else
+ 	    dir=$path/$p;
+ 	fi;
+ 	if $abin/std_info $dir >/dev/null 2>&1; then
+ 	    : nothing
+ 	else
+ 	    echo + mkd $dir; 
+ 	    $abin/mkd $dir;
+ 	fi
+ 	path=$dir;
+     done;
+ done
+ 
diff -c mit/util/scripts/bsdinst.sh:1.1.1.1 mit/util/scripts/bsdinst.sh:1.5
*** mit/util/scripts/bsdinst.sh:1.1.1.1	Sat Mar 12 00:40:09 1994
--- mit/util/scripts/bsdinst.sh	Sat Mar 12 00:40:09 1994
***************
*** 1,9 ****
  #!/bin/sh
! 
  #
  # This accepts bsd-style install arguments and makes the appropriate calls
  # to the System V install.
  #
  
  flags=""
  dst=""
--- 1,14 ----
  #!/bin/sh
! #
! # $XFree86: mit/util/scripts/bsdinst.sh,v 1.5 1993/03/27 08:54:45 dawes Exp $
  #
  # This accepts bsd-style install arguments and makes the appropriate calls
  # to the System V install.
  #
+ # If /usr/ucb/install is available, use it.   (DHD May 1992)
+ #
+ # If '-s' is specified, also run 'mcs -d' (dwex)
+ #
  
  flags=""
  dst=""
***************
*** 10,16 ****
--- 15,23 ----
  src=""
  dostrip=""
  owner=""
+ group=""
  mode=""
+ bargs=$*
  
  while [ x$1 != x ]; do
      case $1 in 
***************
*** 30,35 ****
--- 37,43 ----
  	    continue;;
  
  	-g) flags="$flags $1 $2 "
+ 	    group="$2"
  	    shift
  	    shift
  	    continue;;
***************
*** 49,66 ****
      esac
  done
  
- case "$mode" in
- "")
- 	;;
- *)
- 	case "$owner" in
- 	"")
- 		flags="$flags -u root"
- 		;;
- 	esac
- 	;;
- esac
- 
  if [ x$src = x ] 
  then
  	echo "bsdinst:  no input file specified"
--- 57,62 ----
***************
*** 73,78 ****
--- 69,105 ----
  	exit 1
  fi
  
+ if [ -x /usr/ucb/install ]
+ then
+ 	if [ -d "$dst" ]
+ 	then
+ 		dst=$dst/`basename "$src"`
+ 	fi
+ 	case "$group" in
+ 	"")
+ 		bargs="-g other $bargs"
+ 		;;
+ 	esac
+ 	/usr/ucb/install $bargs
+ 	if [ x$dostrip = xstrip -a -x /usr/bin/mcs ]
+ 	then
+ 		/usr/bin/mcs -d $dst
+ 	fi
+ 	exit 0
+ fi
+ 	
+ case "$mode" in
+ "")
+ 	;;
+ *)
+ 	case "$owner" in
+ 	"")
+ 		flags="$flags -u root"
+ 		;;
+ 	esac
+ 	;;
+ esac
+ 
  
  # set up some variable to be used later
  
***************
*** 128,133 ****
--- 155,164 ----
  if [ x$dostrip = xstrip ]
  then
  	strip $dst/$srcbase
+ 	if [ -x /usr/bin/mcs ]
+ 	then
+ 		/usr/bin/mcs -d $dst/$srcbase
+ 	fi
  fi
  
  # and clean up
diff -c /dev/null mit/util/scripts/gccmdep.cpp:2.3
*** /dev/null	Sat Mar 12 00:40:09 1994
--- mit/util/scripts/gccmdep.cpp	Sat Mar 12 00:40:10 1994
***************
*** 0 ****
--- 1,126 ----
+ XCOMM!/bin/sh
+ 
+ XCOMM
+ XCOMM makedepend which uses 'gcc -M'
+ XCOMM
+ XCOMM $XFree86: mit/util/scripts/gccmdep.cpp,v 2.3 1994/03/07 14:06:54 dawes Exp $
+ XCOMM
+ XCOMM Based on mdepend.cpp and code supplied by Hongjiu Lu <hjl@nynexst.com>
+ XCOMM
+ 
+ TMP=/tmp/mdep$$
+ CC=CCCMD
+ RM=RMCMD
+ LN=LNCMD
+ MV=MVCMD
+ 
+ trap "$RM ${TMP}*; exit 1" 1 2 15
+ trap "$RM ${TMP}*; exit 0" 1 2 13
+ 
+ files=
+ makefile=
+ endmarker=
+ magic_string='# DO NOT DELETE'
+ append=n
+ args=
+ asmfiles=
+ 
+ while [ $# != 0 ]; do
+     if [ "$endmarker"x != x -a "$endmarker" = "$1" ]; then
+ 	endmarker=
+     else
+ 	case "$1" in
+ 	    -D*|-I*)
+ 		args="$args '$1'"
+ 		;;
+ 	    -g|-o)
+ 		;;
+ 	    *)
+ 		if [ "$endmarker"x = x ]; then
+ 		    case $1 in
+ XCOMM ignore these flags
+ 			-w|-o|-cc)
+ 			    shift
+ 			    ;;
+ 			-v)
+ 			    ;;
+ 			-s)
+ 			    magic_string="$2"
+ 			    shift
+ 			    ;;
+ 			-f)
+ 			    makefile="$2"
+ 			    shift
+ 			    ;;
+ 			--*)
+ 			    endmarker=`echo $1 | sed 's/^\-\-//'`
+ 			    if [ "$endmarker"x = x ]; then
+ 				endmarker="--"
+ 			    fi
+ 			    ;;
+ 			-a)
+ 			    append=y
+ 			    ;;
+ 			-*)
+ 			    echo "Unknown option '$1' ignored" 1>&2
+ 			    ;;
+ 			*)
+ 			    files="$files $1"
+ 			    ;;
+ 		    esac
+ 		fi
+ 		;;
+ 	esac
+     fi
+     shift
+ done
+ 
+ if [ x"$files" = x ]; then
+ XCOMM Nothing to do
+     exit 0
+ fi
+ 
+ case "$makefile" in
+     '')
+ 	if [ -r makefile ]; then
+ 	    makmefile=makefile
+ 	elif [ -r Makefile ]; then
+ 	    makefile=Makefile
+ 	else
+ 	    echo 'no makefile or Makefile found' 1>&2
+ 	    exit 1
+ 	fi
+ 	;;
+ esac
+ 
+ if [ x"$append" = xn ]; then
+     sed -e "/^$magic_string/,\$d" < $makefile > $TMP
+     echo "$magic_string" >> $TMP
+ else
+     cp $makefile $TMP
+ fi
+ 
+ XCOMM need to link .s files to .S
+ for i in $files; do
+     case $i in
+ 	*.s)
+ 	    dir=`dirname $i`
+ 	    base=`basename $i .s`
+ 	    (cd $dir; $RM ${base}.S; $LN ${base}.s ${base}.S)
+ 	    asmfiles="$asmfiles ${base}.S"
+ 	    ;;
+     esac
+ done
+ 
+ CMD="$CC -M $args `echo $files | sed 's,\.s,\.S,g'` | sed 's,\.S,\.s,'"
+ CMD="$CMD >> $TMP"
+ eval $CMD
+ $RM ${makefile}.bak
+ $MV $makefile ${makefile}.bak
+ $MV $TMP $makefile
+ 
+ if [ x"$asmfiles" != x ]; then
+     $RM $asmfiles
+ fi
+ $RM ${TMP}*
+ exit 0
diff -c /dev/null mit/util/scripts/lndir.cpp:1.3
*** /dev/null	Sat Mar 12 00:40:10 1994
--- mit/util/scripts/lndir.cpp	Sat Mar 12 00:40:10 1994
***************
*** 0 ****
--- 1,87 ----
+ XCOMM! /bin/sh
+ 
+ XCOMM lndir - create shadow link tree
+ XCOMM
+ XCOMM $XFree86: mit/util/scripts/lndir.cpp,v 1.3 1993/05/16 13:16:00 dawes Exp $
+ XCOMM $XConsortium: lndir.sh,v 1.8 91/04/15 17:55:03 rws Exp $
+ XCOMM
+ XCOMM Used to create a copy of the a directory tree that has links for all
+ XCOMM non- directories (except those named RCS, CVS or SCCS).  If you are
+ XCOMM building the distribution on more than one machine, you should use
+ XCOMM this script.
+ XCOMM
+ XCOMM If your master sources are located in /usr/local/src/X and you would like
+ XCOMM your link tree to be in /usr/local/src/new-X, do the following:
+ XCOMM
+ XCOMM 	%  mkdir /usr/local/src/new-X
+ XCOMM	%  cd /usr/local/src/new-X
+ XCOMM 	%  lndir ../X
+ 
+ USAGE="Usage: $0 fromdir [todir]"
+ 
+ if [ $# -lt 1 -o $# -gt 2 ]
+ then
+ 	echo "$USAGE"
+ 	exit 1
+ fi
+ 
+ DIRFROM=$1
+ 
+ if [ $# -eq 2 ];
+ then
+ 	DIRTO=$2
+ else
+ 	DIRTO=.
+ fi
+ 
+ if [ ! -d $DIRTO ]
+ then
+ 	echo "$0: $DIRTO is not a directory"
+ 	echo "$USAGE"
+ 	exit 2
+ fi
+ 
+ cd $DIRTO
+ 
+ if [ ! -d $DIRFROM ]
+ then
+ 	echo "$0: $DIRFROM is not a directory"
+ 	echo "$USAGE"
+ 	exit 2
+ fi
+ 
+ pwd=`pwd`
+ 
+ if [ `(cd $DIRFROM; pwd)` = $pwd ]
+ then
+ 	echo "$pwd: FROM and TO are identical!"
+ 	exit 1
+ fi
+ 
+ for file in `ls LSAF $DIRFROM`
+ do
+     if [ ! -d $DIRFROM/$file ]
+     then
+ 	    ln -s $DIRFROM/$file .
+     else
+ 	    if [ $file != RCS -a $file != CVS -a $file != SCCS -a \
+ 		 $file != . -a $file != .. ]
+ 	    then
+ 		    echo $file:
+ 		    mkdir $file
+ 		    (cd $file
+ 		     pwd=`pwd`
+ 		     case "$DIRFROM" in
+ 			     /?*) ;;
+ 			     *)  DIRFROM=../$DIRFROM ;;
+ 		     esac
+ 		     if [ `(cd $DIRFROM/$file; pwd)` = $pwd ]
+ 		     then
+ 			    echo "$pwd: FROM and TO are identical!"
+ 			    exit 1
+ 		     fi
+ 		     $0 $DIRFROM/$file
+ 		    )
+ 	    fi
+     fi
+ done
diff -c mit/util/scripts/mdepend.cpp:1.1.1.1 mit/util/scripts/mdepend.cpp:1.2
*** mit/util/scripts/mdepend.cpp:1.1.1.1	Sat Mar 12 00:40:10 1994
--- mit/util/scripts/mdepend.cpp	Sat Mar 12 00:40:11 1994
***************
*** 1,5 ****
--- 1,6 ----
  XCOMM!/bin/sh
  XCOMM
+ XCOMM $XFree86: mit/util/scripts/mdepend.cpp,v 1.2 1993/04/20 15:47:59 dawes Exp $
  XCOMM $XConsortium: mdepend.cpp,v 1.7 91/08/22 11:42:53 rws Exp $
  XCOMM
  XCOMM	Do the equivalent of the 'makedepend' program, but do it right.
***************
*** 55,60 ****
--- 56,62 ----
  width=78
  endmarker=""
  verbose=n
+ append=n
  
  while [ $# != 0 ]
  do
***************
*** 100,105 ****
--- 102,110 ----
  			-v)
  			    verbose="y"
  			    ;;
+ 			-a)
+ 			    append="y"
+ 			    ;;
  
  			-cc)
  			    CC="$2"
***************
*** 209,219 ****
  $magic_string
  
  END_OF_APPEND
! ed $silent $makefile << END_OF_ED_SCRIPT
  /^$magic_string/+1,\$d
  w
  q
  END_OF_ED_SCRIPT
  echo '' >>$makefile
  cat $DEPENDLINES >>$makefile
  
--- 214,226 ----
  $magic_string
  
  END_OF_APPEND
! if [ "$append"x != "y"x ]; then 
! 	ed $silent $makefile << END_OF_ED_SCRIPT
  /^$magic_string/+1,\$d
  w
  q
  END_OF_ED_SCRIPT
+ fi
  echo '' >>$makefile
  cat $DEPENDLINES >>$makefile
  
diff -c mit/util/scripts/xmkmf.cpp:1.1.1.1 mit/util/scripts/xmkmf.cpp:1.3
*** mit/util/scripts/xmkmf.cpp:1.1.1.1	Sat Mar 12 00:40:11 1994
--- mit/util/scripts/xmkmf.cpp	Sat Mar 12 00:40:11 1994
***************
*** 3,8 ****
--- 3,9 ----
  XCOMM
  XCOMM generate a Makefile from an Imakefile from inside or outside the sources
  XCOMM 
+ XCOMM $XFree86: mit/util/scripts/xmkmf.cpp,v 1.3 1993/04/11 13:54:07 dawes Exp $
  XCOMM $XConsortium: xmkmf.cpp,v 1.18 91/08/22 11:08:01 rws Exp $
  
  usage="usage:  $0 [-a] [top_of_sources_pathname [current_directory]]"
***************
*** 35,41 ****
  fi
  
  if [ "$topdir" = "" ]; then
!     args="-DUseInstalled "CONFIGDIRSPEC
  else
      args="-I$topdir/config -DTOPDIR=$topdir -DCURDIR=$curdir"
  fi
--- 36,47 ----
  fi
  
  if [ "$topdir" = "" ]; then
!     if [ x"$XWINHOME" != x ]; then
! 	CONFIG_DIR_SPEC="-I$XWINHOME/lib/X11/config"
!     else
! 	CONFIG_DIR_SPEC=CONFIGDIRSPEC
!     fi
!     args="-DUseInstalled ""$CONFIG_DIR_SPEC"
  else
      args="-I$topdir/config -DTOPDIR=$topdir -DCURDIR=$curdir"
  fi
diff -c /dev/null mit/util/scripts/xon.cpp:2.0
*** /dev/null	Sat Mar 12 00:40:12 1994
--- mit/util/scripts/xon.cpp	Sat Mar 12 00:40:12 1994
***************
*** 0 ****
--- 1,114 ----
+ XCOMM!/bin/sh
+ 
+ XCOMM $XFree86: mit/util/scripts/xon.cpp,v 2.0 1993/09/10 05:50:10 dawes Exp $
+ XCOMM start up xterm (or any other X command) on the specified host
+ XCOMM Usage: xon host [arguments] [command]
+ case $# in
+ 0)
+ 	echo "Usage: $0 <hostname> [-user user] [-name window-name] [-debug]"
+ 	echo "[-screen screen-number] [command ...]"
+ 	exit 1
+ 	;;
+ esac
+ target=$1
+ shift
+ label=$target
+ resource=xterm-$label
+ rsh=RSHCMD
+ rcmd="$rsh $target"
+ case $DISPLAY in
+ unix:*)
+ 	DISPLAY=`echo $DISPLAY | sed 's/unix//'`
+ 	;;
+ esac
+ case $DISPLAY in
+ :*)
+ 	fullname=`hostname`
+ 	hostname=`echo $fullname | sed 's/\..*$//'`
+ 	if [ $hostname = $target -o $fullname = $target ]; then
+ 		DISPLAY=$DISPLAY
+ 		rcmd="sh -c"
+ 	else
+ 		DISPLAY=$fullname$DISPLAY
+ 	fi
+ 	;;
+ esac
+ username=
+ xauth=
+ case x$XUSERFILESEARCHPATH in
+ x)
+ 	xpath='HOME=${HOME-`pwd`} '
+ 	;;
+ *)
+ 	xpath='HOME=${HOME-`pwd`} XUSERFILESEARCHPATH=${XUSERFILESEARCHPATH-"'"$XUSERFILESEARCHPATH"'"} '
+ 	;;
+ esac
+ redirect=" < /dev/null > /dev/null 2>&1 &"
+ command=
+ ls=-ls
+ continue=:
+ while $continue; do
+ 	case $1 in
+ 	-user)
+ 		shift
+ 		username="-l $1"
+ 		label="$target $1"
+ 		rcmd="$rsh $target $username"
+ 		shift
+ 		case x$XAUTHORITY in
+ 		x)
+ 			XAUTHORITY="$HOME/.Xauthority"
+ 			;;
+ 		esac
+ 		case x$XUSERFILESEARCHPATH in
+ 		x)
+ 			;;
+ 		*)
+ 			xpath="XUSERFILESEARCHPATH=$XUSERFILESEARCHPATH "
+ 			;;
+ 		esac
+ 		;;
+ 	-access)
+ 		shift
+ 		xhost +$target
+ 		;;
+ 	-name)
+ 		shift
+ 		label="$1"
+ 		resource="$1"
+ 		shift
+ 		;;
+ 	-nols)
+ 		shift
+ 		ls=
+ 		;;
+ 	-debug)
+ 		shift
+ 		redirect=
+ 		;;
+ 	-screen)
+ 		shift
+ 		DISPLAY=`echo $DISPLAY | sed 's/:\\([0-9][0-9]*\\)\\.[0-9]/:\1/'`.$1
+ 		shift
+ 		;;
+ 	*)
+ 		continue=false
+ 		;;
+ 	esac
+ done
+ case x$XAUTHORITY in
+ x)
+ 	;;
+ x*)
+ 	xauth="XAUTHORITY=$XAUTHORITY "
+ 	;;
+ esac
+ vars="$xpath$xauth"DISPLAY="$DISPLAY"
+ case $# in
+ 0)
+ 	$rcmd 'sh -c '"'$vars"' xterm '$ls' -name "'"$resource"'" -T "'"$label"'" -n "'"$label"'" '"$redirect'"
+ 	;;
+ *)
+ 	$rcmd 'sh -c '"'$vars"' '"$*$redirect'"
+ 	;;
+ esac
diff -c mit/util/scripts/xon.sh:1.1.1.1 mit/util/scripts/xon.sh:removed
*** mit/util/scripts/xon.sh:1.1.1.1	Sat Mar 12 00:40:12 1994
--- mit/util/scripts/xon.sh	Sat Mar 12 00:40:12 1994
***************
*** 1,111 ****
- #!/bin/sh
- # start up xterm (or any other X command) on the specified host
- # Usage: xon host [arguments] [command]
- case $# in
- 0)
- 	echo "Usage: $0 <hostname> [-user user] [-name window-name] [-debug]"
- 	echo "[-screen screen-number] [command ...]"
- 	exit 1
- 	;;
- esac
- target=$1
- shift
- label=$target
- resource=xterm-$label
- rcmd="rsh $target"
- case $DISPLAY in
- unix:*)
- 	DISPLAY=`echo $DISPLAY | sed 's/unix//'`
- 	;;
- esac
- case $DISPLAY in
- :*)
- 	fullname=`hostname`
- 	hostname=`echo $fullname | sed 's/\..*$//'`
- 	if [ $hostname = $target -o $fullname = $target ]; then
- 		DISPLAY=$DISPLAY
- 		rcmd="sh -c"
- 	else
- 		DISPLAY=$fullname$DISPLAY
- 	fi
- 	;;
- esac
- username=
- xauth=
- case x$XUSERFILESEARCHPATH in
- x)
- 	xpath='HOME=${HOME-`pwd`} '
- 	;;
- *)
- 	xpath='HOME=${HOME-`pwd`} XUSERFILESEARCHPATH=${XUSERFILESEARCHPATH-"'"$XUSERFILESEARCHPATH"'"} '
- 	;;
- esac
- redirect=" < /dev/null > /dev/null 2>&1 &"
- command=
- ls=-ls
- continue=:
- while $continue; do
- 	case $1 in
- 	-user)
- 		shift
- 		username="-l $1"
- 		label="$target $1"
- 		rcmd="rsh $target $username"
- 		shift
- 		case x$XAUTHORITY in
- 		x)
- 			XAUTHORITY="$HOME/.Xauthority"
- 			;;
- 		esac
- 		case x$XUSERFILESEARCHPATH in
- 		x)
- 			;;
- 		*)
- 			xpath="XUSERFILESEARCHPATH=$XUSERFILESEARCHPATH "
- 			;;
- 		esac
- 		;;
- 	-access)
- 		shift
- 		xhost +$target
- 		;;
- 	-name)
- 		shift
- 		label="$1"
- 		resource="$1"
- 		shift
- 		;;
- 	-nols)
- 		shift
- 		ls=
- 		;;
- 	-debug)
- 		shift
- 		redirect=
- 		;;
- 	-screen)
- 		shift
- 		DISPLAY=`echo $DISPLAY | sed 's/:\\([0-9][0-9]*\\)\\.[0-9]/:\1/'`.$1
- 		shift
- 		;;
- 	*)
- 		continue=false
- 		;;
- 	esac
- done
- case x$XAUTHORITY in
- x)
- 	;;
- x*)
- 	xauth="XAUTHORITY=$XAUTHORITY "
- 	;;
- esac
- vars="$xpath$xauth"DISPLAY="$DISPLAY"
- case $# in
- 0)
- 	$rcmd 'sh -c '"'$vars"' xterm '$ls' -name "'"$resource"'" -T "'"$label"'" -n "'"$label"'" '"$redirect'"
- 	;;
- *)
- 	$rcmd 'sh -c '"'$vars"' '"$*$redirect'"
- 	;;
- esac
--- 0 ----
diff -c mit/include/Imakefile:1.1.1.1 mit/include/Imakefile:2.1
*** mit/include/Imakefile:1.1.1.1	Sat Mar 12 00:40:15 1994
--- mit/include/Imakefile	Sat Mar 12 00:40:15 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/include/Imakefile,v 2.1 1993/10/17 14:37:16 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.79 91/07/17 16:11:41 gildea Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags /**/
***************
*** 27,32 ****
--- 28,39 ----
  
  InstallMultiple($(HEADERS),$(INCDIR))
  MakeSubdirs($(SUBDIRS))
+ 
+ InstallLinkKitNonExecFile(X.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(Xmd.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(Xos.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(Xproto.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(Xprotostr.h,$(LINKKITDIR)/include)
  
  depend::
  
diff -c mit/include/X.h:1.1.1.1 mit/include/X.h:1.2
*** mit/include/X.h:1.1.1.1	Sat Mar 12 00:40:15 1994
--- mit/include/X.h	Sat Mar 12 00:40:15 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  *	$XFree86: mit/include/X.h,v 1.2 1993/03/20 02:23:42 dawes Exp $
   *	$XConsortium: X.h,v 1.66 88/09/06 15:55:56 jim Exp $
   */
  
***************
*** 244,249 ****
--- 245,251 ----
  #define FamilyInternet		0
  #define FamilyDECnet		1
  #define FamilyChaos		2
+ #define FamilyAmoeba		3
  
  /* Property notification */
  
diff -c mit/include/Xfuncs.h:1.1.1.1 mit/include/Xfuncs.h:2.1
*** mit/include/Xfuncs.h:1.1.1.1	Sat Mar 12 00:40:16 1994
--- mit/include/Xfuncs.h	Sat Mar 12 00:40:16 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/include/Xfuncs.h,v 2.1 1993/09/12 07:17:52 dawes Exp $
   * $XConsortium: Xfuncs.h,v 1.8 91/04/17 09:27:52 rws Exp $
   * 
   * Copyright 1990 by the Massachusetts Institute of Technology
***************
*** 35,41 ****
--- 36,44 ----
  #include <bstring.h>
  #else
  #ifdef SYSV
+ #ifndef ISC
  #include <memory.h>
+ #endif
  #if defined(_XBCOPYFUNC) && !defined(macII)
  #define bcopy _XBCOPYFUNC
  #define _XNEEDBCOPYFUNC
***************
*** 51,55 ****
--- 54,69 ----
  #endif /* sgi */
  #endif /* __STDC__ and relatives */
  #endif /* X_USEBFUNCS */
+ 
+ #ifdef X_BSDSELECT
+ /* For using BSDselect() from libXbsd.a */
+ int BSDselect(
+ #ifdef __STDC__
+ int , fd_set *, fd_set *, fd_set *, struct timeval *
+ #endif
+ );
+ 
+ #define select(a,b,c,d,e)	BSDselect(a,b,c,d,e)
+ #endif /* X_BSDSELECT */
  
  #endif /* _XFUNCS_H_ */
diff -c mit/include/Xmd.h:1.1.1.1 mit/include/Xmd.h:2.0
*** mit/include/Xmd.h:1.1.1.1	Sat Mar 12 00:40:16 1994
--- mit/include/Xmd.h	Sat Mar 12 00:40:16 1994
***************
*** 23,28 ****
--- 23,29 ----
  ******************************************************************/
  #ifndef XMD_H
  #define XMD_H 1
+ /* $XFree86: mit/include/Xmd.h,v 2.0 1993/12/10 14:33:26 dawes Exp $ */
  /* $XConsortium: Xmd.h,v 1.41 91/05/10 10:00:03 jap Exp $ */
  /*
   *  Xmd.h: MACHINE DEPENDENT DECLARATIONS.
***************
*** 60,66 ****
   * The extra indirection in the __STDC__ case is to get macro arguments to
   * expand correctly before the concatenation, rather than afterward.
   */
! #if __STDC__ && !defined(UNIXCPP)
  #define _SIZEOF(x) sz_##x
  #define SIZEOF(x) _SIZEOF(x)
  #else
--- 61,67 ----
   * The extra indirection in the __STDC__ case is to get macro arguments to
   * expand correctly before the concatenation, rather than afterward.
   */
! #if (__STDC__ && !defined(UNIXCPP)) || (defined (SOLX86) && defined (__STDC__))
  #define _SIZEOF(x) sz_##x
  #define SIZEOF(x) _SIZEOF(x)
  #else
diff -c mit/include/Xos.h:1.1.1.1 mit/include/Xos.h:2.4
*** mit/include/Xos.h:1.1.1.1	Sat Mar 12 00:40:17 1994
--- mit/include/Xos.h	Sat Mar 12 00:40:17 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/include/Xos.h,v 2.4 1994/02/10 21:23:22 dawes Exp $
   * $XConsortium: Xos.h,v 1.47 91/08/17 17:14:38 rws Exp $
   * 
   * Copyright 1987 by the Massachusetts Institute of Technology
***************
*** 24,29 ****
--- 25,43 ----
  #ifndef _XOS_H_
  #define _XOS_H_
  
+ #ifdef _MINIX
+ #include <minix/posix.h>
+ #endif /* _MINIX */
+ 
+ #ifdef SCO
+ #include <stdio.h>
+ #endif
+ 
+ /* Get value of BSD */
+ #if !defined(MACH) && !defined(MACH386) && !defined(__OSF__)
+ #include <sys/param.h>
+ #endif
+ 
  #include <X11/Xosdefs.h>
  
  /*
***************
*** 30,45 ****
   * 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)
  #undef _POSIX_SOURCE
  #include <sys/types.h>
  #define _POSIX_SOURCE
--- 44,62 ----
   * Get major data types (esp. caddr_t)
   */
  
! #if defined(USG) || defined(SYSV)
  #ifndef __TYPES__
  #ifdef CRAY
  #define word word_t
  #endif /* CRAY */
+ #ifdef ESIX
+ #define unchar u_char
+ #endif
  #include <sys/types.h>			/* forgot to protect it... */
  #define __TYPES__
  #endif /* __TYPES__ */
! #else /* USG || SYSV */
! #if defined(_POSIX_SOURCE) && (defined(MOTOROLA) || defined(AMOEBA))
  #undef _POSIX_SOURCE
  #include <sys/types.h>
  #define _POSIX_SOURCE
***************
*** 46,52 ****
  #else
  #include <sys/types.h>
  #endif
! #endif /* USG */
  
  
  /*
--- 63,69 ----
  #else
  #include <sys/types.h>
  #endif
! #endif /* USG || SYSV */
  
  
  /*
***************
*** 89,94 ****
--- 106,116 ----
  #ifdef SYSV386
  #include <unistd.h>
  #endif /* SYSV386 */
+ 
+ #if defined(ISC) && !defined(O_NDELAY)
+ #define O_NDELAY O_NONBLOCK
+ #endif /* ISC */
+ 
  #include <sys/file.h>
  #else /* X_NOT_POSIX */
  #if !defined(_POSIX_SOURCE) && defined(macII)
***************
*** 127,142 ****
  #endif /* USL_SHARELIB */
  #endif /* USG */
  
  #else /* not SYSV */
  
! #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
  #include <sys/time.h>
  #endif
  
  #endif /* SYSV */
  
--- 149,196 ----
  #endif /* USL_SHARELIB */
  #endif /* USG */
  
+ #if defined(SCO) && !defined(SCO324)
+ /*
+  * Interval timer (for PEX)
+  * a dummy implementation lives in
+  * Berklib.c
+  */
+ 
+ #define	ITIMER_REAL		0
+ #define	ITIMER_VIRTUAL	1
+ #define	ITIMER_PROF		2
+ 
+ struct itimerval {
+     struct timeval it_interval;		/* timer interval */
+     struct timeval it_value;		/* current timer value */
+ };
+ #endif /* defined(SCO) && !defined(SCO324) */
+ 
  #else /* not SYSV */
  
! #if defined(_POSIX_SOURCE) && (defined(SVR4) || defined(AMOEBA))
  /* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
  #undef _POSIX_SOURCE
  #include <sys/time.h>
+ #ifdef AMOEBA
+ #include <time.h>
+ 
+ /*
+  * Interval timer (for PEX)
+  */
+ struct itimerval {
+     struct timeval it_interval;		/* timer interval */
+     struct timeval it_value;		/* current timer value */
+ };
+ #endif /* AMOEBA */
  #define _POSIX_SOURCE
  #else
+ #ifdef _MINIX
+ #include <time.h>
+ #else
  #include <sys/time.h>
  #endif
+ #endif
  
  #endif /* SYSV */
  
***************
*** 148,152 ****
--- 202,240 ----
  #ifdef ISC
  #include <sys/bsdtypes.h>
  #endif
+ 
+ #if (BSD >= 199103)
+ #include <machine/endian.h>
+ #endif
+ 
+ #ifdef _MINIX
+ #include <net/hton.h>
+ #include <net/gen/in.h>
+ #include <net/gen/socket.h>   /* Get socket types. */
+ 
+ #ifndef IOVEC_DEFINED
+ #define IOVEC_DEFINED
+ struct iovec
+ {
+ 	char *iov_base;
+ 	size_t iov_len;
+ };
+ #endif
+ 
+ struct sockaddr
+ {
+ 	union
+ 	{
+ 		int sa_family;
+ 		struct sockaddr_in
+ 		{
+ 			int sin_family;
+ 			ipaddr_t sin_addr;
+ 			u16_t sin_port;
+ 		} sa_in;
+ 	} sa_u;
+ };
+ 
+ #endif /* _MINIX */
  
  #endif /* _XOS_H_ */
diff -c mit/include/Xosdefs.h:1.1.1.1 mit/include/Xosdefs.h:2.0
*** mit/include/Xosdefs.h:1.1.1.1	Sat Mar 12 00:40:17 1994
--- mit/include/Xosdefs.h	Sat Mar 12 00:40:17 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * O/S-dependent (mis)feature macro definitions
   *
+  * $XFree86: mit/include/Xosdefs.h,v 2.0 1993/11/07 14:04:50 dawes Exp $
   * $XConsortium: Xosdefs.h,v 1.7 91/07/19 23:22:19 rws Exp $
   *
   * Copyright 1991 Massachusetts Institute of Technology
***************
*** 33,44 ****
--- 34,53 ----
   * 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.
+  *
+  * X_NO_STRERROR means does not have strerror(), or that it shouldn't
+  * be used for shared lib compatibility reasons
   */
  
  #ifdef NOSTDHDRS
  #define X_NOT_POSIX
+ #ifndef X_NOT_STDC_ENV
  #define X_NOT_STDC_ENV
  #endif
+ #ifndef X_NO_STRERROR
+ #define X_NO_STRERROR
+ #endif
+ #endif
  
  #ifdef sony
  #ifndef SYSTYPE_SYSV
***************
*** 89,94 ****
--- 98,113 ----
  #ifdef MOTOROLA
  #ifdef SYSV
  #define X_NOT_STDC_ENV
+ #endif
+ #endif
+ 
+ #ifdef AMOEBA
+ #define	_POSIX_SOURCE
+ #endif
+ 
+ #if !defined(__STDC__) || defined(SYSV) || defined(SVR4) || defined(sun)
+ #ifndef X_NO_STRERROR
+ #define X_NO_STRERROR
  #endif
  #endif
  
diff -c mit/fonts/Imakefile:1.1.1.1 mit/fonts/Imakefile:2.1
*** mit/fonts/Imakefile:1.1.1.1	Sat Mar 12 00:40:22 1994
--- mit/fonts/Imakefile	Sat Mar 12 00:40:22 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/fonts/Imakefile,v 2.1 1994/02/24 13:28:15 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.28 91/07/16 23:03:55 gildea Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
***************
*** 14,21 ****
  SERVERDIRS = server
  #endif
  
  /* clients must be built before font dirs */
! SUBDIRS = lib clients $(FONTDIRS) $(PEXDIRS) $(SERVERDIRS)
  
  MakeSubdirs($(SUBDIRS))
  DependSubdirs($(SUBDIRS))
--- 15,30 ----
  SERVERDIRS = server
  #endif
  
+ #if BuildFonts || BuildPexExt || BuildFontServer
+ CLIENTS = clients
+ #endif
+ 
  /* clients must be built before font dirs */
! #if BuildServersOnly
! SUBDIRS = include lib
! #else
! SUBDIRS = include lib $(CLIENTS) $(FONTDIRS) $(PEXDIRS) $(SERVERDIRS)
! #endif
  
  MakeSubdirs($(SUBDIRS))
  DependSubdirs($(SUBDIRS))
diff -c mit/fonts/clients/Imakefile:1.1.1.2 mit/fonts/clients/Imakefile:1.5
*** mit/fonts/clients/Imakefile:1.1.1.2	Sat Mar 12 00:40:23 1994
--- mit/fonts/clients/Imakefile	Sat Mar 12 00:40:23 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/fonts/clients/Imakefile,v 1.5 1993/03/27 08:58:30 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.4 91/12/23 10:58:08 rws Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
diff -c mit/fonts/clients/bdftopcf/Imakefile:1.1.1.1 mit/fonts/clients/bdftopcf/Imakefile:1.4
*** mit/fonts/clients/bdftopcf/Imakefile:1.1.1.1	Sat Mar 12 00:40:24 1994
--- mit/fonts/clients/bdftopcf/Imakefile	Sat Mar 12 00:40:24 1994
***************
*** 1,6 ****
  XCOMM $XConsortium: Imakefile,v 1.5 91/07/17 16:04:23 gildea Exp $
  FONTLIBSRC = $(FONTSRC)/lib/font
! LOCAL_LIBRARIES = $(FONTLIBSRC)/libfont.a
  DEPLIBS = $(LOCAL_LIBRARIES)
  INCLUDES = -I$(FONTSRC)/include -I$(FONTLIBSRC)/include
  SRCS = bdftopcf.c
--- 1,7 ----
+ XCOMM $XFree86: mit/fonts/clients/bdftopcf/Imakefile,v 1.4 1993/03/25 14:17:33 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.5 91/07/17 16:04:23 gildea Exp $
  FONTLIBSRC = $(FONTSRC)/lib/font
! LOCAL_LIBRARIES = $(FONTLIBSRC)/libfont.a $(RENDERERLIBS)
  DEPLIBS = $(LOCAL_LIBRARIES)
  INCLUDES = -I$(FONTSRC)/include -I$(FONTLIBSRC)/include
  SRCS = bdftopcf.c
diff -c mit/fonts/clients/bdftopcf/bdftopcf.c:1.1.1.1 mit/fonts/clients/bdftopcf/bdftopcf.c:1.4
*** mit/fonts/clients/bdftopcf/bdftopcf.c:1.1.1.1	Sat Mar 12 00:40:25 1994
--- mit/fonts/clients/bdftopcf/bdftopcf.c	Sat Mar 12 00:40:25 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/clients/bdftopcf/bdftopcf.c,v 1.4 1993/03/27 08:58:34 dawes Exp $ */
  /*
   * $XConsortium: bdftopcf.c,v 1.4 91/05/13 15:25:06 gildea Exp $
   * 
***************
*** 19,34 ****
  #include    <X11/Xproto.h>
  #include    "fontmisc.h"
  #include    "fontstruct.h"
  #include    <stdio.h>
  
  main (argc, argv)
!     char    **argv;
  {
!     FontRec font;
!     FILE    *input, *output;
!     char    *input_name = 0, *output_name = 0;
!     char    *program_name;
!     int	    bit, byte, glyph, scan;
  
      FontDefaultFormat (&bit, &byte, &glyph, &scan);
      program_name = argv[0];
--- 20,36 ----
  #include    <X11/Xproto.h>
  #include    "fontmisc.h"
  #include    "fontstruct.h"
+ #include    "bitmap.h"
  #include    <stdio.h>
  
  main (argc, argv)
!     char	**argv;
  {
!     FontRec	font;
!     FontFilePtr input, output;
!     char	*input_name = 0, *output_name = 0;
!     char	*program_name;
!     int		bit, byte, glyph, scan;
  
      FontDefaultFormat (&bit, &byte, &glyph, &scan);
      program_name = argv[0];
***************
*** 130,147 ****
  	}
  	argv++;
      }
!     if (input_name)
      {
!     	input = fopen (input_name, "r");
!     	if (!input)
!     	{
! 	    fprintf (stderr, "%s: can't open bdf source file %s\n",
! 		     program_name, input_name);
! 	    exit (1);
!     	}
      }
-     else
- 	input = stdin;
      if (bdfReadFont (&font, input, bit, byte, glyph, scan) != Successful)
      {
  	fprintf (stderr, "%s: bdf input, %s, corrupt\n",
--- 132,144 ----
  	}
  	argv++;
      }
!     input = FontFileOpen (input_name, "r");
!     if (!input)
      {
! 	fprintf (stderr, "%s: can't open bdf source file %s\n",
! 		 program_name, input_name ? input_name : "<stdin>");
! 	exit (1);
      }
      if (bdfReadFont (&font, input, bit, byte, glyph, scan) != Successful)
      {
  	fprintf (stderr, "%s: bdf input, %s, corrupt\n",
***************
*** 148,165 ****
  		 program_name, input_name);
  	exit (1);
      }
!     if (output_name)
      {
! 	output = fopen (output_name, "w");
!     	if (!output)
!     	{
! 	    fprintf (stderr, "%s: can't open pcf sink file %s\n",
! 		     program_name, output_name);
! 	    exit (1);
!     	}
      } 
-     else
- 	output = stdout;
      if (pcfWriteFont (&font, output) != Successful)
      {
  	fprintf (stderr, "%s: can't write pcf file %s\n",
--- 145,157 ----
  		 program_name, input_name);
  	exit (1);
      }
!     output = FontFileOpen (output_name, "w");
!     if (!output)
      {
! 	fprintf (stderr, "%s: can't open pcf sink file %s\n",
! 		 program_name, output_name ? output_name : "<stdout>");
! 	exit (1);
      } 
      if (pcfWriteFont (&font, output) != Successful)
      {
  	fprintf (stderr, "%s: can't write pcf file %s\n",
***************
*** 169,174 ****
  	exit (1);
      }
      else
! 	fclose (output);
      exit (0);
  }
--- 161,166 ----
  	exit (1);
      }
      else
! 	FontFileClose (output);
      exit (0);
  }
diff -c mit/fonts/clients/mkfontdir/Imakefile:1.1.1.1 mit/fonts/clients/mkfontdir/Imakefile:1.2
*** mit/fonts/clients/mkfontdir/Imakefile:1.1.1.1	Sat Mar 12 00:40:28 1994
--- mit/fonts/clients/mkfontdir/Imakefile	Sat Mar 12 00:40:28 1994
***************
*** 1,6 ****
  XCOMM $XConsortium: Imakefile,v 1.5 91/07/17 16:04:28 gildea Exp $
  FONTLIBSRC = $(FONTSRC)/lib/font
! LOCAL_LIBRARIES = $(FONTLIBSRC)/libfont.a
  DEPLIBS = $(LOCAL_LIBRARIES)
  INCLUDES = -I$(FONTSRC)/include -I$(FONTLIBSRC)/include
  SRCS = mkfontdir.c
--- 1,6 ----
  XCOMM $XConsortium: Imakefile,v 1.5 91/07/17 16:04:28 gildea Exp $
  FONTLIBSRC = $(FONTSRC)/lib/font
! LOCAL_LIBRARIES = $(FONTLIBSRC)/libfont.a $(RENDERERLIBS)
  DEPLIBS = $(LOCAL_LIBRARIES)
  INCLUDES = -I$(FONTSRC)/include -I$(FONTLIBSRC)/include
  SRCS = mkfontdir.c
diff -c /dev/null mit/fonts/include/Imakefile:2.1
*** /dev/null	Sat Mar 12 00:40:31 1994
--- mit/fonts/include/Imakefile	Sat Mar 12 00:40:31 1994
***************
*** 0 ****
--- 1,9 ----
+ XCOMM $XFree86: mit/fonts/include/Imakefile,v 2.1 1994/02/28 13:55:18 dawes Exp $
+ 
+ all::
+ 
+ InstallLinkKitNonExecFile(fontstruct.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(font.h,$(LINKKITDIR)/include)
+ InstallLinkKitNonExecFile(fsmasks.h,$(LINKKITDIR)/include)
+ 
+ depend::
diff -c mit/fonts/server/Imakefile:1.1.1.2 mit/fonts/server/Imakefile:1.4
*** mit/fonts/server/Imakefile:1.1.1.2	Sat Mar 12 00:40:33 1994
--- mit/fonts/server/Imakefile	Sat Mar 12 00:40:33 1994
***************
*** 1,9 ****
  XCOMM $XConsortium: Imakefile,v 1.14 91/09/08 14:13:39 rws Exp $
  #undef ServerDefines
  #include <Server.tmpl>
  #define	IHaveSubdirs
  
! #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'CCOPTIONS=$(CCOPTIONS)'
  
  CC = ServerCcCmd
  CCOPTIONS = ServerCCOptions
--- 1,10 ----
+ XCOMM $XFree86: mit/fonts/server/Imakefile,v 1.4 1993/03/27 08:59:43 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.14 91/09/08 14:13:39 rws Exp $
  #undef ServerDefines
  #include <Server.tmpl>
  #define	IHaveSubdirs
  
! #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'CCOPTIONS=$(CCOPTIONS)' 'ANSICCOPTIONS=$(ANSICCOPTIONS)'
  
  CC = ServerCcCmd
  CCOPTIONS = ServerCCOptions
***************
*** 15,21 ****
  DIFSDIR = difs
  DIFSLIB = $(DIFSDIR)/libdifs.a
  FONTLIBDIR = $(FONTSRC)/lib/font
! FONTLIB = $(FONTLIBDIR)/libfont.a
  SYSLIBS =
  #if defined(HPArchitecture) || defined(i386SVR3Architecture)
  BSDEMUL = $(LIBSRC)/Berk/Berklib.o
--- 16,22 ----
  DIFSDIR = difs
  DIFSLIB = $(DIFSDIR)/libdifs.a
  FONTLIBDIR = $(FONTSRC)/lib/font
! FONTLIB = $(FONTLIBDIR)/libfont.a $(RENDERERLIBS)
  SYSLIBS =
  #if defined(HPArchitecture) || defined(i386SVR3Architecture)
  BSDEMUL = $(LIBSRC)/Berk/Berklib.o
diff -c mit/fonts/server/difs/Imakefile:1.1.1.2 mit/fonts/server/difs/Imakefile:2.0
*** mit/fonts/server/difs/Imakefile:1.1.1.2	Sat Mar 12 00:40:35 1994
--- mit/fonts/server/difs/Imakefile	Sat Mar 12 00:40:35 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/fonts/server/difs/Imakefile,v 2.0 1993/08/28 07:43:56 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.9 92/05/12 18:08:03 gildea Exp $
  #undef ServerDefines
  #include <Server.tmpl>
***************
*** 12,18 ****
  
  
  INCLUDES = -I../include -I$(FONTSRC)/include
! FONTDEFINES = -DFONT_PCF -DFONT_FS -DFONT_SPEEDO
  #ifdef DefaultFSConfigFile
  DEFAULTCONFIGFILE = DefaultFSConfigFile
  CONFIGDEFINES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULTCONFIGFILE)\"
--- 13,22 ----
  
  
  INCLUDES = -I../include -I$(FONTSRC)/include
! #if BuildSpeedo
! SPEEDODEFINES = -DFONT_SPEEDO
! #endif
! FONTDEFINES = -DFONT_PCF -DFONT_FS $(SPEEDODEFINES)
  #ifdef DefaultFSConfigFile
  DEFAULTCONFIGFILE = DefaultFSConfigFile
  CONFIGDEFINES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULTCONFIGFILE)\"
***************
*** 24,29 ****
  
  DependTarget()
  
! SpecialObjectRule(main.o,$(ICONFIGFILES),$(CONFIGDEFINES))
! SpecialObjectRule(initfonts.o,$(ICONFIGFILES),$(FONTDEFINES))
  
--- 28,33 ----
  
  DependTarget()
  
! SpecialObjectRule(main.o,main.c $(ICONFIGFILES),$(CONFIGDEFINES))
! SpecialObjectRule(initfonts.o,initfonts.c $(ICONFIGFILES),$(FONTDEFINES))
  
diff -c mit/fonts/server/difs/main.c:1.1.1.1 mit/fonts/server/difs/main.c:1.3
*** mit/fonts/server/difs/main.c:1.1.1.1	Sat Mar 12 00:40:36 1994
--- mit/fonts/server/difs/main.c	Sat Mar 12 00:40:36 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/server/difs/main.c,v 1.3 1993/05/18 15:36:53 dawes Exp $ */
  /* $XConsortium: main.c,v 1.9 91/07/25 12:25:41 keith Exp $ */
  /*
   * Font server main routine
***************
*** 43,52 ****
--- 44,66 ----
  
  Cache       serverCache;
  
+ #ifndef PATH_MAX
+ #include <sys/param.h>
+ #ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+ #define PATH_MAX MAXPATHLEN
+ #else
+ #define PATH_MAX 1024
+ #endif
+ #endif
+ #endif
+ 
  #ifndef DEFAULT_CONFIG_FILE
  #define DEFAULT_CONFIG_FILE "/usr/lib/X11/fs/config"
  #endif
  
+ extern char *getenv();
+ 
  #define	SERVER_CACHE_SIZE	10000	/* for random server cacheables */
  
  extern void InitProcVectors();
***************
*** 59,64 ****
--- 73,79 ----
  extern int  ListenSock;
  extern ClientPtr currentClient;
  char       *configfilename;
+ char	   configpath[PATH_MAX];
  extern Bool drone_server;
  
  main(argc, argv)
***************
*** 66,76 ****
      char      **argv;
  {
      int         i;
  
      argcGlobal = argc;
      argvGlobal = argv;
  
!     configfilename = DEFAULT_CONFIG_FILE;
  
      /* init stuff */
      ProcessCmdLine(argc, argv);
--- 81,98 ----
      char      **argv;
  {
      int         i;
+     char	*xwinhome = NULL;
  
      argcGlobal = argc;
      argvGlobal = argv;
  
!     if ((xwinhome = getenv("XWINHOME")) != NULL) {
! 	sprintf(configpath, "%s/lib/X11/fs/config", xwinhome);
! 	configfilename = configpath;
!     }
!     else {
! 	configfilename = DEFAULT_CONFIG_FILE;
!     }
  
      /* init stuff */
      ProcessCmdLine(argc, argv);
diff -c mit/fonts/server/os/Imakefile:1.1.1.1 mit/fonts/server/os/Imakefile:2.0
*** mit/fonts/server/os/Imakefile:1.1.1.1	Sat Mar 12 00:40:40 1994
--- mit/fonts/server/os/Imakefile	Sat Mar 12 00:40:40 1994
***************
*** 16,22 ****
  NormalLibraryObjectRule()
  NormalLibraryTarget(os,$(OBJS))
  
! SpecialObjectRule(connection.o,$(ICONFIGFILES),$(CONN_DEFINES) $(SIGNAL_DEFINES))
! SpecialObjectRule(error.o,$(ICONFIGFILES),$(ERROR_DEFINES))
  
  DependTarget()
--- 16,22 ----
  NormalLibraryObjectRule()
  NormalLibraryTarget(os,$(OBJS))
  
! SpecialObjectRule(connection.o,connection.c $(ICONFIGFILES),$(CONN_DEFINES) $(SIGNAL_DEFINES))
! SpecialObjectRule(error.o,error.c $(ICONFIGFILES),$(ERROR_DEFINES))
  
  DependTarget()
diff -c mit/fonts/server/os/connection.c:1.1.1.3 mit/fonts/server/os/connection.c:2.0
*** mit/fonts/server/os/connection.c:1.1.1.3	Sat Mar 12 00:40:41 1994
--- mit/fonts/server/os/connection.c	Sat Mar 12 00:40:41 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/server/os/connection.c,v 2.0 1993/07/28 11:55:03 dawes Exp $ */
  /* $XConsortium: connection.c,v 1.19 92/05/18 13:51:29 gildea Exp $ */
  /*
   * handles connections
***************
*** 101,106 ****
--- 102,111 ----
      int         request;
      int         retry;
  
+ #ifdef SVR4
+ #undef SO_DONTLINGER
+ #endif
+ 
  #ifndef SO_DONTLINGER
  
  #ifdef SO_LINGER
***************
*** 307,313 ****
  
  	/* ultrix reads hang on Unix sockets, hpux reads fail */
  
! #if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(AIXV3))
  	(void) fcntl(newconn, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
--- 312,318 ----
  
  	/* ultrix reads hang on Unix sockets, hpux reads fail */
  
! #if defined(O_NONBLOCK) && (!defined(SCO) && !defined(ultrix) && !defined(hpux) && !defined(AIXV3))
  	(void) fcntl(newconn, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
***************
*** 372,378 ****
  	(1000000 / MILLI_PER_SECOND);
      CLEARBITS(mask);
      BITSET(mask, fd);
!     (void) select(fd + 1, (int *) mask, (int *) NULL, (int *) NULL, &waittime);
      /* try to read the byteorder of the connection */
      (void) read(fd, &byteOrder, 1);
      if ((byteOrder == 'l') || (byteOrder == 'B')) {
--- 377,384 ----
  	(1000000 / MILLI_PER_SECOND);
      CLEARBITS(mask);
      BITSET(mask, fd);
!     (void) select(fd + 1, (fd_set *) mask, (fd_set *) NULL, (fd_set *) NULL,
! 		  &waittime);
      /* try to read the byteorder of the connection */
      (void) read(fd, &byteOrder, 1);
      if ((byteOrder == 'l') || (byteOrder == 'B')) {
***************
*** 453,460 ****
  	    curclient = ffs(mask[i]) - 1 + (i << 5);
  	    CLEARBITS(tmask);
  	    BITSET(tmask, curclient);
! 	    r = select(curclient + 1, (int *) tmask, (int *) NULL,
! 		       (int *) NULL, &notime);
  	    if (r < 0)
  		CloseDownClient(clients[ConnectionTranslation[curclient]]);
  	    BITCLEAR(mask, curclient);
--- 459,466 ----
  	    curclient = ffs(mask[i]) - 1 + (i << 5);
  	    CLEARBITS(tmask);
  	    BITSET(tmask, curclient);
! 	    r = select(curclient + 1, (fd_set *) tmask, (fd_set *) NULL,
! 		       (fd_set *) NULL, &notime);
  	    if (r < 0)
  		CloseDownClient(clients[ConnectionTranslation[curclient]]);
  	    BITCLEAR(mask, curclient);
diff -c mit/fonts/server/os/io.c:1.1.1.2 mit/fonts/server/os/io.c:2.0
*** mit/fonts/server/os/io.c:1.1.1.2	Sat Mar 12 00:40:41 1994
--- mit/fonts/server/os/io.c	Sat Mar 12 00:40:42 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/server/os/io.c,v 2.0 1993/07/28 11:55:05 dawes Exp $ */
  /* $XConsortium: io.c,v 1.9 92/05/18 13:50:44 gildea Exp $ */
  /*
   * i/o functions
***************
*** 629,631 ****
--- 630,669 ----
  	fsfree(oco);
      }
  }
+ 
+ #ifdef SCO
+ 
+ /*
+  *	Another writev emulation
+  */
+ 
+ int _FSOsWriteV(fd, iov, iovcnt)
+ 	int				 fd;
+ 	struct iovec	*iov;
+ 	int				 iovcnt;
+ {
+     int i, len, total;
+     char *base;
+ 
+     errno = 0;
+     for (i = 0, total = 0; i < iovcnt; i++, iov++) {
+ 		len = iov->iov_len;
+ 		base = iov->iov_base;
+ 		while (len > 0) {
+ 			register int nbytes;
+ 
+ 			nbytes = write(fd, base, len);
+ 			if (nbytes < 0 && total == 0)
+ 				return(-1);
+ 			if (nbytes <= 0)
+ 				return(total);
+ 			errno = 0;
+ 			len   -= nbytes;
+ 			total += nbytes;
+ 			base  += nbytes;
+ 		}
+     }
+     return(total);
+ }
+ 
+ #endif
diff -c mit/fonts/server/os/osdep.h:1.1.1.2 mit/fonts/server/os/osdep.h:2.0
*** mit/fonts/server/os/osdep.h:1.1.1.2	Sat Mar 12 00:40:42 1994
--- mit/fonts/server/os/osdep.h	Sat Mar 12 00:40:42 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/server/os/osdep.h,v 2.0 1993/07/28 11:55:07 dawes Exp $ */
  /* $XConsortium: osdep.h,v 1.4 92/01/31 17:45:07 eswu Exp $ */
  /*
   * Copyright 1990, 1991 Network Computing Devices;
***************
*** 176,180 ****
--- 177,191 ----
  
  extern Bool CloneSelf;
  extern Bool UseSyslog;
+ 
+ #ifdef SCO
+ /*
+  *	SCO doesn't have writev so we emulate. I don't know why this
+  *	isn't linked against libFS.a or some other lib
+  *	which contains an emulation but who's arguing.
+  *	The emulation is in io.c
+  */
+ #define writev	_FSOsWriteV
+ #endif
  
  #endif				/* _OSDEP_H_ */
diff -c mit/fonts/server/os/waitfor.c:1.1.1.2 mit/fonts/server/os/waitfor.c:1.3
*** mit/fonts/server/os/waitfor.c:1.1.1.2	Sat Mar 12 00:40:43 1994
--- mit/fonts/server/os/waitfor.c	Sat Mar 12 00:40:43 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/server/os/waitfor.c,v 1.3 1993/05/19 14:16:09 dawes Exp $ */
  /* $XConsortium: waitfor.c,v 1.8 91/09/11 11:59:39 rws Exp $ */
  /*
   * waits for input
***************
*** 119,129 ****
  
  	if (AnyClientsWriteBlocked) {
  	    COPYBITS(ClientsWriteBlocked, clientsWriteable);
! 	    i = select(MAXSOCKS, (int *) LastSelectMask,
! 		       (int *) clientsWriteable, (int *) NULL, wt);
  	} else {
! 	    i = select(MAXSOCKS, (int *) LastSelectMask, (int *) NULL,
! 		       (int *) NULL, wt);
  	}
  	selecterr = errno;
  
--- 120,130 ----
  
  	if (AnyClientsWriteBlocked) {
  	    COPYBITS(ClientsWriteBlocked, clientsWriteable);
! 	    i = select(MAXSOCKS, (fd_set *) LastSelectMask,
! 		       (fd_set *) clientsWriteable, (fd_set *) NULL, wt);
  	} else {
! 	    i = select(MAXSOCKS, (fd_set *) LastSelectMask, (fd_set *) NULL,
! 		       (fd_set *) NULL, wt);
  	}
  	selecterr = errno;
  
diff -c mit/fonts/lib/fs/FSConnServ.c:1.1.1.2 mit/fonts/lib/fs/FSConnServ.c:2.0
*** mit/fonts/lib/fs/FSConnServ.c:1.1.1.2	Sat Mar 12 00:40:47 1994
--- mit/fonts/lib/fs/FSConnServ.c	Sat Mar 12 00:40:47 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/fs/FSConnServ.c,v 2.0 1993/07/28 11:54:54 dawes Exp $ */
  /* $XConsortium: FSConnServ.c,v 1.14 91/09/09 18:55:13 rws Exp $ */
  
  /* @(#)FSConnServ.c	4.1	91/05/02
***************
*** 23,32 ****
--- 24,42 ----
   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   */
  
+ #if (defined(TCPCONN) && !defined(_MINIX)) || defined(UNIXCONN) || defined(DNETCONN)
+ #define HASSOCKETS
+ #endif
+ 
  #include	<stdio.h>
  #include	<X11/Xos.h>
  #include	"FSlibint.h"
+ #ifdef HASSOCKETS
  #include	<sys/socket.h>
+ #endif
+ #if !defined(AMOEBA) && !defined(_MINIX)
+ #include	<sys/uio.h>
+ #endif
  #ifdef NCD
  #include	<fcntl.h>
  #endif
***************
*** 44,51 ****
--- 54,63 ----
  #ifndef hpux
  
  #ifndef apollo			/* nest ifndefs because makedepend is broken */
+ #if defined(TCPCONN) && !defined(_MINIX)
  #include <netinet/tcp.h>
  #endif
+ #endif
  
  #endif
  
***************
*** 64,69 ****
--- 76,84 ----
      char       *server_name;
      char       *expanded_name;	/* return */
  {
+ #ifndef HASSOCKETS
+     return (-1);
+ #else
      char        serverbuf[256];	/* Server string buffer */
      register char *server_ptr;	/* Server string buffer pointer */
      register char *numbuf_ptr;	/* Server number buffer pointer */
***************
*** 370,376 ****
       */
  
      /* ultrix reads hang on Unix sockets, hpux reads fail */
! #if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(AIXV3))
      (void) fcntl (fd, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
--- 385,391 ----
       */
  
      /* ultrix reads hang on Unix sockets, hpux reads fail */
! #if defined(O_NONBLOCK) && (!defined(SCO) && !defined(ultrix) && !defined(hpux) && !defined(AIXV3))
      (void) fcntl (fd, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
***************
*** 410,416 ****
      *server_ptr = '\0';
      (void) strcpy(expanded_name, serverbuf);
      return (fd);
! 
  }
  
  /*
--- 425,431 ----
      *server_ptr = '\0';
      (void) strcpy(expanded_name, serverbuf);
      return (fd);
! #endif /* !HASSOCKETS */
  }
  
  /*
***************
*** 422,428 ****
--- 437,445 ----
      int         server;
  
  {
+ #ifndef AMOEBA
      (void) close(server);
+ #endif
  }
  
  #undef NULL
***************
*** 436,441 ****
--- 453,459 ----
  _FSWaitForWritable(svr)
      FSServer     *svr;
  {
+ #if !defined(AMOEBA) && !defined(_MINIX)
      unsigned long r_mask[MSKCNT];
      unsigned long w_mask[MSKCNT];
      int         nfound;
***************
*** 448,454 ****
  	BITSET(w_mask, svr->fd);
  
  	do {
! 	    nfound = select(svr->fd + 1, r_mask, w_mask, NULL, NULL);
  	    if (nfound < 0 && errno != EINTR)
  		(*_FSIOErrorFunction) (svr);
  	} while (nfound <= 0);
--- 466,473 ----
  	BITSET(w_mask, svr->fd);
  
  	do {
! 	    nfound = select(svr->fd + 1, (fd_set *)r_mask, (fd_set *)w_mask,
! 			    (fd_set *)NULL, (struct timeval *)NULL);
  	    if (nfound < 0 && errno != EINTR)
  		(*_FSIOErrorFunction) (svr);
  	} while (nfound <= 0);
***************
*** 493,498 ****
--- 512,518 ----
  	if (_FSANYSET(w_mask))
  	    return;
      }
+ #endif
  }
  
  
***************
*** 499,504 ****
--- 519,525 ----
  _FSWaitForReadable(svr)
      FSServer     *svr;
  {
+ #if !defined(AMOEBA) && !defined(_MINIX)
      unsigned long r_mask[MSKCNT];
      int         result;
  
***************
*** 505,514 ****
      CLEARBITS(r_mask);
      do {
  	BITSET(r_mask, svr->fd);
! 	result = select(svr->fd + 1, r_mask, NULL, NULL, NULL);
  	if (result == -1 && errno != EINTR)
  	    (*_FSIOErrorFunction) (svr);
      } while (result <= 0);
  }
  
  _FSSendClientPrefix(svr, client)
--- 526,539 ----
      CLEARBITS(r_mask);
      do {
  	BITSET(r_mask, svr->fd);
! 	result = select(svr->fd + 1, (fd_set *)r_mask, (fd_set *)NULL,
! 			(fd_set *)NULL, (struct timeval *)NULL);
  	if (result == -1 && errno != EINTR)
  	    (*_FSIOErrorFunction) (svr);
      } while (result <= 0);
+ #else
+     (*_FSIOErrorFunction) (svr);
+ #endif
  }
  
  _FSSendClientPrefix(svr, client)
***************
*** 515,520 ****
--- 540,546 ----
      FSServer     *svr;
      fsConnClientPrefix *client;
  {
+ #if !defined(AMOEBA) && !defined(_MINIX)
      struct iovec iovarray[5],
                 *iov = iovarray;
      int         niov = 0;
***************
*** 528,531 ****
--- 554,558 ----
  
      (void) WritevToServer(svr->fd, iovarray, niov);
      return;
+ #endif
  }
diff -c mit/fonts/lib/fs/FSlibInt.c:1.1.1.1 mit/fonts/lib/fs/FSlibInt.c:2.0
*** mit/fonts/lib/fs/FSlibInt.c:1.1.1.1	Sat Mar 12 00:40:50 1994
--- mit/fonts/lib/fs/FSlibInt.c	Sat Mar 12 00:40:50 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/fs/FSlibInt.c,v 2.0 1993/11/07 14:04:06 dawes Exp $ */
  /* $XConsortium: FSlibInt.c,v 1.9 91/07/22 11:29:28 rws Exp $ */
  
  /* @(#)FSlibInt.c	3.3	91/05/02
***************
*** 121,126 ****
--- 122,160 ----
      return total;
  }
  
+ #ifdef SCO
+ 
+ int _FSWriteV(fd, iov, iovcnt)
+ 	int				 fd;
+ 	struct iovec	*iov;
+ 	int				 iovcnt;
+ {
+     int i, len, total;
+     char *base;
+ 
+     errno = 0;
+     for (i = 0, total = 0; i < iovcnt; i++, iov++) {
+ 		len = iov->iov_len;
+ 		base = iov->iov_base;
+ 		while (len > 0) {
+ 			register int nbytes;
+ 
+ 			nbytes = write(fd, base, len);
+ 			if (nbytes < 0 && total == 0)
+ 				return(-1);
+ 			if (nbytes <= 0)
+ 				return(total);
+ 			errno = 0;
+ 			len   -= nbytes;
+ 			total += nbytes;
+ 			base  += nbytes;
+ 		}
+     }
+     return(total);
+ }
+ 
+ #endif /* SCO */
+ 
  #endif /* SYSV && SYSV386 && !STREAMSCONN */
  
  /*
***************
*** 162,167 ****
--- 196,202 ----
  _FSFlush(svr)
      register FSServer *svr;
  {
+ #ifndef AMOEBA
      register long size,
                  todo;
      register int write_stat;
***************
*** 202,207 ****
--- 237,243 ----
  	}
      }
      svr->last_req = (char *) &_dummy_request;
+ #endif
  }
  
  int
***************
*** 209,214 ****
--- 245,251 ----
      register FSServer *svr;
      int         mode;
  {
+ #if !defined(AMOEBA) && !defined(_MINIX)
      register int len;
      int         pend;
      char        buf[BUFSIZE];
***************
*** 238,243 ****
--- 275,281 ----
      }
      ENDITERATE
  	return (svr->qlen);
+ #endif
  }
  
  /* _FSReadEvents - Flush the output queue,
***************
*** 246,251 ****
--- 284,290 ----
  _FSReadEvents(svr)
      register FSServer *svr;
  {
+ #if !defined(AMOEBA) && !defined(_MINIX)
      char        buf[BUFSIZE];
      long        pend_not_register;	/* because can't "&" a register
  					 * variable */
***************
*** 294,299 ****
--- 333,339 ----
  	}
  	ENDITERATE
      } while (svr->head == NULL);
+ #endif
  }
  
  /*
***************
*** 305,310 ****
--- 345,351 ----
      register char *data;
      register long size;
  {
+ #ifndef AMOEBA
      register long bytes_read;
  
      if (size == 0)
***************
*** 337,342 ****
--- 378,384 ----
  		(*_FSIOErrorFunction) (svr);
  	}
      }
+ #endif
  }
  
  #ifdef WORD64
***************
*** 478,483 ****
--- 520,526 ----
      register char *data;
      register long size;
  {
+ #if !defined(AMOEBA) && !defined(_MINIX)
      register long bytes_read;
      struct iovec iov[2];
      char        pad[3];
***************
*** 527,532 ****
--- 570,576 ----
  		(*_FSIOErrorFunction) (svr);
  	}
      }
+ #endif
  }
  
  /*
***************
*** 539,544 ****
--- 583,589 ----
      char       *data;
      register long size;
  {
+ #if !defined(AMOEBA) && !defined(_MINIX)
      struct iovec iov[3];
      static char pad[3] = {0, 0, 0};
  
***************
*** 620,625 ****
--- 665,671 ----
  
      svr->bufptr = svr->buffer;
      svr->last_req = (char *) &_dummy_request;
+ #endif
  }
  
  #ifdef undef
***************
*** 687,692 ****
--- 733,739 ----
      Bool        discard;	/* should I discard data followind "extra"
  				 * words? */
  {
+ #ifndef AMOEBA
      /*
       * Pull out the serial number now, so that (currently illegal) requests
       * generated by an error handler don't confuse us.
***************
*** 797,802 ****
--- 844,850 ----
  	    break;
  	}
      }
+ #endif
  }
  
  
***************
*** 807,812 ****
--- 855,861 ----
      FSServer   *svr;
      register unsigned long n;
  {
+ #ifndef AMOEBA
  #define SCRATCHSIZE 2048
      char        buf[SCRATCHSIZE];
  
***************
*** 817,822 ****
--- 866,872 ----
  	n -= bytes_read;
      }
  #undef SCRATCHSIZE
+ #endif
  }
  
  
***************
*** 827,833 ****
--- 877,885 ----
      FSServer   *svr;
      unsigned long n;
  {
+ #ifndef AMOEBA
      _FSEatData(svr, n << 2);
+ #endif
  }
  
  
***************
*** 840,845 ****
--- 892,898 ----
      register FSServer *svr;
      register fsEvent *event;
  {
+ #ifndef AMOEBA
      register _FSQEvent *qelt;
  
  /*NOSTRICT*/
***************
*** 867,872 ****
--- 920,926 ----
  	qelt->next = _FSqfree;
  	_FSqfree = qelt;
      }
+ #endif
  }
  
  /*
***************
*** 942,952 ****
--- 996,1010 ----
  _SysErrorMsg(n)
      int         n;
  {
+ #ifndef X_NO_STRERROR
+     return strerror(n);
+ #else
      extern char *sys_errlist[];
      extern int  sys_nerr;
      char       *s = ((n >= 0 && n < sys_nerr) ? sys_errlist[n] : "unknown error");
  
      return (s ? s : "no such error");
+ #endif
  }
  
  /*
diff -c mit/fonts/lib/fs/FSlibint.h:1.1.1.1 mit/fonts/lib/fs/FSlibint.h:1.3
*** mit/fonts/lib/fs/FSlibint.h:1.1.1.1	Sat Mar 12 00:40:51 1994
--- mit/fonts/lib/fs/FSlibint.h	Sat Mar 12 00:40:51 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/fs/FSlibint.h,v 1.3 1993/03/27 08:59:11 dawes Exp $ */
  /* $XConsortium: FSlibint.h,v 1.6 91/05/13 15:12:01 gildea Exp $ */
  
  /* @(#)FSlibint.h	4.1	91/05/02
***************
*** 27,33 ****
   * FSlib internal decls
   */
  
! #ifdef USG
  #ifndef __TYPES__
  #include <sys/types.h>			/* forgot to protect it... */
  #define __TYPES__
--- 28,34 ----
   * FSlib internal decls
   */
  
! #if defined(USG) || defined(SYSV)
  #ifndef __TYPES__
  #include <sys/types.h>			/* forgot to protect it... */
  #define __TYPES__
diff -c mit/fonts/lib/fs/FSlibos.h:1.1.1.1 mit/fonts/lib/fs/FSlibos.h:1.5
*** mit/fonts/lib/fs/FSlibos.h:1.1.1.1	Sat Mar 12 00:40:52 1994
--- mit/fonts/lib/fs/FSlibos.h	Sat Mar 12 00:40:52 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/fs/FSlibos.h,v 1.5 1993/05/04 14:58:26 dawes Exp $ */
  /* $XConsortium: FSlibos.h,v 1.11 91/07/23 18:59:49 rws Exp $ */
  
  /* @(#)FSlibos.h	4.1	91/05/02
***************
*** 57,72 ****
--- 58,84 ----
  /*
   * 4.2BSD-based systems
   */
+ #if !defined(AMOEBA) && !defined(_MINIX)
+ #if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN)
  #include <netinet/in.h>
  #include <sys/ioctl.h>
  #include <netdb.h>
+ #endif
  #include <sys/uio.h>		/* needed for FSlibInt.c */
+ #else
+ #ifdef _MINIX
+ /* BSD compatibility def: */
+ typedef char *caddr_t;
+ #endif /* _MINIX */
+ #endif /* !AMOEBA && !_MINIX */
  #ifdef SVR4
  #include <sys/filio.h>
  #endif
  
  #if defined(SYSV386) && defined(SYSV)
+ #if defined(TCPCONN) || defined(STREAMSCONN)
  #include <net/errno.h>
+ #endif
  #include <sys/stropts.h>
  #define BytesReadable(fd,ptr) ioctl((fd), I_NREAD, (ptr))
  #else
***************
*** 332,338 ****
--- 344,352 ----
  #if !(defined(SYSV) && defined(SYSV386))
  #define _FSReadV readv
  #endif
+ #ifndef SCO
  #define _FSWriteV writev
+ #endif /* SCO */
  #endif
  #endif /* !USL_COMPAT */
  
diff -c mit/fonts/lib/fs/Imakefile:1.1.1.1 mit/fonts/lib/fs/Imakefile:2.0
*** mit/fonts/lib/fs/Imakefile:1.1.1.1	Sat Mar 12 00:40:52 1994
--- mit/fonts/lib/fs/Imakefile	Sat Mar 12 00:40:52 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/fonts/lib/fs/Imakefile,v 2.0 1993/08/28 07:43:47 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.10 91/07/24 18:36:33 keith Exp $
  #if Malloc0ReturnsNull
          DEFINES = -DMALLOC_0_RETURNS_NULL
***************
*** 20,27 ****
  
  NormalLibraryTarget(FS,$(OBJS))
  
! SpecialObjectRule(FSlibInt.o,$(ICONFIGFILES),$(CONN_DEFINES))
! SpecialObjectRule(FSConnServ.o,$(ICONFIGFILES),$(CONN_DEFINES))
  
  LinkFileList(includes,FSlib.h,../../include,../lib/fs)
  
--- 21,28 ----
  
  NormalLibraryTarget(FS,$(OBJS))
  
! SpecialObjectRule(FSlibInt.o,FSlibInt.c $(ICONFIGFILES),$(CONN_DEFINES))
! SpecialObjectRule(FSConnServ.o,FSConnServ.c $(ICONFIGFILES),$(CONN_DEFINES))
  
  LinkFileList(includes,FSlib.h,../../include,../lib/fs)
  
diff -c mit/fonts/lib/font/Imakefile:1.1.1.1 mit/fonts/lib/font/Imakefile:2.0
*** mit/fonts/lib/font/Imakefile:1.1.1.1	Sat Mar 12 00:40:53 1994
--- mit/fonts/lib/font/Imakefile	Sat Mar 12 00:40:53 1994
***************
*** 1,14 ****
  XCOMM $XConsortium: Imakefile,v 1.6 91/07/22 22:19:39 rws Exp $
  #include <Server.tmpl>
  
  #define	IHaveSubdirs
  
! SUBDIRS = bitmap fontfile fc Speedo util
! OBJS = bitmap/?*.o fontfile/?*.o fc/?*.o Speedo/?*.o util/?*.o
! DONES = bitmap/DONE fontfile/DONE fc/DONE Speedo/DONE util/DONE
  
- NormalDepLibraryTarget(font,$(SUBDIRS) $(DONES),$(OBJS))
  
! ForceSubdirs($(SUBDIRS))
  
  DependSubdirs($(SUBDIRS))
--- 1,24 ----
+ XCOMM $XFree86: mit/fonts/lib/font/Imakefile,v 2.0 1993/09/02 14:24:44 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.6 91/07/22 22:19:39 rws Exp $
  #include <Server.tmpl>
  
  #define	IHaveSubdirs
  
! STDSUBDIRS = bitmap fontfile fc util
! SUBDIRS = $(STDSUBDIRS) FontRenderers
! OBJS = bitmap/?*.o fontfile/?*.o fc/?*.o util/?*.o
! DONES = bitmap/DONE fontfile/DONE fc/DONE util/DONE
  
  
! /* hack to force bsd make to do things in the correct order */
! all::
! 
! all:: subdirs libfont.a
! 
! NamedMakeSubdirs(subdirs,$(SUBDIRS))
! 
! NormalDepLibraryTarget(font,$(STDSUBDIRS) $(DONES),$(OBJS))
! 
! InstallLinkKitLibrary(font,$(LINKKITDIR)/lib)
  
  DependSubdirs($(SUBDIRS))
diff -c mit/fonts/lib/font/include/bitmap.h:1.1.1.1 mit/fonts/lib/font/include/bitmap.h:1.4
*** mit/fonts/lib/font/include/bitmap.h:1.1.1.1	Sat Mar 12 00:40:55 1994
--- mit/fonts/lib/font/include/bitmap.h	Sat Mar 12 00:40:55 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/include/bitmap.h,v 1.4 1993/03/27 08:59:05 dawes Exp $ */
  /*
   * $XConsortium: bitmap.h,v 1.1 91/05/11 09:11:56 rws Exp $
   *
***************
*** 59,73 ****
  extern void bitmapComputeFontBounds();
  extern void bitmapComputeFontInkBounds();
  
! typedef FILE	*FontFilePtr;
  
! #define FontFileGetc(f)	    getc(f)
! #define FontFilePutc(c,f)   putc(c,f)
! #define FontFileRead(f,b,n) fread((char *) b, 1, n, f)
! #define FontFileWrite(f,b,n)	fwrite ((char *) b, 1, n, f)
! #define FontFileSkip(f,n)   (fseek(f,n,1) != -1)
! #define FontFileSeek(f,n)   (fseek(f,n,0) != -1)
  
  #define FontFileEOF	EOF
  
  #endif				/* _BITMAP_H_ */
--- 60,129 ----
  extern void bitmapComputeFontBounds();
  extern void bitmapComputeFontInkBounds();
  
! typedef struct _FontFile {
!     FILE	*file;
!     int		compressed;
! } *FontFilePtr;
! 
! #define BITS		16
! #define STACK_SIZE	8192
! 
! typedef struct _CompressedFile {
!     FILE		*file;
! 
!     unsigned char	*stackp;
!     long		oldcode;
!     unsigned char	finchar;
! 
!     int			block_compress;
!     int			maxbits;
!     long		maxcode, maxmaxcode;
! 
!     long		free_ent;
!     int			clear_flg;
!     int			n_bits;
! 
!     /* bit buffer */
!     int			offset, size;
!     unsigned char	buf[BITS];
! 
!     unsigned char	de_stack[STACK_SIZE];
!     unsigned char	*tab_suffix;
!     unsigned short	*tab_prefix;
! } CompressedFile;
! 
! extern int _filldcbuf();
! extern CompressedFile *CompressedFileOpen();
! extern int CompressedFileClose();
! extern int CompressedFileRead();
! extern int CompressedFileSkip();
! 
! #define getdcchar(file) \
! ((file)->stackp > (file)->de_stack ? (*--((file)->stackp)) : _filldcbuf(file))
! 
! #define FontFileGetc(f)	((f)->compressed ? \
!     getdcchar((CompressedFile *)((f)->file)) : getc((f)->file))
! 
! #define FontFileRead(f,b,n) ((f)->compressed ? \
!     CompressedFileRead(b, n, (CompressedFile *)((f)->file)) : \
!     fread((char *) b, 1, n, (f)->file))
! 
! #define FontFileSkip(f,n) ((f)->compressed ? \
!     CompressedFileSkip((CompressedFile *)((f)->file), n) : \
!     (fseek((f)->file, n, 1) != -1))
  
! #define FontFileSeek(f,n) \
!     ((f)->compressed ? abort(), 0 : (fseek((f)->file,n,0) != -1))
  
+ #define FontFilePutc(c,f) \
+     ((f)->compressed ? abort(), 0 : putc(c,(f)->file))
+ 
+ #define FontFileWrite(f,b,n) \
+     ((f)->compressed ? abort(), 0 : fwrite ((char *) b, 1, n, (f)->file))
+ 
  #define FontFileEOF	EOF
+ 
+ extern FontFilePtr FontFileOpen();
+ extern int FontFileClose();
  
  #endif				/* _BITMAP_H_ */
diff -c mit/fonts/lib/font/Speedo/Imakefile:1.1.1.1 mit/fonts/lib/font/Speedo/Imakefile:1.3
*** mit/fonts/lib/font/Speedo/Imakefile:1.1.1.1	Sat Mar 12 00:40:57 1994
--- mit/fonts/lib/font/Speedo/Imakefile	Sat Mar 12 00:40:58 1994
***************
*** 19,22 ****
--- 19,26 ----
  NormalLibraryObjectRule()
  NormalLintTarget($(SRCS))
  
+ NormalLibraryTarget(Speedo,$(OBJS))
+ 
+ InstallLinkKitLibrary(Speedo,$(LINKKITDIR)/renderers)
+ 
  DependTarget()
diff -c mit/fonts/lib/font/Speedo/do_char.c:1.1.1.1 mit/fonts/lib/font/Speedo/do_char.c:1.2
*** mit/fonts/lib/font/Speedo/do_char.c:1.1.1.1	Sat Mar 12 00:40:58 1994
--- mit/fonts/lib/font/Speedo/do_char.c	Sat Mar 12 00:40:58 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/Speedo/do_char.c,v 1.2 1993/03/20 03:03:09 dawes Exp $ */
  /* $XConsortium: do_char.c,v 1.2 91/05/11 09:47:31 rws Exp $ */
  
  /*
***************
*** 29,34 ****
--- 30,36 ----
   *                                                                           *
   ****************************************************************************/
  
+ #define DECL_do_char
  #include "spdo_prv.h"               /* General definitions for Speedo    */
  
  #define   DEBUG   0
diff -c mit/fonts/lib/font/Speedo/do_trns.c:1.1.1.1 mit/fonts/lib/font/Speedo/do_trns.c:1.2
*** mit/fonts/lib/font/Speedo/do_trns.c:1.1.1.1	Sat Mar 12 00:40:59 1994
--- mit/fonts/lib/font/Speedo/do_trns.c	Sat Mar 12 00:40:59 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/Speedo/do_trns.c,v 1.2 1993/03/20 03:03:12 dawes Exp $ */
  /* $XConsortium: do_trns.c,v 1.2 91/05/11 09:48:24 rws Exp $ */
  
  /*
***************
*** 31,36 ****
--- 32,38 ----
   ****************************************************************************/
  
  
+ #define DECL_do_trns
  #include "spdo_prv.h"               /* General definitions for Speedo    */
  
  #define   DEBUG      0
diff -c mit/fonts/lib/font/Speedo/out_bl2d.c:1.1.1.1 mit/fonts/lib/font/Speedo/out_bl2d.c:1.2
*** mit/fonts/lib/font/Speedo/out_bl2d.c:1.1.1.1	Sat Mar 12 00:40:59 1994
--- mit/fonts/lib/font/Speedo/out_bl2d.c	Sat Mar 12 00:41:00 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/Speedo/out_bl2d.c,v 1.2 1993/03/20 03:03:14 dawes Exp $ */
  /* $XConsortium: out_bl2d.c,v 1.3 91/05/11 09:51:53 rws Exp $ */
  
  /*
***************
*** 28,33 ****
--- 29,35 ----
   ****************************************************************************/
  
  
+ #define DECL_out_bl2d
  #include "spdo_prv.h"              /* General definitions for speedo */
  
  #define   CLOCKWISE  1
diff -c mit/fonts/lib/font/Speedo/out_blk.c:1.1.1.1 mit/fonts/lib/font/Speedo/out_blk.c:1.2
*** mit/fonts/lib/font/Speedo/out_blk.c:1.1.1.1	Sat Mar 12 00:41:00 1994
--- mit/fonts/lib/font/Speedo/out_blk.c	Sat Mar 12 00:41:00 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/Speedo/out_blk.c,v 1.2 1993/03/20 03:03:16 dawes Exp $ */
  /* $XConsortium: out_blk.c,v 1.3 91/05/11 09:52:21 rws Exp $ */
  
  /*
***************
*** 31,36 ****
--- 32,38 ----
   *****************************************************************************/
  
  
+ #define DECL_out_blk
  #include "spdo_prv.h"               /* General definitions for Speedo   */
  
  #define   DEBUG      0
diff -c mit/fonts/lib/font/Speedo/out_scrn.c:1.1.1.1 mit/fonts/lib/font/Speedo/out_scrn.c:1.2
*** mit/fonts/lib/font/Speedo/out_scrn.c:1.1.1.1	Sat Mar 12 00:41:01 1994
--- mit/fonts/lib/font/Speedo/out_scrn.c	Sat Mar 12 00:41:01 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/Speedo/out_scrn.c,v 1.2 1993/03/20 03:03:18 dawes Exp $ */
  /* $XConsortium: out_scrn.c,v 1.2 91/05/11 09:53:11 rws Exp $ */
  
  /*
***************
*** 30,35 ****
--- 31,37 ----
   *****************************************************************************/
  
  
+ #define DECL_out_scrn
  #include "spdo_prv.h"               /* General definitions for Speedo   */
  
  #define   DEBUG      0
diff -c mit/fonts/lib/font/Speedo/set_trns.c:1.1.1.1 mit/fonts/lib/font/Speedo/set_trns.c:1.2
*** mit/fonts/lib/font/Speedo/set_trns.c:1.1.1.1	Sat Mar 12 00:41:02 1994
--- mit/fonts/lib/font/Speedo/set_trns.c	Sat Mar 12 00:41:02 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/Speedo/set_trns.c,v 1.2 1993/03/20 03:03:21 dawes Exp $ */
  /* $XConsortium: set_trns.c,v 1.2 91/05/11 09:54:57 rws Exp $ */
  
  /*
***************
*** 33,38 ****
--- 34,40 ----
   ****************************************************************************/
  
  
+ #define DECL_set_trns
  #include "spdo_prv.h"               /* General definitions for Speedo   */
  
  #define   DEBUG      0
diff -c mit/fonts/lib/font/Speedo/speedo.h:1.1.1.1 mit/fonts/lib/font/Speedo/speedo.h:1.2
*** mit/fonts/lib/font/Speedo/speedo.h:1.1.1.1	Sat Mar 12 00:41:03 1994
--- mit/fonts/lib/font/Speedo/speedo.h	Sat Mar 12 00:41:03 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/Speedo/speedo.h,v 1.2 1993/03/20 03:03:24 dawes Exp $ */
  /* $XConsortium: speedo.h,v 1.4 91/05/11 14:18:41 rws Exp $ */
  
  /*
***************
*** 777,786 ****
--- 778,791 ----
  boolean sp_make_char(PROTO_DECL2 ufix16 char_index);
  #if  INCL_ISW       
  fix31 sp_compute_isw_scale(PROTO_DECL2);
+ #ifdef DECL_do_char
  static boolean sp_do_make_char(PROTO_DECL2 ufix16 char_index);
+ #endif
  boolean sp_make_char_isw(PROTO_DECL2 ufix16 char_index, ufix32 imported_width);
+ #ifdef DECL_do_char
  static boolean sp_reset_xmax(PROTO_DECL2 fix31 xmax);
  #endif
+ #endif
  #if INCL_ISW || INCL_SQUEEZING
  static void sp_preview_bounding_box(PROTO_DECL2 ufix8 FONTFAR  *pointer,ufix8    format);
  #endif
***************
*** 792,808 ****
--- 797,817 ----
  boolean sp_get_char_bbox(PROTO_DECL2 ufix16 char_index, bbox_t *bbox);
  #endif
  
+ #ifdef DECL_do_char
  static boolean sp_make_simp_char(PROTO_DECL2 ufix8 FONTFAR *pointer,ufix8 format);
  static boolean sp_make_comp_char(PROTO_DECL2 ufix8 FONTFAR *pointer);
  static ufix8 FONTFAR *sp_get_char_org(PROTO_DECL2 ufix16 char_index,boolean top_level);
  static fix15 sp_get_posn_arg(PROTO_DECL2 ufix8 FONTFAR *STACKFAR *ppointer,ufix8 format);
  static fix15 sp_get_scale_arg(PROTO_DECL2 ufix8 FONTFAR *STACKFAR *ppointer,ufix8 format);
+ #endif
  
  /* do_trns.c functions */
  ufix8 FONTFAR *sp_read_bbox(PROTO_DECL2 ufix8 FONTFAR *pointer,point_t STACKFAR *pPmin,point_t STACKFAR *pPmax,boolean set_flag);
  void sp_proc_outl_data(PROTO_DECL2 ufix8 FONTFAR *pointer);
+ #ifdef DECL_do_trns
  static void sp_split_curve(PROTO_DECL2 point_t P1,point_t P2,point_t P3,fix15 depth);
  static ufix8 FONTFAR *sp_get_args(PROTO_DECL2 ufix8 FONTFAR *pointer,ufix8  format,point_t STACKFAR *pP);
+ #endif
  
  /* out_blk.c functions */
  #if INCL_BLACK
***************
*** 812,820 ****
--- 821,831 ----
  void sp_line_black(PROTO_DECL2 point_t P1);
  boolean sp_end_char_black(PROTO_DECL1);
  
+ #ifdef DECL_out_blk
  static void sp_add_intercept_black(PROTO_DECL2 fix15 y, fix15 x);
  static void sp_proc_intercepts_black(PROTO_DECL1);
  #endif
+ #endif
  
  /* out_scrn.c functions */
  #if INCL_SCREEN
***************
*** 828,836 ****
--- 839,849 ----
  void sp_end_contour_screen(PROTO_DECL1);
  boolean sp_end_char_screen(PROTO_DECL1);
  
+ #ifdef DECL_out_scrn
  static void sp_add_intercept_screen(PROTO_DECL2 fix15 y,fix31 x);
  static void sp_proc_intercepts_screen(PROTO_DECL1);
  #endif
+ #endif
  
  /* out_outl.c functions */
  #if INCL_OUTLINE
***************
*** 858,867 ****
--- 871,882 ----
  void sp_line_2d(PROTO_DECL2 point_t P1);
  boolean sp_end_char_2d(PROTO_DECL1);
  
+ #ifdef DECL_out_bl2d
  static void sp_draw_vector_to_2d(PROTO_DECL2 fix15 x0,fix15 y0,fix15 x1,fix15 y1,band_t GLOBALFAR *band);
  static void sp_add_intercept_2d(PROTO_DECL2 fix15 y,fix15 x);
  static void sp_proc_intercepts_2d(PROTO_DECL1);
  #endif
+ #endif
  
  /* out_util.c functions */
  #if INCL_BLACK || INCL_SCREEN || INCL_2D
***************
*** 898,908 ****
--- 913,925 ----
  boolean sp_set_specs(PROTO_DECL2 specs_t STACKFAR *specsarg);
  void sp_type_tcb(PROTO_DECL2 tcb_t GLOBALFAR *ptcb);
  
+ #ifdef SET_SPCS
  static boolean sp_setup_consts(PROTO_DECL2 fix15 xmin, fix15 xmax,
  	fix15 ymin, fix15 ymax);
  static void sp_setup_tcb(PROTO_DECL2 tcb_t GLOBALFAR *ptcb);
  static fix15 sp_setup_mult(PROTO_DECL2 fix31 input_mult);
  static fix31 sp_setup_offset(PROTO_DECL2 fix31 input_offset);
+ #endif
  fix31 sp_read_long(PROTO_DECL2 ufix8 FONTFAR *pointer);
  fix15 sp_read_word_u(PROTO_DECL2 ufix8 FONTFAR *pointer);
  
***************
*** 913,919 ****
--- 930,938 ----
  ufix8 FONTFAR *sp_skip_interpolation_table(PROTO_DECL2 ufix8 FONTFAR *pointer, ufix8 format);
  ufix8 FONTFAR *sp_skip_control_zone(PROTO_DECL2 ufix8 FONTFAR *pointer, ufix8 format);
  
+ #ifdef DECL_set_trns
  static void sp_constr_update(PROTO_DECL1);
+ #endif
  ufix8 FONTFAR *sp_read_oru_table(PROTO_DECL2 ufix8 FONTFAR *pointer);
  #if INCL_SQUEEZING || INCL_ISW
  static void sp_calculate_x_pix(PROTO_DECL2 ufix8 start_edge,ufix8 end_edge,ufix16 constr_nr,fix31 x_scale,fix31 x_offset,fix31 ppo,fix15 setwidth_pix);
***************
*** 923,930 ****
--- 942,951 ----
  boolean sp_calculate_x_scale(PROTO_DECL2 fix31 *x_factor,fix31 *x_offset,fix15 no_x_ctrl_zones);
  boolean sp_calculate_y_scale(PROTO_DECL2 fix31 *top_scale,fix31 *bottom_scale,fix15 first_y_zone, fix15 no_Y_ctrl_zones);
  #endif
+ #ifdef DECL_set_trns
  static ufix8 FONTFAR *sp_setup_pix_table(PROTO_DECL2 ufix8 FONTFAR *pointer,boolean short_form,fix15 no_X_ctrl_zones,fix15 no_Y_ctrl_zones);
  static ufix8 FONTFAR *sp_setup_int_table(PROTO_DECL2 ufix8 FONTFAR *pointer,fix15 no_X_int_zones,fix15 no_Y_int_zones);
+ #endif
                    
  
  /* user defined functions */
***************
*** 987,1003 ****
--- 1008,1028 ----
  boolean sp_get_char_bbox();
  #endif
  
+ #ifdef DECL_do_char
  static boolean sp_make_simp_char(); /* Process simple character data */
  static boolean sp_make_comp_char(); /* Process compound character data */
  static ufix8 FONTFAR *sp_get_char_org();   /* Look up char in character directory */
  static fix15   sp_get_posn_arg();   /* Read Xpos Ypos args in DOCH instruction */
  static fix15   sp_get_scale_arg();  /* read Xscale Yscale args in DOCH instruction */
+ #endif
  
  /* do_trns.c functions */
  ufix8 FONTFAR *sp_read_bbox();              /* Read bounding box */
  void   sp_proc_outl_data();         /* Process outline data */
+ #ifdef DECL_do_trns
  static void   sp_split_curve();            /* Split Bezier curve into vectors */
  static ufix8 FONTFAR *sp_get_args();      /* Read X Y argument pair */
+ #endif
  
  /* out_0c.c functions */
  boolean sp_init_black();
***************
*** 1006,1013 ****
--- 1031,1040 ----
  void sp_line_black();
  boolean sp_end_char_black();
  
+ #ifdef DECL_out_blk
  static void    sp_add_intercept_black();
  static void    sp_proc_intercepts_black();
+ #endif
  
  /* out_util.c functions */
  #if INCL_BLACK || INCL_SCREEN || INCL_2D
***************
*** 1040,1049 ****
--- 1067,1078 ----
  boolean    sp_set_specs();       /* Set specifications */
  void       sp_type_tcb();           /* Update transformation class in tcb */
  
+ #ifdef SET_SPCS
  static void    sp_setup_tcb();      /* Set up transformation control block */
  static fix15 sp_setup_mult();       /* Convert mult to internal form */
  static fix31 sp_setup_offset();     /* Convert offset to internal form */
  static boolean sp_setup_consts();   /* Set up scaling constants */
+ #endif
  fix31   sp_read_long();      /* Read long as 3 bytes encrypted */
  fix15   sp_read_word_u();    /* Read word as 2 bytes unencrypted */
  
***************
*** 1054,1060 ****
--- 1083,1091 ----
  ufix8 FONTFAR *sp_skip_interpolation_table();
  ufix8 FONTFAR *sp_skip_control_zone();
  
+ #ifdef DECL_set_trns
  static void sp_constr_update();     /* Update constraint table */
+ #endif
  ufix8 FONTFAR *sp_read_oru_table();    /* Read controlled coord table */
  #if INCL_SQUEEZING || INCL_ISW
  static void sp_calculate_x_pix();
***************
*** 1064,1071 ****
--- 1095,1104 ----
  boolean sp_calculate_x_scale();
  boolean sp_calculate_y_scale() ;
  #endif
+ #ifdef DECL_set_trns
  static ufix8 FONTFAR *sp_setup_pix_table();   /* Read control zone table */
  static ufix8 FONTFAR *sp_setup_int_table();   /* Read interpolation zone table */
+ #endif
  
  /* user defined functions */
  
***************
*** 1110,1117 ****
--- 1143,1152 ----
  void sp_end_contour_screen();
  boolean sp_end_char_screen();        /* If screenwriter mode supported */
  
+ #ifdef DECL_out_scrn
  static void    sp_add_intercept_screen();
  static void    sp_proc_intercepts_screen();
+ #endif
  
  
  boolean sp_init_outline();        /* If only vector output mode supported */
***************
*** 1130,1138 ****
--- 1165,1175 ----
  void    sp_line_2d();           /* If screen-writer and other modes supported */
  boolean sp_end_char_2d();       /* If screen-writer and other modes supported */
  
+ #ifdef DECL_out_bl2d
  static void    sp_add_intercept_2d();
  static void    sp_proc_intercepts_2d();
  static void    sp_draw_vector_to_2d();
+ #endif
  
  #endif
  
diff -c mit/fonts/lib/font/bitmap/Imakefile:1.1.1.2 mit/fonts/lib/font/bitmap/Imakefile:1.5
*** mit/fonts/lib/font/bitmap/Imakefile:1.1.1.2	Sat Mar 12 00:41:06 1994
--- mit/fonts/lib/font/bitmap/Imakefile	Sat Mar 12 00:41:06 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/fonts/lib/font/bitmap/Imakefile,v 1.5 1993/03/27 08:58:46 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.6 92/05/13 14:12:15 gildea Exp $
  #include <Server.tmpl>
  
***************
*** 8,18 ****
  #endif
              SRCS = bdfread.c bdfutils.c bitmap.c bitmaputils.c bitscale.c \
  		   bitmapfuncs.c pcfread.c pcfwrite.c snfread.c \
! 		   fontink.c
  
              OBJS = bdfread.o bdfutils.o bitmap.o bitmaputils.o bitscale.o \
  		   bitmapfuncs.o pcfread.o pcfwrite.o snfread.o \
! 		   fontink.o
  
  SubdirLibraryRule($(OBJS))
  NormalLibraryObjectRule()
--- 9,19 ----
  #endif
              SRCS = bdfread.c bdfutils.c bitmap.c bitmaputils.c bitscale.c \
  		   bitmapfuncs.c pcfread.c pcfwrite.c snfread.c \
! 		   fontink.c bitmapfile.c
  
              OBJS = bdfread.o bdfutils.o bitmap.o bitmaputils.o bitscale.o \
  		   bitmapfuncs.o pcfread.o pcfwrite.o snfread.o \
! 		   fontink.o bitmapfile.o
  
  SubdirLibraryRule($(OBJS))
  NormalLibraryObjectRule()
diff -c /dev/null mit/fonts/lib/font/bitmap/bitmapfile.c:1.3
*** /dev/null	Sat Mar 12 00:41:06 1994
--- mit/fonts/lib/font/bitmap/bitmapfile.c	Sat Mar 12 00:41:06 1994
***************
*** 0 ****
--- 1,368 ----
+ /* $XFree86: mit/fonts/lib/font/bitmap/bitmapfile.c,v 1.3 1993/03/27 08:58:47 dawes Exp $ */
+ 
+ #include    "fontfilest.h"
+ #include    "bitmap.h"
+ 
+ #ifdef TEST
+ #undef xalloc
+ #undef xfree
+ #define xalloc(s)   malloc(s)
+ #define xfree(s)    free(s)
+ #endif
+ 
+ FontFilePtr
+ FontFileOpen (path, mode)
+     char *path;
+     char *mode;
+ {
+     FontFilePtr file;
+     int		l;
+     char	*p;
+ 
+     file = (FontFilePtr) xalloc(sizeof(struct _FontFile));
+     if (!file)
+ 	return NULL;
+     if (path && path[0]) {
+ 	l = strlen(path);
+ 	if (l >= 2 && path[l - 2] == '.' && path[l - 1] == 'Z') {
+ 	    for (p = mode; *p; p++)
+ 		if (*p == 'w' || *p == 'a' || *p == '+') {
+ 		    xfree(file);
+ 		    return NULL;
+ 		}
+ 	    file->compressed = TRUE;
+ 	    file->file = (FILE *) CompressedFileOpen(path);
+ 	}
+ 	else {
+ 	    file->compressed = FALSE;
+ 	    file->file = fopen(path, mode);
+ 	}
+ 	if (!file->file) {
+ 	    xfree(file);
+ 	    return NULL;
+ 	}
+     }
+     else {
+ 	file->compressed = FALSE;
+ 	file->file = stdin;
+ 	for (p = mode; *p; p++)
+ 	    if (*p == 'w' || *p == 'a' || *p == '+') {
+ 		file->file = stdout;
+ 		break;
+ 	    }
+     }
+     return file;
+ }
+ 
+ int
+ FontFileClose (file)
+     FontFilePtr file;
+ {
+     int ret;
+ 
+     if (file->compressed)
+ 	ret = CompressedFileClose((CompressedFile *)(file->file));
+     else
+ 	ret = fclose(file->file);
+     xfree(file);
+     return ret;
+ }
+ 
+ /* 
+  * decompress - cat a compressed file
+  */
+ 
+ static unsigned char magic_header[] = { "\037\235" };	/* 1F 9D */
+ 
+ /* Defines for third byte of header */
+ #define BIT_MASK	0x1f
+ #define BLOCK_MASK	0x80
+ /* Masks 0x40 and 0x20 are free.  I think 0x20 should mean that there is
+    a fourth header byte (for expansion).
+ */
+ 
+ #define INIT_BITS 9			/* initial number of bits/code */
+ 
+ #define MAXCODE(n_bits)	((1 << (n_bits)) - 1)
+ 
+ static long getcode();
+ 
+ /*
+  * the next two codes should not be changed lightly, as they must not
+  * lie within the contiguous general code space.
+  */ 
+ #define FIRST	257	/* first free entry */
+ #define	CLEAR	256	/* table clear output code */
+ 
+ static int hsize_table[] = {
+     5003,	/* 12 bits - 80% occupancy */
+     9001,	/* 13 bits - 91% occupancy */
+     18013,	/* 14 bits - 91% occupancy */
+     35023,	/* 15 bits - 94% occupancy */
+     69001	/* 16 bits - 95% occupancy */
+ };
+ 
+ CompressedFile *
+ CompressedFileOpen (path)
+     char	    *path;
+ {
+     int		    code;
+     int		    maxbits;
+     int		    hsize;
+     FILE	    *f;
+     CompressedFile  *file;
+     int		    extra;
+     char	    *p;
+ 
+     f = fopen(path, "r");
+     if (!f)
+ 	return NULL;
+     if ((getc(f) != (magic_header[0] & 0xFF)) ||
+ 	(getc(f) != (magic_header[1] & 0xFF)))
+     {
+ 	fclose(f);
+ 	return NULL;
+     }
+     code = getc (f);
+     maxbits = code & BIT_MASK;
+     if (maxbits > BITS || maxbits < 12)
+     {
+ 	fclose(f);
+ 	return NULL;
+     }
+     hsize = hsize_table[maxbits - 12];
+     extra = (1 << maxbits) * sizeof (unsigned char) +
+ 	    hsize * sizeof (unsigned short);
+     file = (CompressedFile *) xalloc (sizeof (CompressedFile) + extra);
+     if (!file)
+     {
+ 	fclose(f);
+ 	return NULL;
+     }
+     file->file = f;
+     file->maxbits = maxbits;
+     file->block_compress = code & BLOCK_MASK;
+     file->maxmaxcode = 1 << file->maxbits;
+     file->tab_suffix = (unsigned char *) &file[1];
+     file->tab_prefix = (unsigned short *) (file->tab_suffix + file->maxmaxcode);
+     /*
+      * As above, initialize the first 256 entries in the table.
+      */
+     file->maxcode = MAXCODE(file->n_bits = INIT_BITS);
+     for ( code = 255; code >= 0; code-- ) {
+ 	file->tab_prefix[code] = 0;
+ 	file->tab_suffix[code] = (unsigned char) code;
+     }
+     file->free_ent = ((file->block_compress) ? FIRST : 256 );
+     file->clear_flg = 0;
+     file->offset = 0;
+     file->size = 0;
+     file->stackp = file->de_stack;
+     file->finchar = file->oldcode = getcode (file);
+     if (file->oldcode != -1)
+ 	*file->stackp++ = file->finchar;
+     return file;
+ }
+ 
+ int
+ CompressedFileClose (file)
+     CompressedFile  *file;
+ {
+     FILE    *f;
+ 
+     f = file->file;
+     xfree (file);
+     return fclose(f);
+ }
+ 
+ int _filldcbuf (file)
+     CompressedFile  *file;
+ {
+     register unsigned char *stackp;
+     register long code, incode;
+ 
+     if (file->stackp > file->de_stack)
+ 	return *--file->stackp;
+ 
+     if (file->oldcode == -1)
+ 	return EOF;
+ 
+     stackp = file->stackp;
+     code = getcode (file);
+     if (code == -1)
+ 	return EOF;
+ 
+     if ( (code == CLEAR) && file->block_compress ) {
+ 	for ( code = 255; code >= 0; code-- )
+ 	    file->tab_prefix[code] = 0;
+ 	file->clear_flg = 1;
+ 	file->free_ent = FIRST - 1;
+ 	if ( (code = getcode (file)) == -1 )	/* O, untimely death! */
+ 	    return EOF;
+     }
+     incode = code;
+     /*
+      * Special case for KwKwK string.
+      */
+     if ( code >= file->free_ent ) {
+ 	*stackp++ = file->finchar;
+ 	code = file->oldcode;
+     }
+ 
+     /*
+      * Generate output characters in reverse order
+      */
+     while ( code >= 256 )
+     {
+ 	*stackp++ = file->tab_suffix[code];
+ 	code = file->tab_prefix[code];
+     }
+     file->finchar = file->tab_suffix[code];
+ 
+     /*
+      * Generate the new entry.
+      */
+     if ( (code=file->free_ent) < file->maxmaxcode ) {
+ 	file->tab_prefix[code] = (unsigned short)file->oldcode;
+ 	file->tab_suffix[code] = file->finchar;
+ 	file->free_ent = code+1;
+     } 
+     /*
+      * Remember previous code.
+      */
+     file->oldcode = incode;
+     file->stackp = stackp;
+     return file->finchar;
+ }
+ 
+ /*****************************************************************
+  * TAG( getcode )
+  *
+  * Read one code from the standard input.  If EOF, return -1.
+  * Inputs:
+  * 	stdin
+  * Outputs:
+  * 	code or -1 is returned.
+  */
+ 
+ static unsigned char rmask[9] =
+     {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
+ 
+ static long
+ getcode(file)
+     CompressedFile  *file;
+ {
+     register long code;
+     register int r_off, bits;
+     register unsigned char *bp = file->buf;
+     register FILE   *fp;
+ 
+     if ( file->clear_flg > 0 || file->offset >= file->size ||
+ 	file->free_ent > file->maxcode )
+     {
+ 	/*
+ 	 * If the next entry will be too big for the current code
+ 	 * size, then we must increase the size.  This implies reading
+ 	 * a new buffer full, too.
+ 	 */
+ 	if ( file->free_ent > file->maxcode ) {
+ 	    file->n_bits++;
+ 	    if ( file->n_bits == file->maxbits )
+ 		file->maxcode = file->maxmaxcode;	/* won't get any bigger now */
+ 	    else
+ 		file->maxcode = MAXCODE(file->n_bits);
+ 	}
+ 	if ( file->clear_flg > 0) {
+     	    file->maxcode = MAXCODE (file->n_bits = INIT_BITS);
+ 	    file->clear_flg = 0;
+ 	}
+ 	bits = file->n_bits;
+ 	fp = file->file;
+ 	while (bits > 0 && (code = getc (fp)) != EOF)
+ 	{
+ 	    *bp++ = code;
+ 	    --bits;
+ 	}
+ 	bp = file->buf;
+ 	if (bits == file->n_bits)
+ 	    return -1;			/* end of file */
+ 	file->size = file->n_bits - bits;
+ 	file->offset = 0;
+ 	/* Round size down to integral number of codes */
+ 	file->size = (file->size << 3) - (file->n_bits - 1);
+     }
+     r_off = file->offset;
+     bits = file->n_bits;
+     /*
+      * Get to the first byte.
+      */
+     bp += (r_off >> 3);
+     r_off &= 7;
+     /* Get first part (low order bits) */
+     code = (*bp++ >> r_off);
+     bits -= (8 - r_off);
+     r_off = 8 - r_off;		/* now, offset into code word */
+     /* Get any 8 bit parts in the middle (<=1 for up to 16 bits). */
+     if ( bits >= 8 ) {
+ 	code |= *bp++ << r_off;
+ 	r_off += 8;
+ 	bits -= 8;
+     }
+     /* high order bits. */
+     code |= (*bp & rmask[bits]) << r_off;
+     file->offset += file->n_bits;
+ 
+     return code;
+ }
+ 
+ int
+ CompressedFileRead (buf, nbytes, file)
+     char	    *buf;
+     unsigned	    nbytes;
+     CompressedFile  *file;
+ {
+     int		    c;
+     unsigned	    n;
+ 
+     n = nbytes;
+     while (n)
+     {
+ 	if ((c = getdcchar (file)) == EOF)
+ 	    break;
+ 	*buf++ = c;
+ 	--n;
+     }
+     return nbytes - n;
+ }
+ 
+ int
+ CompressedFileSkip (file, bytes)
+     CompressedFile  *file;
+     unsigned	    bytes;
+ {
+     int	    c = 0;
+ 
+     while (bytes-- && ((c = getdcchar(file)) != EOF))
+ 	    ;
+     return c != EOF;
+ }
+ 
+ #ifdef TEST
+ main (argc, argv)
+     int		    argc;
+     char	    **argv;
+ {
+     CompressedFile  *file;
+     int		    c;
+ 
+     file = CompressedFileOpen (argv[1]);
+     if (!file) {
+ 	fprintf(stderr, "can't open file\n");
+ 	exit(1);
+     }
+     while ((c = getdcchar (file)) != -1)
+ 	putchar (c);
+     CompressedFileClose (file);
+     exit(0);
+ }
+ #endif
diff -c mit/fonts/lib/font/bitmap/bitmapfuncs.c:1.1.1.1 mit/fonts/lib/font/bitmap/bitmapfuncs.c:1.5
*** mit/fonts/lib/font/bitmap/bitmapfuncs.c:1.1.1.1	Sat Mar 12 00:41:07 1994
--- mit/fonts/lib/font/bitmap/bitmapfuncs.c	Sat Mar 12 00:41:07 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/bitmap/bitmapfuncs.c,v 1.5 1993/03/27 08:58:49 dawes Exp $ */
  /*
   * $XConsortium: bitmapfuncs.c,v 1.3 91/06/12 14:35:17 keith Exp $
   *
***************
*** 44,60 ****
--- 45,73 ----
   */
  static BitmapFileFunctionsRec readers[] = {
      pcfReadFont, pcfReadFontInfo,
+     pcfReadFont, pcfReadFontInfo,
+     snfReadFont, snfReadFontInfo,
      snfReadFont, snfReadFontInfo,
      bdfReadFont, bdfReadFontInfo,
+     bdfReadFont, bdfReadFontInfo,
  };
  
  static FontRendererRec	renderers[] = {
+     ".pcf.Z", 6,
+     BitmapOpenBitmap, BitmapOpenScalable,
+ 	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
      ".pcf", 4,
      BitmapOpenBitmap, BitmapOpenScalable,
  	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
+     ".snf.Z", 6,
+     BitmapOpenBitmap, BitmapOpenScalable,
+ 	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
      ".snf", 4,
      BitmapOpenBitmap, BitmapOpenScalable,
  	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
+     ".bdf.Z", 6,
+     BitmapOpenBitmap, BitmapOpenScalable,
+ 	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
      ".bdf", 4,
      BitmapOpenBitmap, BitmapOpenScalable,
  	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
***************
*** 69,75 ****
      fsBitmapFormat	format;
      fsBitmapFormatMask	fmask;
  {
!     FILE       *file;
      FontPtr     pFont;
      int         i;
      int         ret;
--- 82,88 ----
      fsBitmapFormat	format;
      fsBitmapFormatMask	fmask;
  {
!     FontFilePtr file;
      FontPtr     pFont;
      int         i;
      int         ret;
***************
*** 84,95 ****
       * useful in the file functions array
       */
      i = entry->u.bitmap.renderer - renderers;
!     file = fopen(fileName, "r");
      if (!file)
  	return BadFontName;
      pFont = (FontPtr) xalloc(sizeof(FontRec));
      if (!pFont) {
! 	fclose(file);
  	return AllocError;
      }
      /* set up default values */
--- 97,108 ----
       * useful in the file functions array
       */
      i = entry->u.bitmap.renderer - renderers;
!     file = FontFileOpen(fileName, "r");
      if (!file)
  	return BadFontName;
      pFont = (FontPtr) xalloc(sizeof(FontRec));
      if (!pFont) {
! 	FontFileClose(file);
  	return AllocError;
      }
      /* set up default values */
***************
*** 104,110 ****
  
      ret = (*readers[i].ReadFont) (pFont, file, bit, byte, glyph, scan);
  
!     fclose(file);
      if (ret != Successful)
  	xfree(pFont);
      else
--- 117,123 ----
  
      ret = (*readers[i].ReadFont) (pFont, file, bit, byte, glyph, scan);
  
!     FontFileClose(file);
      if (ret != Successful)
  	xfree(pFont);
      else
***************
*** 118,126 ****
      FontEntryPtr	entry;
      char		*fileName;
  {
!     FILE    *file;
!     int	    i;
!     int	    ret;
      FontRendererPtr renderer;
  
      renderer = FontFileMatchRenderer (fileName);
--- 131,139 ----
      FontEntryPtr	entry;
      char		*fileName;
  {
!     FontFilePtr	    file;
!     int		    i;
!     int		    ret;
      FontRendererPtr renderer;
  
      renderer = FontFileMatchRenderer (fileName);
***************
*** 127,137 ****
      if (!renderer)
  	return BadFontName;
      i = renderer - renderers;
!     file = fopen (fileName, "r");
      if (!file)
  	return BadFontName;
      ret = (*readers[i].ReadInfo) (pFontInfo, file);
!     fclose (file);
      return ret;
  }
  
--- 140,150 ----
      if (!renderer)
  	return BadFontName;
      i = renderer - renderers;
!     file = FontFileOpen (fileName, "r");
      if (!file)
  	return BadFontName;
      ret = (*readers[i].ReadInfo) (pFontInfo, file);
!     FontFileClose (file);
      return ret;
  }
  
diff -c mit/fonts/lib/font/fc/FSlibos.h:1.1.1.1 mit/fonts/lib/font/fc/FSlibos.h:2.0
*** mit/fonts/lib/font/fc/FSlibos.h:1.1.1.1	Sat Mar 12 00:41:10 1994
--- mit/fonts/lib/font/fc/FSlibos.h	Sat Mar 12 00:41:10 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/fc/FSlibos.h,v 2.0 1993/10/02 07:12:48 dawes Exp $ */
  /* $XConsortium: FSlibos.h,v 1.6 91/07/19 16:39:04 rws Exp $ */
  /* @(#)FSlibos.h	4.1	91/05/02
   * Copyright 1990 Network Computing Devices;
***************
*** 24,42 ****
--- 25,56 ----
  #include <sys/ioctl.h>
  #endif
  #else
+ #if defined(AMOEBA) || defined(_MINIX)
+ #define MALLOC_0_RETURNS_NULL
+ #ifdef _MINIX
+ #include <net/gen/in.h>
+ #include <net/gen/netdb.h>
+ #include <net/gen/tcp.h>
+ #endif /* _MINIX */
+ #else /* !AMOEBA && !_MINIX */
  /*
   * 4.2BSD-based systems
   */
+ #if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN)
  #include <netinet/in.h>
  #include <sys/ioctl.h>
  #include <netdb.h>
+ #endif
  #include <sys/uio.h>
  #ifdef SVR4
  #include <sys/filio.h>
  #endif
+ #endif /* AMOEBA || _MINIX */
  
  #if defined(SYSV386) && defined(SYSV)
+ #if defined(TCPCONN) || defined(STREAMSCONN)
  #include <net/errno.h>
+ #endif
  #include <sys/stropts.h>
  #define BytesReadable(fd,ptr) ioctl((fd), I_NREAD, (ptr))
  #else
***************
*** 59,65 ****
--- 73,83 ----
  #ifdef NOFILE
  #define OPEN_MAX NOFILE
  #else
+ #ifdef _POSIX_OPEN_MAX
+ #define OPEN_MAX _POSIX_OPEN_MAX
+ #else
  #define OPEN_MAX NOFILES_MAX
+ #endif
  #endif
  #endif
  #endif
diff -c mit/fonts/lib/font/fc/Imakefile:1.1.1.1 mit/fonts/lib/font/fc/Imakefile:2.0
*** mit/fonts/lib/font/fc/Imakefile:1.1.1.1	Sat Mar 12 00:41:10 1994
--- mit/fonts/lib/font/fc/Imakefile	Sat Mar 12 00:41:10 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/fonts/lib/font/fc/Imakefile,v 2.0 1993/08/28 07:43:35 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.11 91/08/22 14:18:23 rws Exp $
  XCOMM
  XCOMM Make file for font handling routines
***************
*** 13,19 ****
  
  SubdirLibraryRule($(OBJS))
  NormalLibraryObjectRule()
! SpecialObjectRule(fsio.o,$(ICONFIGFILES),$(CONN_DEFINES))
  
  NormalLintTarget($(SRCS))
  
--- 14,20 ----
  
  SubdirLibraryRule($(OBJS))
  NormalLibraryObjectRule()
! SpecialObjectRule(fsio.o,fsio.c $(ICONFIGFILES),$(CONN_DEFINES))
  
  NormalLintTarget($(SRCS))
  
diff -c mit/fonts/lib/font/fc/fsio.c:1.1.1.2 mit/fonts/lib/font/fc/fsio.c:2.0
*** mit/fonts/lib/font/fc/fsio.c:1.1.1.2	Sat Mar 12 00:41:11 1994
--- mit/fonts/lib/font/fc/fsio.c	Sat Mar 12 00:41:11 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/fc/fsio.c,v 2.0 1993/07/28 11:54:44 dawes Exp $ */
  /* $XConsortium: fsio.c,v 1.23 92/05/14 16:52:27 gildea Exp $ */
  /*
   * Copyright 1990 Network Computing Devices
***************
*** 37,44 ****
--- 38,57 ----
  #include	"FSproto.h"
  #include	<stdio.h>
  #include	<signal.h>
+ #if defined(USG) || defined(SYSV)
+ #ifndef __TYPES__
  #include	<sys/types.h>
+ #define __TYPES__
+ #endif
+ #endif
+ 
+ #if (defined(TCPCONN) && !defined(_MINIX)) || defined(UNIXCONN) || defined(DNETCONN)
+ #define HASSOCKETS
+ #endif
+ 
+ #ifdef HASSOCKETS
  #include	<sys/socket.h>
+ #endif
  /* #include	<netinet/tcp.h> */
  #include	<errno.h>
  #include	"FSlibos.h"
***************
*** 66,71 ****
--- 79,85 ----
  static int  padlength[4] = {0, 3, 2, 1};
  unsigned long fs_fd_mask[MSKCNT];
  
+ #ifdef HASSOCKETS
  static int  _fs_wait_for_readable();
  
  _fs_name_to_address(servername, inaddr)
***************
*** 165,171 ****
      }
      /* ultrix reads hang on Unix sockets, hpux reads fail */
  
! #if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux))
      (void) fcntl(fd, F_SETFL, O_NONBLOCK);
  #else
  
--- 179,185 ----
      }
      /* ultrix reads hang on Unix sockets, hpux reads fail */
  
! #if defined(O_NONBLOCK) && (!defined(SCO) && !defined(ultrix) && !defined(hpux))
      (void) fcntl(fd, F_SETFL, O_NONBLOCK);
  #else
  
***************
*** 327,332 ****
--- 341,347 ----
  	    return TRUE;
      return FALSE;
  }
+ #endif /* HASSOCKETS */
  
  #define FS_OPEN_TIMEOUT	    30
  #define FS_REOPEN_TIMEOUT   10
***************
*** 335,340 ****
--- 350,358 ----
  _fs_open_server(servername)
      char       *servername;
  {
+ #ifndef HASSOCKETS
+     return (FSFpePtr) NULL;
+ #else
      FSFpePtr    conn;
  
      conn = (FSFpePtr) xalloc(sizeof(FSFpeRec));
***************
*** 351,356 ****
--- 369,375 ----
  	}
      }
      return conn;
+ #endif /* HASSOCKETS */
  }
  
  Bool
***************
*** 357,366 ****
--- 376,387 ----
  _fs_reopen_server(conn)
      FSFpePtr    conn;
  {
+ #ifdef HASSOCKETS
      if (_fs_setup_connection(conn, conn->servername, FS_REOPEN_TIMEOUT))
  	return TRUE;
      if (_fs_try_alternates(conn, FS_REOPEN_TIMEOUT))
  	return TRUE;
+ #endif
      return FALSE;
  }
  
***************
*** 373,378 ****
--- 394,402 ----
      char       *data;
      unsigned long size;
  {
+ #ifndef HASSOCKETS
+     return -1;
+ #else
      long        bytes_read;
  
      if (size == 0) {
***************
*** 407,412 ****
--- 431,437 ----
  	}
      }
      return 0;
+ #endif /* HASSOCKETS */
  }
  
  _fs_write(conn, data, size)
***************
*** 414,419 ****
--- 439,447 ----
      char       *data;
      unsigned long size;
  {
+ #ifndef HASSOCKETS
+     return -1;
+ #else
      long        bytes_written;
  
      if (size == 0) {
***************
*** 444,449 ****
--- 472,478 ----
  	}
      }
      return 0;
+ #endif /* HASSOCKETS */
  }
  
  _fs_read_pad(conn, data, len)
***************
*** 451,456 ****
--- 480,488 ----
      char       *data;
      int         len;
  {
+ #ifndef HASSOCKETS
+     return -1;
+ #else
      char        pad[3];
  
      if (_fs_read(conn, data, len) == -1)
***************
*** 461,466 ****
--- 493,499 ----
  	return _fs_read(conn, pad, padlength[len & 3]);
      }
      return 0;
+ #endif /* HASSOCKETS */
  }
  
  _fs_write_pad(conn, data, len)
***************
*** 468,473 ****
--- 501,509 ----
      char       *data;
      int         len;
  {
+ #ifndef HASSOCKETS
+     return -1;
+ #else
      static char pad[3];
  
      if (_fs_write(conn, data, len) == -1)
***************
*** 478,483 ****
--- 514,520 ----
  	return _fs_write(conn, pad, padlength[len & 3]);
      }
      return 0;
+ #endif /* HASSOCKETS */
  }
  
  /*
***************
*** 487,499 ****
--- 524,541 ----
  _fs_data_ready(conn)
      FSFpePtr    conn;
  {
+ #ifndef HASSOCKETS
+     return -1;
+ #else
      long        readable;
  
      if (BytesReadable(conn->fs_fd, &readable) < 0)
  	return -1;
      return readable;
+ #endif /* HASSOCKETS */
  }
  
+ #ifdef HASSOCKETS
  static int
  _fs_wait_for_readable(conn)
      FSFpePtr    conn;
***************
*** 511,517 ****
      do {
  	BITSET(r_mask, conn->fs_fd);
  	BITSET(e_mask, conn->fs_fd);
! 	result = select(conn->fs_fd + 1, r_mask, NULL, e_mask, NULL);
  	if (result == -1) {
  	    if (errno != EINTR)
  		return -1;
--- 553,560 ----
      do {
  	BITSET(r_mask, conn->fs_fd);
  	BITSET(e_mask, conn->fs_fd);
! 	result = select(conn->fs_fd + 1, (fd_set *)r_mask, NULL,
! 			(fd_set *)e_mask, NULL);
  	if (result == -1) {
  	    if (errno != EINTR)
  		return -1;
***************
*** 524,529 ****
--- 567,573 ----
  
      return 0;
  }
+ #endif /* HASSOCKETS */
  
  int
  _fs_set_bit(mask, fd)
***************
*** 579,584 ****
--- 623,631 ----
      FSFpePtr    conn;
      int         len;
  {
+ #ifndef HASSOCKETS
+     return -1;
+ #else
      char        buf[128];
  
  #ifdef DEBUG
***************
*** 591,596 ****
--- 638,644 ----
  	len -= 128;
      }
      return 0;
+ #endif /* HASSOCKETS */
  }
  
  _fs_drain_bytes_pad(conn, len)
***************
*** 597,602 ****
--- 645,653 ----
      FSFpePtr    conn;
      int         len;
  {
+ #ifndef HASSOCKETS
+     return -1;
+ #else
      _fs_drain_bytes(conn, len);
  
      /* read the junk */
***************
*** 603,608 ****
--- 654,660 ----
      if (padlength[len & 3]) {
  	_fs_drain_bytes(conn, padlength[len & 3]);
      }
+ #endif /* HASSOCKETS */
  }
  
  _fs_eat_rest_of_error(conn, err)
***************
*** 609,614 ****
--- 661,669 ----
      FSFpePtr    conn;
      fsError    *err;
  {
+ #ifndef HASSOCKETS
+     return -1;
+ #else
      int         len = (err->length - (sizeof(fsReplyHeader) >> 2)) << 2;
  
  #ifdef DEBUG
***************
*** 616,619 ****
--- 671,675 ----
  #endif
  
      _fs_drain_bytes(conn, len);
+ #endif /* HASSOCKETS */
  }
diff -c mit/fonts/lib/font/fontfile/Imakefile:1.1.1.1 mit/fonts/lib/font/fontfile/Imakefile:1.6
*** mit/fonts/lib/font/fontfile/Imakefile:1.1.1.1	Sat Mar 12 00:41:13 1994
--- mit/fonts/lib/font/fontfile/Imakefile	Sat Mar 12 00:41:13 1994
***************
*** 1,8 ****
--- 1,11 ----
+ XCOMM $XFree86: mit/fonts/lib/font/fontfile/Imakefile,v 1.6 1993/03/27 08:58:55 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.5 91/07/22 22:21:11 rws Exp $
  #include <Server.tmpl>
  
          INCLUDES = -I$(FONTSRC)/include -I../include -I$(FONTSERVERSRC)/include
           HEADERS = 
+        RENDERERS = FontRenderers
+ 
  #ifdef FontFormatDefines
       FORMAT_DEFS = FontFormatDefines
  #endif
***************
*** 14,19 ****
--- 17,26 ----
  SubdirLibraryRule($(OBJS))
  NormalLibraryObjectRule()
  NormalLintTarget($(SRCS))
+ 
+ ConfigTarget(rendererConf,$(ICONFIGFILES),configrend.sh,$(RENDERERS))
+ 
+ InstallLinkKitNonExecFile(configrend.sh,$(LINKKITDIR))
  
  DependTarget()
  
diff -c /dev/null mit/fonts/lib/font/fontfile/configrend.sh:1.2
*** /dev/null	Sat Mar 12 00:41:13 1994
--- mit/fonts/lib/font/fontfile/configrend.sh	Sat Mar 12 00:41:13 1994
***************
*** 0 ****
--- 1,24 ----
+ #!/bin/sh
+ 
+ # $XFree86: mit/fonts/lib/font/fontfile/configrend.sh,v 1.2 1993/03/27 08:58:56 dawes Exp $
+ #
+ # This script generates rendererConf.c
+ #
+ # usage: configrend.sh driver1 driver2 ...
+ #
+ 
+ RENDCONF=./rendererConf.c
+ 
+ cat > $RENDCONF <<EOF
+ /*
+  * This file is generated automatically -- DO NOT EDIT
+  */
+ 
+ FontFileRegisterFontFileFunctions ()
+ {
+     BitmapRegisterFontFileFunctions ();
+ EOF
+ for i in $*; do
+   echo "    ${i}RegisterFontFileFunctions ();" >> $RENDCONF
+ done
+ echo '}' >> $RENDCONF
diff -c mit/fonts/lib/font/fontfile/dirfile.c:1.1.1.2 mit/fonts/lib/font/fontfile/dirfile.c:1.3
*** mit/fonts/lib/font/fontfile/dirfile.c:1.1.1.2	Sat Mar 12 00:41:13 1994
--- mit/fonts/lib/font/fontfile/dirfile.c	Sat Mar 12 00:41:14 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/fontfile/dirfile.c,v 1.3 1993/03/27 08:58:58 dawes Exp $ */
  /*
   * $XConsortium: dirfile.c,v 1.5 91/12/11 19:49:06 eswu Exp $
   *
***************
*** 31,37 ****
--- 32,43 ----
  
  #include    "fontfilest.h"
  #include    <stdio.h>
+ #if defined(USG) || defined(SYSV)
+ #ifndef __TYPES__
  #include    <sys/types.h>
+ #define __TYPES__
+ #endif
+ #endif
  #include    <errno.h>
  #include    <sys/stat.h>
  
diff -c mit/fonts/lib/font/fontfile/fontdir.c:1.1.1.3 mit/fonts/lib/font/fontfile/fontdir.c:1.3
*** mit/fonts/lib/font/fontfile/fontdir.c:1.1.1.3	Sat Mar 12 00:41:14 1994
--- mit/fonts/lib/font/fontfile/fontdir.c	Sat Mar 12 00:41:14 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/fonts/lib/font/fontfile/fontdir.c,v 1.3 1993/03/27 08:58:59 dawes Exp $
   * $XConsortium: fontdir.c,v 1.9 92/03/20 15:53:29 eswu Exp $
   *
   * Copyright 1991 Massachusetts Institute of Technology
***************
*** 174,181 ****
      FontTablePtr    table;
  {
      if (!table->sorted) {
! 	qsort((char *) table->entries, table->used, sizeof(FontEntryRec),
! 	      FontFileNameCompare);
  	table->sorted = TRUE;
      }
  }
--- 175,183 ----
      FontTablePtr    table;
  {
      if (!table->sorted) {
! 	if (table->used > 0)
! 	    qsort((char *) table->entries, table->used, sizeof(FontEntryRec),
! 	          FontFileNameCompare);
  	table->sorted = TRUE;
      }
  }
diff -c mit/fonts/lib/font/fontfile/renderers.c:1.1.1.1 mit/fonts/lib/font/fontfile/renderers.c:1.5
*** mit/fonts/lib/font/fontfile/renderers.c:1.1.1.1	Sat Mar 12 00:41:14 1994
--- mit/fonts/lib/font/fontfile/renderers.c	Sat Mar 12 00:41:15 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/fonts/lib/font/fontfile/renderers.c,v 1.5 1993/03/27 08:59:01 dawes Exp $ */
  /*
   * $XConsortium: renderers.c,v 1.1 91/05/10 14:46:38 keith Exp $
   *
***************
*** 25,35 ****
--- 26,41 ----
  
  #include    "fontfilest.h"
  
+ /*
  FontFileRegisterFontFileFunctions ()
  {
      BitmapRegisterFontFileFunctions ();
      SpeedoRegisterFontFileFunctions ();
+ #ifdef TYPE1
+     Type1RegisterFontFileFunctions();
+ #endif
  }
+ */
  
  static FontRenderersRec	renderers;
  
diff -c mit/fonts/bdf/Imakefile:1.1.1.1 mit/fonts/bdf/Imakefile:1.3
*** mit/fonts/bdf/Imakefile:1.1.1.1	Sat Mar 12 00:41:16 1994
--- mit/fonts/bdf/Imakefile	Sat Mar 12 00:41:17 1994
***************
*** 1,8 ****
  XCOMM $XConsortium: Imakefile,v 1.8 91/07/16 23:03:51 gildea Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags /* as nothing */
  
!         SUBDIRS = misc 75dpi 100dpi
  
  MakeSubdirs($(SUBDIRS))
  DependSubdirs($(SUBDIRS))
--- 1,16 ----
+ XCOMM $XFree86: mit/fonts/bdf/Imakefile,v 1.3 1993/03/27 08:58:17 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.8 91/07/16 23:03:51 gildea Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags /* as nothing */
  
! #if Build75Dpi
! DIR75 = 75dpi
! #endif
! #if Build100Dpi
! DIR100 = 100dpi
! #endif
! 
!         SUBDIRS = misc $(DIR75) $(DIR100)
  
  MakeSubdirs($(SUBDIRS))
  DependSubdirs($(SUBDIRS))
diff -c mit/fonts/bdf/misc/Imakefile:1.1.1.1 mit/fonts/bdf/misc/Imakefile:2.0
*** mit/fonts/bdf/misc/Imakefile:1.1.1.1	Sat Mar 12 00:41:18 1994
--- mit/fonts/bdf/misc/Imakefile	Sat Mar 12 00:41:18 1994
***************
*** 1,4 ****
--- 1,15 ----
+ XCOMM $XFree86: mit/fonts/bdf/misc/Imakefile,v 2.0 1993/06/13 06:58:25 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.31 91/07/18 11:51:41 gildea Exp $
+ 
+ #if BuildLargeMiscFonts
+ LARGEOBJ = FontObj(k14) \
+ 	FontObj(jiskan16) FontObj(jiskan24) \
+ 	FontObj(hanglg16) FontObj(hanglm16) FontObj(hanglm24)
+ BUILDLARGEFONTS = YES
+ #else
+ BUILDLARGEFONTS = NO
+ #endif
+ 
  OBJS = FontObj(5x7) FontObj(5x8) FontObj(6x9) FontObj(6x10) FontObj(6x12) \
  	FontObj(6x13) FontObj(6x13B) FontObj(7x13) FontObj(7x13B) FontObj(8x13) \
  	FontObj(8x13B) FontObj(9x15) FontObj(9x15B) FontObj(10x20) \
***************
*** 13,24 ****
  	FontObj(clR7x8) FontObj(clR8x10) FontObj(clR8x12) FontObj(clR8x13) \
  	FontObj(clR8x14) FontObj(clR8x16) FontObj(clR8x8) FontObj(clR9x15) \
  	FontObj(heb6x13) FontObj(heb8x13) \
! 	FontObj(k14) FontObj(7x14) FontObj(7x14B) FontObj(7x14rk) \
  	FontObj(12x24) FontObj(12x24rk) FontObj(8x16) FontObj(8x16rk) \
! 	FontObj(jiskan16) FontObj(jiskan24) \
! 	FontObj(hanglg16) FontObj(hanglm16) FontObj(hanglm24)
  
  FONTINSTDIR = $(FONTDIR)/misc
  
  MakeFonts()
  
--- 24,37 ----
  	FontObj(clR7x8) FontObj(clR8x10) FontObj(clR8x12) FontObj(clR8x13) \
  	FontObj(clR8x14) FontObj(clR8x16) FontObj(clR8x8) FontObj(clR9x15) \
  	FontObj(heb6x13) FontObj(heb8x13) \
! 	FontObj(7x14) FontObj(7x14B) FontObj(7x14rk) \
  	FontObj(12x24) FontObj(12x24rk) FontObj(8x16) FontObj(8x16rk) \
! 	$(LARGEOBJ)
  
  FONTINSTDIR = $(FONTDIR)/misc
+ 
+ CppFileTarget(fonts.alias, fonts.al.cpp, \
+     	-DBUILDLARGEFONTS=$(BUILDLARGEFONTS), $(ICONFIGFILES))
  
  MakeFonts()
  
diff -c /dev/null mit/fonts/bdf/misc/fonts.al.cpp:1.1
*** /dev/null	Sat Mar 12 00:41:18 1994
--- mit/fonts/bdf/misc/fonts.al.cpp	Sat Mar 12 00:41:18 1994
***************
*** 0 ****
--- 1,75 ----
+ fixed        -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
+ variable     -*-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-1
+ 5x7          -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-1
+ 5x8          -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-1
+ 6x9          -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-1
+ 6x10         -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1
+ 6x12         -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-1
+ 6x13         -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
+ 6x13bold     -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-1
+ 7x13         -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
+ 7x13bold     -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-1
+ 7x14         -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
+ 7x14bold     -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
+ 8x13         -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1
+ 8x13bold     -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1
+ 8x16         -sony-fixed-medium-r-normal--16-120-100-100-c-80-iso8859-1
+ 9x15         -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1
+ 9x15bold     -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1
+ 10x20        -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
+ 12x24        -sony-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-1
+ nil2         -misc-nil-medium-r-normal--2-20-75-75-c-10-misc-fontspecific
+ 
+ heb6x13      -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-8
+ heb8x13      -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-8
+ 
+ #if BUILDLARGEFONTS
+ k14          -misc-fixed-medium-r-normal--14-*-*-*-*-*-jisx0208.1983-0
+ a14          -misc-fixed-medium-r-normal--14-*-*-*-*-*-iso8859-1
+ r14          -misc-fixed-medium-r-normal--14-*-*-*-*-*-jisx0201.1976-0
+ rk14         -misc-fixed-medium-r-normal--14-*-*-*-*-*-jisx0201.1976-0
+ r16          -sony-fixed-medium-r-normal--16-*-*-*-*-*-jisx0201.1976-0
+ rk16         -sony-fixed-medium-r-normal--16-*-*-*-*-*-jisx0201.1976-0
+ r24          -sony-fixed-medium-r-normal--24-*-*-*-*-*-jisx0201.1976-0
+ rk24         -sony-fixed-medium-r-normal--24-*-*-*-*-*-jisx0201.1976-0
+ kana14       -misc-fixed-medium-r-normal--14-*-*-*-*-*-jisx0201.1976-0
+ 8x16kana     -sony-fixed-medium-r-normal--16-120-100-100-c-80-jisx0201.1976-0
+ 8x16romankana -sony-fixed-medium-r-normal--16-120-100-100-c-80-jisx0201.1976-0
+ 12x24kana     -sony-fixed-medium-r-normal--24-170-100-100-c-120-jisx0201.1976-0
+ 12x24romankana -sony-fixed-medium-r-normal--24-170-100-100-c-120-jisx0201.1976-0
+ kanji16      -jis-fixed-medium-r-normal--16-*-*-*-*-*-jisx0208.1983-0
+ kanji24      -jis-fixed-medium-r-normal--24-*-*-*-*-*-jisx0208.1983-0
+ #endif
+ 
+ olcursor   "-sun-open look cursor-----12-120-75-75-p-160-sunolcursor-1"
+ olglyph-10 "-sun-open look glyph-----10-100-75-75-p-101-sunolglyph-1"
+ olglyph-12 "-sun-open look glyph-----12-120-75-75-p-113-sunolglyph-1"
+ olglyph-14 "-sun-open look glyph-----14-140-75-75-p-128-sunolglyph-1"
+ olglyph-19 "-sun-open look glyph-----19-190-75-75-p-154-sunolglyph-1"
+ 
+ -misc-fixed-medium-r-normal--7-50-100-100-c-50-iso8859-1 -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-1
+ -misc-fixed-medium-r-normal--8-60-100-100-c-50-iso8859-1 -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-1
+ -misc-fixed-medium-r-normal--9-80-100-100-c-60-iso8859-1 -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-1
+ -misc-fixed-medium-r-normal--10-70-100-100-c-60-iso8859-1 -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1
+ -misc-fixed-medium-r-semicondensed--12-90-100-100-c-60-iso8859-1 -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-1
+ -misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1 -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
+ -misc-fixed-bold-r-semicondensed--13-100-100-100-c-60-iso8859-1 -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-1
+ -misc-fixed-medium-r-normal--13-100-100-100-c-70-iso8859-1 -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
+ -misc-fixed-bold-r-normal--13-100-100-100-c-70-iso8859-1 -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-1
+ -misc-fixed-medium-r-normal--13-100-100-100-c-80-iso8859-1 -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1
+ -misc-fixed-bold-r-normal--13-100-100-100-c-80-iso8859-1 -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1
+ -misc-fixed-medium-r-normal--14-110-100-100-c-70-iso8859-1 -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
+ -misc-fixed-medium-r-normal--15-120-100-100-c-90-iso8859-1 -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1
+ -misc-fixed-bold-r-normal--15-120-100-100-c-90-iso8859-1 -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1
+ -misc-fixed-medium-r-normal--20-140-100-100-c-100-iso8859-1 -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
+ -misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-8 -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-8
+ -misc-fixed-medium-r-normal--13-100-100-100-c-80-iso8859-8 -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-8
+ 
+ #if BUILDLARGEFONTS
+ -sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1 -sony-fixed-medium-r-normal--16-120-100-100-c-80-iso8859-1
+ -sony-fixed-medium-r-normal--16-150-75-75-c-80-jisx0201.1976-0 -sony-fixed-medium-r-normal--16-120-100-100-c-80-jisx0201.1976-0
+ -sony-fixed-medium-r-normal--24-230-75-75-c-120-iso8859-1 -sony-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-1
+ -sony-fixed-medium-r-normal--24-230-75-75-c-120-jisx0201.1976-0 -sony-fixed-medium-r-normal--24-170-100-100-c-120-jisx0201.1976-0
+ -jis-fixed-medium-r-normal--16-110-100-100-c-160-jisx0208.1983-0 -jis-fixed-medium-r-normal--16-150-75-75-c-160-jisx0208.1983-0
+ -jis-fixed-medium-r-normal--24-170-100-100-c-240-jisx0208.1983-0 -jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-0
+ #endif
diff -c mit/extensions/Imakefile:1.1.1.1 mit/extensions/Imakefile:2.0
*** mit/extensions/Imakefile:1.1.1.1	Sat Mar 12 00:41:19 1994
--- mit/extensions/Imakefile	Sat Mar 12 00:41:19 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/extensions/Imakefile,v 2.0 1993/12/17 10:57:30 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.13 91/07/16 23:10:30 gildea Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags
***************
*** 9,15 ****
--- 10,20 ----
    SERVERSUBDIRS = server/PEX/dipex/swap
  #endif
  #endif
+ #if BuildServersOnly
+         SUBDIRS = $(SERVERSUBDIRS)
+ #else
          SUBDIRS = $(SERVERSUBDIRS) lib include test
+ #endif
  
  MakeSubdirs($(SUBDIRS))
  DependSubdirs($(SUBDIRS))
diff -c mit/extensions/lib/Imakefile:1.1.1.3 mit/extensions/lib/Imakefile:1.3
*** mit/extensions/lib/Imakefile:1.1.1.3	Sat Mar 12 00:41:23 1994
--- mit/extensions/lib/Imakefile	Sat Mar 12 00:41:23 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/extensions/lib/Imakefile,v 1.3 1993/03/27 08:56:41 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.33.1.2 92/11/16 12:44:08 rws Exp $
  #define DoNormalLib NormalLibXext
  #define DoSharedLib SharedLibXext
***************
*** 35,40 ****
--- 36,45 ----
       LINTLIBS = $(LINTXLIB)
  
  LibraryObjectRule()
+ 
+ #if defined(i386SVR3Architecture)
+ SpecialLibObjectRule(globals.o,$(ICONFIGFILES),-D_libXext_import)
+ #endif
  
  #if DoSharedLib
  #if DoNormalLib
diff -c mit/extensions/lib/XMultibuf.c:1.1.1.1 mit/extensions/lib/XMultibuf.c:1.2
*** mit/extensions/lib/XMultibuf.c:1.1.1.1	Sat Mar 12 00:41:23 1994
--- mit/extensions/lib/XMultibuf.c	Sat Mar 12 00:41:23 1994
***************
*** 25,30 ****
--- 25,33 ----
  
  #define NEED_EVENTS
  #define NEED_REPLIES
+ #ifdef SCO
+ #include <stdio.h>
+ #endif
  #include <X11/Xlibint.h>
  #include "Xext.h"			/* in ../include */
  #include "extutil.h"			/* in ../include */
diff -c mit/extensions/lib/XShm.c:1.1.1.1 mit/extensions/lib/XShm.c:1.2
*** mit/extensions/lib/XShm.c:1.1.1.1	Sat Mar 12 00:41:24 1994
--- mit/extensions/lib/XShm.c	Sat Mar 12 00:41:24 1994
***************
*** 27,32 ****
--- 27,35 ----
  
  #define NEED_EVENTS
  #define NEED_REPLIES
+ #ifdef SCO
+ #include <stdio.h>
+ #endif
  #include "Xlibint.h"
  #include "XShm.h"
  #include "shmstr.h"
diff -c mit/extensions/lib/XTestExt1.c:1.1.1.1 mit/extensions/lib/XTestExt1.c:1.4
*** mit/extensions/lib/XTestExt1.c:1.1.1.1	Sat Mar 12 00:41:24 1994
--- mit/extensions/lib/XTestExt1.c	Sat Mar 12 00:41:25 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/extensions/lib/XTestExt1.c,v 1.4 1993/05/04 14:57:39 dawes Exp $
   *	File:  xtestext1lib.c
   *
   *	This file contains the Xlib parts of the input synthesis extension
***************
*** 35,40 ****
--- 36,44 ----
  #define NEED_REPLIES
  #define NEED_EVENTS
  
+ #ifdef SCO
+ #include <stdio.h>
+ #endif
  #include <X11/Xproto.h>
  #include <X11/Xlibint.h>
  #include <X11/extensions/xtestext1.h>
***************
*** 58,65 ****
--- 62,74 ----
   *
   * These two variables must be available to programs that use this extension.
   */
+ #ifdef SVR3SHLIB
+ extern int                     XTestInputActionType;
+ extern int                     XTestFakeAckType;
+ #else
  int			XTestInputActionType = 0;
  int			XTestFakeAckType   = 1;
+ #endif
  /*
   * holds the current x and y coordinates for XTestMovePointer
   */
diff -c mit/extensions/lib/globals.c:1.1.1.1 mit/extensions/lib/globals.c:2.1
*** mit/extensions/lib/globals.c:1.1.1.1	Sat Mar 12 00:41:25 1994
--- mit/extensions/lib/globals.c	Sat Mar 12 00:41:25 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/extensions/lib/globals.c,v 2.1 1993/09/27 12:22:14 dawes Exp $
   * $XConsortium: globals.c,v 1.1 89/10/03 17:25:16 jim Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 10,16 ****
--- 11,21 ----
   */
  #include <X11/Xlib.h>
  #include <X11/extensions/Xext.h>
+ #if __STDC__ && !defined(SCO)
+ #include <stdlib.h>
+ #else
  #include <sys/param.h>			/* for definition of NULL */
+ #endif
  
  
  /*
***************
*** 18,24 ****
   * Some shared library implementations are *much* happier if there isn't any
   * global initialized data.
   */
! #ifdef NULL_NOT_ZERO			/* then need to initialize */
  #define SetZero(t,var,z) t var = z
  #else 
  #define SetZero(t,var,z) t var
--- 23,29 ----
   * Some shared library implementations are *much* happier if there isn't any
   * global initialized data.
   */
! #if defined(NULL_NOT_ZERO) || defined(SVR3SHLIB) /* then need to initialize */
  #define SetZero(t,var,z) t var = z
  #else 
  #define SetZero(t,var,z) t var
***************
*** 52,57 ****
--- 57,68 ----
   */
  typedef int (*funcptr)();
  ZEROINIT (funcptr, _XExtensionErrorFunction, NULL);
+ 
+ #ifdef SVR3SHLIB      /* otherwise it's in XTestExt1.c */
+ int                     XTestInputActionType = 0;
+ int                     XTestFakeAckType   = 1;
+ #endif
+ #include "libXext.c"
  
  /*
   * NOTE: any additional external definition NEED
diff -c /dev/null mit/extensions/lib/import.h:1.3
*** /dev/null	Sat Mar 12 00:41:25 1994
--- mit/extensions/lib/import.h	Sat Mar 12 00:41:25 1994
***************
*** 0 ****
--- 1,63 ----
+ /* libXext : import.h
+  * indirection defines
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/extensions/lib/import.h,v 1.3 1993/05/04 14:57:41 dawes Exp $
+  */
+ 
+ #ifndef _libXext_import
+ #define _libXext_import
+ #ifdef SVR3SHLIB
+ 
+ #define _iob  (*_libXext__iob)
+ #define calloc  (*_libXext_calloc)
+ #define exit  (*_libXext_exit)
+ #define fprintf  (*_libXext_fprintf)
+ /* prevent name conflict with member free of XFontSetMethods */
+ #define free(ptr) (*_libXext_free)(ptr)
+ #define malloc  (*_libXext_malloc)
+ #define printf  (*_libXext_printf)
+ #define sprintf  (*_libXext_sprintf)
+ 
+ 
+ /* Imported functions declarations
+  * Why declaring some imported functions here?
+  * This should be done gracefully through including of the systems
+  * header files. Unfortunatly there are some source files don't
+  * include all headers they should include, there are also some functions
+  * nowhere declared in the systems headers and some are declared
+  * without extern and cause problems since the names are redefined
+  * and these declarations then become undesired false pointer definitions.
+  */
+ 
+ #ifdef __STDC__
+ extern void exit(int);
+ #ifndef SCO
+ extern int printf(char const *, ...);
+ extern int sprintf(char *, char const *, ...);
+ #endif
+ #else
+ extern void exit();
+ #ifndef SCO
+ extern int printf();
+ extern int sprintf();
+ #endif
+ #endif
+ 
+ /* use char * also for __STDC__, the sources want it */ 
+ extern char *malloc(), *calloc();
+ 
+ /* Functions with ambiguous names */
+ 
+ #ifdef __STDC__
+ extern void free(void *);
+ #else
+ extern void (*_libXext_free)();
+ #endif
+ 
+ #endif
+ #endif
+ 
diff -c /dev/null mit/extensions/lib/libXext.c:1.2
*** /dev/null	Sat Mar 12 00:41:25 1994
--- mit/extensions/lib/libXext.c	Sat Mar 12 00:41:26 1994
***************
*** 0 ****
--- 1,46 ----
+ /* libXext : libXext.c
+  * exported data
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/extensions/lib/libXext.c,v 1.2 1993/03/27 08:56:50 dawes Exp $
+  */
+ 
+ #ifdef SVR3SHLIB
+ 
+ #define VoidInit(var) void *var = 0
+ 
+ VoidInit(_libXext__iob);
+ VoidInit(_libXext_calloc);
+ VoidInit(_libXext_exit);
+ VoidInit(_libXext_fprintf);
+ VoidInit(_libXext_free);
+ VoidInit(_libXext_malloc);
+ VoidInit(_libXext_printf);
+ VoidInit(_libXext_sprintf);
+ 
+ 
+ #ifndef __GNUC__
+ /*
+  * If we are working with floating point aritmetic, stock AT&T cc generates
+  * an unresolved reference to __fltused. But we want to make a shared lib from
+  * this here and don't want to reference /lib/libc_s.a, just define this sym as
+  * (shared lib) static.
+  * The trick is that while building the shared lib all references to this
+  * symbol are resolved internally. But the symbol will be outside only visible
+  * as a static one, so preventing a name conflict with other shared libs.
+  */
+ long __fltused = 0;
+ #endif
+ 
+ /* A dummy function for free branchtab-slots.
+  * This would be a great place for an error-check mechanism for shared libs.
+  * (Print error message if not existent function is called.)
+  */
+ extern void _libXext_dummy() {};
+ 
+ #endif
+ 
+ 
diff -c /dev/null mit/extensions/lib/libXext.def:1.3
*** /dev/null	Sat Mar 12 00:41:26 1994
--- mit/extensions/lib/libXext.def	Sat Mar 12 00:41:26 1994
***************
*** 0 ****
--- 1,129 ----
+ /* libXext : libXext.def
+  * shared library description file
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/extensions/lib/libXext.def,v 1.3 1993/03/27 08:56:51 dawes Exp $
+  */
+ 
+ /**/#address .text 0xB2000000
+ /**/#address .data 0xB2400000
+ 
+ 
+ /**/#objects noload
+ ../../lib/X/libX11_s.a
+ 
+ /**/#branch
+ XMITMiscGetBugMode 1
+ XMITMiscQueryExtension 2
+ XMITMiscSetBugMode 3
+ XMissingExtension 4
+ XSetExtensionErrorHandler 5
+ XShapeCombineMask 6
+ XShapeCombineRectangles 7
+ XShapeCombineRegion 8
+ XShapeCombineShape 9
+ XShapeGetRectangles 10
+ XShapeInputSelected 11
+ XShapeOffsetShape 12
+ XShapeQueryExtension 13
+ XShapeQueryExtents 14
+ XShapeQueryVersion 15
+ XShapeSelectInput 16
+ XShmAttach 17
+ XShmCreateImage 18
+ XShmCreatePixmap 19
+ XShmDetach 20
+ XShmGetEventBase 21
+ XShmGetImage 22
+ XShmPixmapFormat 23
+ XShmPutImage 24
+ XShmQueryExtension 25
+ XShmQueryVersion 26
+ XTestFakeInput 27
+ XTestFlush 28
+ XTestGetInput 29
+ XTestMovePointer 30
+ XTestPressButton 31
+ XTestPressKey 32
+ XTestQueryInputSize 33
+ XTestReset 34
+ XTestStopInput 35
+ XextAddDisplay 36
+ XextCreateExtension 37
+ XextDestroyExtension 38
+ XextFindDisplay 39
+ XextRemoveDisplay 40
+ XmbufChangeBufferAttributes 41
+ XmbufChangeWindowAttributes 42
+ XmbufCreateBuffers 43
+ XmbufCreateStereoWindow 44
+ XmbufDestroyBuffers 45
+ XmbufDisplayBuffers 46
+ XmbufGetBufferAttributes 47
+ XmbufGetScreenInfo 48
+ XmbufGetVersion 49
+ XmbufGetWindowAttributes 50
+ XmbufQueryExtension 51
+ 
+ _libXext_dummy 52-100
+ 
+ 
+ /**/#objects
+ DOWN/globals.o  /* All objects with global data must be come at first!*/
+ DOWN/MITMisc.o
+ DOWN/XMultibuf.o
+ DOWN/XShape.o
+ DOWN/XShm.o
+ DOWN/XTestExt1.o
+ DOWN/extutil.o
+ 
+ 
+ /* init section
+  */
+ 
+ /**/#init globals.o
+ _libXext_free  free
+ _libXext_malloc  malloc
+ _libXext_sprintf  sprintf
+ 
+ /**/#init XShm.o
+ _libXext_calloc  calloc
+ 
+ /**/#init XTestExt1.o
+ _libXext_exit  exit
+ _libXext_printf  printf
+ 
+ /**/#init extutil.o
+ _libXext__iob  _iob
+ _libXext_fprintf  fprintf
+ 
+ 
+ 
+ /**/#libraries
+ /* Here can objects be specified, which will extracted from
+  * an specified archive library and then linked to the shared
+  * library. This can avoid unwanted referencing of other
+  * shared libraries.
+  * NOTE: this objects must be listed also under #objects!
+  * e.g.:
+ /lib/libc.a memcpy.o
+  * or e.g.:
+ #ifdef __GNUC__
+ GNULIB  _fixdfsi.o
+ #endif
+  *
+  * NOT USED YET
+  *
+  */
+ 
+ /**/#externals
+ /* Here you can specify objects which will only linked to the
+  * host shared library.
+  * That are e.g. objects which contain only big data you want
+  * to seperate from the text section. (See mit/util/mksv3shlib/README.)
+  */
+ 
+ /* There must be a comment as last line */
diff -c mit/extensions/lib/PEX/c_binding/cb_err.c:1.1.1.1 mit/extensions/lib/PEX/c_binding/cb_err.c:1.2
*** mit/extensions/lib/PEX/c_binding/cb_err.c:1.1.1.1	Sat Mar 12 00:41:31 1994
--- mit/extensions/lib/PEX/c_binding/cb_err.c	Sat Mar 12 00:41:31 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/extensions/lib/PEX/c_binding/cb_err.c,v 1.2 1993/05/18 15:35:23 dawes Exp $ */
  /* $XConsortium: cb_err.c,v 5.2 91/03/29 16:31:50 rws Exp $ */
  
  /***********************************************************
***************
*** 176,182 ****
  	/* null out newline in function name string */
  	msgnl = strrchr (funcname, '\n');
  	if (msgnl)
! 	    *msgnl = NULL;
      }
  
      /* 
--- 177,183 ----
  	/* null out newline in function name string */
  	msgnl = strrchr (funcname, '\n');
  	if (msgnl)
! 	    *msgnl = 0;
      }
  
      /* 
***************
*** 184,196 ****
       */
      if (err_lookup_string (errmsgfile, errnum, msgbuf, MSG_BUF_SIZE)) {
  	msgtext = strchr (msgbuf, ':'); /* find delimiter */
! 	*msgtext = NULL; 		/* end msgname string */
  	++msgtext;			/* advance to message text */
  
  	/* null out newline in message string */
  	msgnl = strrchr (msgtext, '\n');
  	if (msgnl)
! 	    *msgnl = NULL;
  
  	/*
           * at last, format the message.
--- 185,197 ----
       */
      if (err_lookup_string (errmsgfile, errnum, msgbuf, MSG_BUF_SIZE)) {
  	msgtext = strchr (msgbuf, ':'); /* find delimiter */
! 	*msgtext = 0; 			/* end msgname string */
  	++msgtext;			/* advance to message text */
  
  	/* null out newline in message string */
  	msgnl = strrchr (msgtext, '\n');
  	if (msgnl)
! 	    *msgnl = 0;
  
  	/*
           * at last, format the message.
diff -c mit/extensions/lib/PEX/cp/cp_ccom.c:1.1.1.2 mit/extensions/lib/PEX/cp/cp_ccom.c:2.0
*** mit/extensions/lib/PEX/cp/cp_ccom.c:1.1.1.2	Sat Mar 12 00:41:33 1994
--- mit/extensions/lib/PEX/cp/cp_ccom.c	Sat Mar 12 00:41:33 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/extensions/lib/PEX/cp/cp_ccom.c,v 2.0 1993/07/28 11:54:04 dawes Exp $ */
  /* $XConsortium: cp_ccom.c,v 5.19 92/08/10 20:46:50 eswu Exp $ */
  
  /***********************************************************
***************
*** 56,61 ****
--- 57,65 ----
  #ifdef SYSV386
  #ifdef ISC
  typedef short pid_t;
+ # ifdef ISC30
+ #  define POSIX_JC
+ # endif
  #endif
  # include <sys/wait.h>
  #endif
***************
*** 123,129 ****
  
      CLEARBITS(wfd);
      BITSET(wfd, s);
!     if (select(s+1, NULL, wfd, NULL, (struct timeval *)NULL) < 0 &&
  	errno != EINTR){
  	perror("phg_cpxc_send(select)");
  	return 0;
--- 127,133 ----
  
      CLEARBITS(wfd);
      BITSET(wfd, s);
!     if (select(s+1, NULL, (fd_set *)wfd, NULL, (struct timeval *)NULL) < 0 &&
  	errno != EINTR){
  	perror("phg_cpxc_send(select)");
  	return 0;
***************
*** 1238,1244 ****
      CLEARBITS(rmask);
      do {
  	BITSET(rmask, fd);
! 	status = select( fd+1, rmask, NULL, NULL, &waittime );
  	if( status == 1 )
  	    return ( (read( fd, &c, sizeof(c)) == sizeof(c)) && (c == 'p') );
  	else if ( status < 0 && errno == EINTR )
--- 1242,1248 ----
      CLEARBITS(rmask);
      do {
  	BITSET(rmask, fd);
! 	status = select( fd+1, (fd_set *)rmask, NULL, NULL, &waittime );
  	if( status == 1 )
  	    return ( (read( fd, &c, sizeof(c)) == sizeof(c)) && (c == 'p') );
  	else if ( status < 0 && errno == EINTR )
***************
*** 1272,1278 ****
      CLEARBITS(rmask);
      BITSET(rmask, fd);
      waittime.tv_sec = 30; waittime.tv_usec = 0;
!     if ( (select( fd+1, rmask, NULL, NULL, &waittime) == 1)
  	&& (read( fd, (char *)&shmid, sizeof(shmid)) == sizeof(shmid)) ) {
  	cph->shm_buf = (Cp_shm_buf *)shmat(shmid,(char *)NULL,0);
  	if ( cph->shm_buf != (Cp_shm_buf *)-1 )
--- 1276,1282 ----
      CLEARBITS(rmask);
      BITSET(rmask, fd);
      waittime.tv_sec = 30; waittime.tv_usec = 0;
!     if ( (select( fd+1, (fd_set *)rmask, NULL, NULL, &waittime) == 1)
  	&& (read( fd, (char *)&shmid, sizeof(shmid)) == sizeof(shmid)) ) {
  	cph->shm_buf = (Cp_shm_buf *)shmat(shmid,(char *)NULL,0);
  	if ( cph->shm_buf != (Cp_shm_buf *)-1 )
***************
*** 1518,1524 ****
          (void)ioctl (cph->erh->data.client.sfd, FIONBIO, &fdflags);
  #else /* AIXV3 */
  	/* ultrix reads hang on Unix sockets, hpux reads fail */
! #if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux))
  	(void)fcntl(cph->erh->data.client.sfd, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
--- 1522,1528 ----
          (void)ioctl (cph->erh->data.client.sfd, FIONBIO, &fdflags);
  #else /* AIXV3 */
  	/* ultrix reads hang on Unix sockets, hpux reads fail */
! #if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(SCO))
  	(void)fcntl(cph->erh->data.client.sfd, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
diff -c mit/extensions/lib/PEX/cp/cp_rcom.c:1.1.1.1 mit/extensions/lib/PEX/cp/cp_rcom.c:1.2
*** mit/extensions/lib/PEX/cp/cp_rcom.c:1.1.1.1	Sat Mar 12 00:41:34 1994
--- mit/extensions/lib/PEX/cp/cp_rcom.c	Sat Mar 12 00:41:34 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/extensions/lib/PEX/cp/cp_rcom.c,v 1.2 1993/05/18 15:35:40 dawes Exp $ */
  /* $XConsortium: cp_rcom.c,v 5.7 91/07/26 20:12:28 rws Exp $ */
  
  /***********************************************************
***************
*** 148,154 ****
  
      CLEARBITS(wfd);
      BITSET(wfd, s);
!     if (select(s+1, NULL, wfd, NULL, (struct timeval *)NULL) < 0 &&
  	errno != EINTR){
  	perror("phg_cpr_send(select)");
  	return 0;
--- 149,155 ----
  
      CLEARBITS(wfd);
      BITSET(wfd, s);
!     if (select(s+1, NULL, (fd_set *)wfd, NULL, (struct timeval *)NULL) < 0 &&
  	errno != EINTR){
  	perror("phg_cpr_send(select)");
  	return 0;
diff -c mit/extensions/lib/PEX/cp/phigsmon.c:1.1.1.2 mit/extensions/lib/PEX/cp/phigsmon.c:2.0
*** mit/extensions/lib/PEX/cp/phigsmon.c:1.1.1.2	Sat Mar 12 00:41:35 1994
--- mit/extensions/lib/PEX/cp/phigsmon.c	Sat Mar 12 00:41:35 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/extensions/lib/PEX/cp/phigsmon.c,v 2.0 1993/07/28 11:54:07 dawes Exp $ */
  /* $XConsortium: phigsmon.c,v 5.9 92/08/10 20:46:54 eswu Exp $ */
  
  /***********************************************************
***************
*** 217,223 ****
              }
  #else /* AIXV3 */
  	    /* ultrix reads hang on Unix sockets, hpux reads fail */
! #if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux))
  	    (void)fcntl(s, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
--- 218,224 ----
              }
  #else /* AIXV3 */
  	    /* ultrix reads hang on Unix sockets, hpux reads fail */
! #if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(SCO))
  	    (void)fcntl(s, F_SETFL, O_NONBLOCK);
  #else
  #ifdef FIOSNBIO
***************
*** 519,527 ****
  	    /* Need to wake up frequently to check the shared memory queue
  	     * for commands from the parent.
  	     */
! 	    select( cph->max_fd+1, rmask, NULL, NULL, &cmd_check_interval );
  #else
! 	    select( cph->max_fd+1, rmask, NULL, NULL, NULL );
  #endif
  	}
      }
--- 520,529 ----
  	    /* Need to wake up frequently to check the shared memory queue
  	     * for commands from the parent.
  	     */
! 	    select( cph->max_fd+1, (fd_set *)rmask, NULL, NULL,
! 		    &cmd_check_interval );
  #else
! 	    select( cph->max_fd+1, (fd_set *)rmask, NULL, NULL, NULL );
  #endif
  	}
      }
diff -c mit/extensions/lib/PEX/util/ut_ntfy.c:1.1.1.2 mit/extensions/lib/PEX/util/ut_ntfy.c:1.2
*** mit/extensions/lib/PEX/util/ut_ntfy.c:1.1.1.2	Sat Mar 12 00:41:45 1994
--- mit/extensions/lib/PEX/util/ut_ntfy.c	Sat Mar 12 00:41:45 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/extensions/lib/PEX/util/ut_ntfy.c,v 1.2 1993/04/07 11:12:26 dawes Exp $ */
  /* $XConsortium: ut_ntfy.c,v 5.7 91/12/03 17:02:47 hersh Exp $ */
  
  /***********************************************************
***************
*** 110,116 ****
  	}
  	trav = trav->next;
      }
! #if defined(SYSV) || defined(SVR4)
      /* Have to reinstall the signal handler. */
      (void)signal(signal_num, timer_dispatcher);
  #endif
--- 111,117 ----
  	}
  	trav = trav->next;
      }
! #if defined(SYSV) || defined(SVR4) || defined(linux)
      /* Have to reinstall the signal handler. */
      (void)signal(signal_num, timer_dispatcher);
  #endif
***************
*** 269,275 ****
  	(*curr->sig_handler)(curr->client_id, signal_num, 0);
  	curr = tmp;
      }
! #if defined(SYSV) || defined(SVR4)
      /* Have to reinstall the signal handler. */
      (void)signal(signal_num, sig_dispatcher);
  #endif
--- 270,276 ----
  	(*curr->sig_handler)(curr->client_id, signal_num, 0);
  	curr = tmp;
      }
! #if defined(SYSV) || defined(SVR4) || defined(linux)
      /* Have to reinstall the signal handler. */
      (void)signal(signal_num, sig_dispatcher);
  #endif
diff -c mit/extensions/lib/PEX/util/ut_path.c:1.1.1.1 mit/extensions/lib/PEX/util/ut_path.c:2.0
*** mit/extensions/lib/PEX/util/ut_path.c:1.1.1.1	Sat Mar 12 00:41:45 1994
--- mit/extensions/lib/PEX/util/ut_path.c	Sat Mar 12 00:41:45 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/extensions/lib/PEX/util/ut_path.c,v 2.0 1993/07/28 11:54:16 dawes Exp $ */
  /* $XConsortium: ut_path.c,v 5.6 91/07/10 09:21:07 rws Exp $ */
  
  /***********************************************************
***************
*** 70,80 ****
  
      register char	*str;
      int			err;
  
      if ( !*dir) {	/* get the path */
  	if ( !(str = getenv("PEXAPIDIR")))
! 	    str = PEXAPIDIR;
! 	strncpy( dir, str, PHG_MAXPATH - 1);
  
  	if ( *dir)
  	    strcat( dir, "/");
--- 71,86 ----
  
      register char	*str;
      int			err;
+     char 		*xwinhome = NULL;
  
      if ( !*dir) {	/* get the path */
  	if ( !(str = getenv("PEXAPIDIR")))
! 	    if ( !(xwinhome = getenv("XWINHOME")))
! 		str = PEXAPIDIR;
! 	if (xwinhome)
! 	    sprintf( dir, "%s/lib/X11/PEX", xwinhome);
! 	else
! 	    strncpy( dir, str, PHG_MAXPATH - 1);
  
  	if ( *dir)
  	    strcat( dir, "/");
***************
*** 102,108 ****
--- 108,116 ----
  		case ENOTDIR:		err = ERRN53; break;
  		case EACCES:		err = ERRN53; break;
  		case ENAMETOOLONG:	err = ERRN52; break;
+ #ifdef ELOOP
  		case ELOOP:		err = ERRN53; break;
+ #endif
  		default:
  		    err = ERRN54;
  		    break;
diff -c /dev/null mit/extensions/lib/PEXlib/jump_funcs:1.1
*** /dev/null	Sat Mar 12 00:41:50 1994
--- mit/extensions/lib/PEXlib/jump_funcs	Sat Mar 12 00:41:51 1994
***************
*** 0 ****
--- 1,402 ----
+ # $XFree86: mit/extensions/lib/PEXlib/jump_funcs,v 1.1 1993/04/16 14:18:07 dawes Exp $
+ #
+ 00000000 T _PEXEscape           libPEX5        pl_escape
+ 00000000 T _PEXEscapeWithReply  libPEX5        pl_escape
+ 00000000 T _PEXSetEchoColor     libPEX5        pl_escape
+ 00000000 T _PEXLoadFont         libPEX5        pl_font
+ 00000000 T _PEXUnloadFont       libPEX5        pl_font
+ 00000000 T _PEXQueryFont        libPEX5        pl_font
+ 00000000 T _PEXListFonts        libPEX5        pl_font
+ 00000000 T _PEXListFontsWithInfo libPEX5        pl_font
+ 00000000 T _PEXQueryTextExtents libPEX5        pl_font
+ 00000000 T _PEXQueryEncodedTextExtents libPEX5        pl_font
+ 00000000 T _PEXFreeEnumInfo     libPEX5        pl_free
+ 00000000 T _PEXFreeFontInfo     libPEX5        pl_free
+ 00000000 T _PEXFreeFontNames    libPEX5        pl_free
+ 00000000 T _PEXFreePCAttributes libPEX5        pl_free
+ 00000000 T _PEXFreePDAttributes libPEX5        pl_free
+ 00000000 T _PEXFreePMAttributes libPEX5        pl_free
+ 00000000 T _PEXFreePickPaths    libPEX5        pl_free
+ 00000000 T _PEXFreeRendererAttributes libPEX5        pl_free
+ 00000000 T _PEXFreeSCAttributes libPEX5        pl_free
+ 00000000 T _PEXFreeStructurePaths libPEX5        pl_free
+ 00000000 T _PEXFreeTableEntries libPEX5        pl_free
+ 00000000 T _PEXFreeWorkstationAttributes libPEX5        pl_free
+ 00000000 T _PEXFreeOCData       libPEX5        pl_free
+ 00000000 T _PEXCreateLookupTable libPEX5        pl_lut
+ 00000000 T _PEXFreeLookupTable  libPEX5        pl_lut
+ 00000000 T _PEXCopyLookupTable  libPEX5        pl_lut
+ 00000000 T _PEXGetTableInfo     libPEX5        pl_lut
+ 00000000 T _PEXGetPredefinedEntries libPEX5        pl_lut
+ 00000000 T _PEXGetDefinedIndices libPEX5        pl_lut
+ 00000000 T _PEXGetTableEntry    libPEX5        pl_lut
+ 00000000 T _PEXGetTableEntries  libPEX5        pl_lut
+ 00000000 T _PEXSetTableEntries  libPEX5        pl_lut
+ 00000000 T _PEXDeleteTableEntries libPEX5        pl_lut
+ 00000000 T _PEXCreateNameSet    libPEX5        pl_nameset
+ 00000000 T _PEXFreeNameSet      libPEX5        pl_nameset
+ 00000000 T _PEXCopyNameSet      libPEX5        pl_nameset
+ 00000000 T _PEXGetNameSet       libPEX5        pl_nameset
+ 00000000 T _PEXChangeNameSet    libPEX5        pl_nameset
+ 00000000 T _PEXSetMarkerType    libPEX5        pl_oc_attr
+ 00000000 T _PEXSetMarkerScale   libPEX5        pl_oc_attr
+ 00000000 T _PEXSetMarkerColorIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetMarkerColor   libPEX5        pl_oc_attr
+ 00000000 T _PEXSetMarkerBundleIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetTextFontIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetTextPrecision libPEX5        pl_oc_attr
+ 00000000 T _PEXSetCharExpansion libPEX5        pl_oc_attr
+ 00000000 T _PEXSetCharSpacing   libPEX5        pl_oc_attr
+ 00000000 T _PEXSetTextColorIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetTextColor     libPEX5        pl_oc_attr
+ 00000000 T _PEXSetCharHeight    libPEX5        pl_oc_attr
+ 00000000 T _PEXSetCharUpVector  libPEX5        pl_oc_attr
+ 00000000 T _PEXSetTextPath      libPEX5        pl_oc_attr
+ 00000000 T _PEXSetTextAlignment libPEX5        pl_oc_attr
+ 00000000 T _PEXSetATextHeight   libPEX5        pl_oc_attr
+ 00000000 T _PEXSetATextUpVector libPEX5        pl_oc_attr
+ 00000000 T _PEXSetATextPath     libPEX5        pl_oc_attr
+ 00000000 T _PEXSetATextAlignment libPEX5        pl_oc_attr
+ 00000000 T _PEXSetATextStyle    libPEX5        pl_oc_attr
+ 00000000 T _PEXSetTextBundleIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetLineType      libPEX5        pl_oc_attr
+ 00000000 T _PEXSetLineWidth     libPEX5        pl_oc_attr
+ 00000000 T _PEXSetLineColorIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetLineColor     libPEX5        pl_oc_attr
+ 00000000 T _PEXSetCurveApprox   libPEX5        pl_oc_attr
+ 00000000 T _PEXSetPolylineInterpMethod libPEX5        pl_oc_attr
+ 00000000 T _PEXSetLineBundleIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetInteriorStyle libPEX5        pl_oc_attr
+ 00000000 T _PEXSetInteriorStyleIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetSurfaceColorIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetSurfaceColor  libPEX5        pl_oc_attr
+ 00000000 T _PEXSetReflectionAttributes libPEX5        pl_oc_attr
+ 00000000 T _PEXSetReflectionModel libPEX5        pl_oc_attr
+ 00000000 T _PEXSetSurfaceInterpMethod libPEX5        pl_oc_attr
+ 00000000 T _PEXSetBFInteriorStyle libPEX5        pl_oc_attr
+ 00000000 T _PEXSetBFInteriorStyleIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetBFSurfaceColorIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetBFSurfaceColor libPEX5        pl_oc_attr
+ 00000000 T _PEXSetBFReflectionAttributes libPEX5        pl_oc_attr
+ 00000000 T _PEXSetBFReflectionModel libPEX5        pl_oc_attr
+ 00000000 T _PEXSetBFSurfaceInterpMethod libPEX5        pl_oc_attr
+ 00000000 T _PEXSetSurfaceApprox libPEX5        pl_oc_attr
+ 00000000 T _PEXSetFacetCullingMode libPEX5        pl_oc_attr
+ 00000000 T _PEXSetFacetDistinguishFlag libPEX5        pl_oc_attr
+ 00000000 T _PEXSetPatternSize   libPEX5        pl_oc_attr
+ 00000000 T _PEXSetPatternAttributes2D libPEX5        pl_oc_attr
+ 00000000 T _PEXSetPatternAttributes libPEX5        pl_oc_attr
+ 00000000 T _PEXSetInteriorBundleIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetSurfaceEdgeFlag libPEX5        pl_oc_attr
+ 00000000 T _PEXSetSurfaceEdgeType libPEX5        pl_oc_attr
+ 00000000 T _PEXSetSurfaceEdgeWidth libPEX5        pl_oc_attr
+ 00000000 T _PEXSetSurfaceEdgeColorIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetSurfaceEdgeColor libPEX5        pl_oc_attr
+ 00000000 T _PEXSetEdgeBundleIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetIndividualASF libPEX5        pl_oc_attr
+ 00000000 T _PEXSetLocalTransform libPEX5        pl_oc_attr
+ 00000000 T _PEXSetLocalTransform2D libPEX5        pl_oc_attr
+ 00000000 T _PEXSetGlobalTransform libPEX5        pl_oc_attr
+ 00000000 T _PEXSetGlobalTransform2D libPEX5        pl_oc_attr
+ 00000000 T _PEXSetModelClipFlag libPEX5        pl_oc_attr
+ 00000000 T _PEXSetModelClipVolume libPEX5        pl_oc_attr
+ 00000000 T _PEXSetModelClipVolume2D libPEX5        pl_oc_attr
+ 00000000 T _PEXRestoreModelClipVolume libPEX5        pl_oc_attr
+ 00000000 T _PEXSetViewIndex     libPEX5        pl_oc_attr
+ 00000000 T _PEXSetLightSourceState libPEX5        pl_oc_attr
+ 00000000 T _PEXSetDepthCueIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetPickID        libPEX5        pl_oc_attr
+ 00000000 T _PEXSetHLHSRID       libPEX5        pl_oc_attr
+ 00000000 T _PEXSetColorApproxIndex libPEX5        pl_oc_attr
+ 00000000 T _PEXSetParaSurfCharacteristics libPEX5        pl_oc_attr
+ 00000000 T _PEXSetRenderingColorModel libPEX5        pl_oc_attr
+ 00000000 T _PEXAddToNameSet     libPEX5        pl_oc_attr
+ 00000000 T _PEXRemoveFromNameSet libPEX5        pl_oc_attr
+ 00000000 T _PEXDecodeOCs        libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeEnumType  libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeTableIndex libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeColor     libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeFloat     libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeCARD16    libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeVector2D  libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeTextAlignment libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeCurveApprox libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeReflectionAttr libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeSurfaceApprox libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeCullMode  libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeSwitch    libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodePatternSize libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodePatternAttr2D libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodePatternAttr libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeASF       libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeLocalTransform libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeLocalTransform2D libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeGlobalTransform libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeGlobalTransform2D libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeModelClipVolume libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeModelClipVolume2D libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeRestoreModelClip libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeLightSourceState libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeID        libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodePSC       libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeNameSet   libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeExecuteStructure libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeLabel     libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeApplicationData libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeGSE       libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeMarkers   libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeMarkers2D libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodePolyline  libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodePolyline2D libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeText      libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeText2D    libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeAnnoText  libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeAnnoText2D libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodePolylineSet libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeNURBCurve libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeFillArea  libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeFillArea2D libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeFillAreaWithData libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeFillAreaSet libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeFillAreaSet2D libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeFillAreaSetWithData libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeTriangleStrip libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeQuadMesh  libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeSOFA      libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeNURBSurface libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeCellArray libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeCellArray2D libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeExtendedCellArray libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeGDP       libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeGDP2D     libPEX5        pl_oc_dec
+ 00000000 T __PEXDecodeNoop      libPEX5        pl_oc_dec
+ 00000000 T _PEXEncodeOCs        libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeEnumType  libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeTableIndex libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeColor     libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeFloat     libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeCARD16    libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeVector2D  libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeTextAlignment libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeCurveApprox libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeReflectionAttr libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeSurfaceApprox libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeCullMode  libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeSwitch    libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodePatternSize libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodePatternAttr2D libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodePatternAttr libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeASF       libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeLocalTransform libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeLocalTransform2D libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeGlobalTransform libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeGlobalTransform2D libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeModelClipVolume libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeModelClipVolume2D libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeRestoreModelClip libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeLightSourceState libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeID        libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodePSC       libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeNameSet   libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeExecuteStructure libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeLabel     libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeApplicationData libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeGSE       libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeMarkers   libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodePolyline  libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeMarkers2D libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodePolyline2D libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeText      libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeText2D    libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeAnnoText  libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeAnnoText2D libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodePolylineSet libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeNURBCurve libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeFillArea  libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeFillArea2D libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeFillAreaWithData libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeFillAreaSet libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeFillAreaSet2D libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeFillAreaSetWithData libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeTriangleStrip libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeQuadMesh  libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeSOFA      libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeNURBSurface libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeCellArray libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeCellArray2D libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeExtendedCellArray libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeGDP       libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeGDP2D     libPEX5        pl_oc_enc
+ 00000000 T __PEXEncodeNoop      libPEX5        pl_oc_enc
+ 00000000 T _PEXMarkers          libPEX5        pl_oc_prim
+ 00000000 T _PEXMarkers2D        libPEX5        pl_oc_prim
+ 00000000 T _PEXText             libPEX5        pl_oc_prim
+ 00000000 T _PEXText2D           libPEX5        pl_oc_prim
+ 00000000 T _PEXAnnotationText   libPEX5        pl_oc_prim
+ 00000000 T _PEXAnnotationText2D libPEX5        pl_oc_prim
+ 00000000 T _PEXEncodedText      libPEX5        pl_oc_prim
+ 00000000 T _PEXEncodedText2D    libPEX5        pl_oc_prim
+ 00000000 T _PEXEncodedAnnoText  libPEX5        pl_oc_prim
+ 00000000 T _PEXEncodedAnnoText2D libPEX5        pl_oc_prim
+ 00000000 T _PEXPolyline         libPEX5        pl_oc_prim
+ 00000000 T _PEXPolyline2D       libPEX5        pl_oc_prim
+ 00000000 T _PEXPolylineSetWithData libPEX5        pl_oc_prim
+ 00000000 T _PEXNURBCurve        libPEX5        pl_oc_prim
+ 00000000 T _PEXFillArea         libPEX5        pl_oc_prim
+ 00000000 T _PEXFillArea2D       libPEX5        pl_oc_prim
+ 00000000 T _PEXFillAreaWithData libPEX5        pl_oc_prim
+ 00000000 T _PEXFillAreaSet      libPEX5        pl_oc_prim
+ 00000000 T _PEXFillAreaSet2D    libPEX5        pl_oc_prim
+ 00000000 T _PEXFillAreaSetWithData libPEX5        pl_oc_prim
+ 00000000 T _PEXSetOfFillAreaSets libPEX5        pl_oc_prim
+ 00000000 T _PEXTriangleStrip    libPEX5        pl_oc_prim
+ 00000000 T _PEXQuadrilateralMesh libPEX5        pl_oc_prim
+ 00000000 T _PEXNURBSurface      libPEX5        pl_oc_prim
+ 00000000 T _PEXCellArray        libPEX5        pl_oc_prim
+ 00000000 T _PEXCellArray2D      libPEX5        pl_oc_prim
+ 00000000 T _PEXExtendedCellArray libPEX5        pl_oc_prim
+ 00000000 T _PEXGDP              libPEX5        pl_oc_prim
+ 00000000 T _PEXGDP2D            libPEX5        pl_oc_prim
+ 00000000 T _PEXExecuteStructure libPEX5        pl_oc_struct
+ 00000000 T _PEXLabel            libPEX5        pl_oc_struct
+ 00000000 T _PEXNoop             libPEX5        pl_oc_struct
+ 00000000 T _PEXApplicationData  libPEX5        pl_oc_struct
+ 00000000 T _PEXGSE              libPEX5        pl_oc_struct
+ 00000000 T _PEXStartOCs         libPEX5        pl_oc_util
+ 00000000 T _PEXFinishOCs        libPEX5        pl_oc_util
+ 00000000 T __PEXSendBytesToOC   libPEX5        pl_oc_util
+ 00000000 T _PEXCopyBytesToOC    libPEX5        pl_oc_util
+ 00000000 T __PEXCopyPaddedBytesToOC libPEX5        pl_oc_util
+ 00000000 T _PEXGetOCAddr        libPEX5        pl_oc_util
+ 00000000 T _PEXSendOCs          libPEX5        pl_oc_util
+ 00000000 T __PEXGenOCBadLengthError libPEX5        pl_oc_util
+ 00000000 T _PEXGetSizeOCs       libPEX5        pl_oc_util
+ 00000000 T _PEXCountOCs         libPEX5        pl_oc_util
+ 00000000 T _PEXCreatePipelineContext libPEX5        pl_pc
+ 00000000 T _PEXFreePipelineContext libPEX5        pl_pc
+ 00000000 T _PEXCopyPipelineContext libPEX5        pl_pc
+ 00000000 T _PEXGetPipelineContext libPEX5        pl_pc
+ 00000000 T _PEXChangePipelineContext libPEX5        pl_pc
+ 00000000 T _PEXCreatePickMeasure libPEX5        pl_pick
+ 00000000 T _PEXFreePickMeasure  libPEX5        pl_pick
+ 00000000 T _PEXGetPickMeasure   libPEX5        pl_pick
+ 00000000 T _PEXUpdatePickMeasure libPEX5        pl_pick
+ 00000000 T _PEXGetPickDevice    libPEX5        pl_pick
+ 00000000 T _PEXChangePickDevice libPEX5        pl_pick
+ 00000000 T __PEXConvertMaxHitsEvent libPEX5        pl_pick
+ 00000000 T _PEXBeginPickOne     libPEX5        pl_pick
+ 00000000 T _PEXEndPickOne       libPEX5        pl_pick
+ 00000000 T _PEXPickOne          libPEX5        pl_pick
+ 00000000 T _PEXBeginPickAll     libPEX5        pl_pick
+ 00000000 T _PEXEndPickAll       libPEX5        pl_pick
+ 00000000 T _PEXPickAll          libPEX5        pl_pick
+ 00000000 T _PEXCreateRenderer   libPEX5        pl_rdr
+ 00000000 T _PEXFreeRenderer     libPEX5        pl_rdr
+ 00000000 T _PEXGetRendererAttributes libPEX5        pl_rdr
+ 00000000 T _PEXGetRendererDynamics libPEX5        pl_rdr
+ 00000000 T _PEXChangeRenderer   libPEX5        pl_rdr
+ 00000000 T _PEXBeginRendering   libPEX5        pl_rdr
+ 00000000 T _PEXEndRendering     libPEX5        pl_rdr
+ 00000000 T _PEXBeginStructure   libPEX5        pl_rdr
+ 00000000 T _PEXEndStructure     libPEX5        pl_rdr
+ 00000000 T _PEXRenderNetwork    libPEX5        pl_rdr
+ 00000000 T _PEXRenderElements   libPEX5        pl_rdr
+ 00000000 T _PEXAccumulateState  libPEX5        pl_rdr
+ 00000000 T _PEXCreateSearchContext libPEX5        pl_sc
+ 00000000 T _PEXFreeSearchContext libPEX5        pl_sc
+ 00000000 T _PEXCopySearchContext libPEX5        pl_sc
+ 00000000 T _PEXGetSearchContext libPEX5        pl_sc
+ 00000000 T _PEXChangeSearchContext libPEX5        pl_sc
+ 00000000 T _PEXSearchNetwork    libPEX5        pl_sc
+ 00000000 T _PEXInitialize       libPEX5        pl_startup
+ 00000000 T _PEXGetExtensionInfo libPEX5        pl_startup
+ 00000000 T _PEXGetProtocolFloatFormat libPEX5        pl_startup
+ 00000000 T _PEXGetEnumTypeInfo  libPEX5        pl_startup
+ 00000000 T _PEXGetImpDepConstants libPEX5        pl_startup
+ 00000000 T _PEXMatchRenderingTargets libPEX5        pl_startup
+ 00000000 T __PEXConvertOCError  libPEX5        pl_startup
+ 00000000 T __PEXPrintOCError    libPEX5        pl_startup
+ 00000000 T __PEXCloseDisplay    libPEX5        pl_startup
+ 00000000 T _PEXCreateStructure  libPEX5        pl_struct
+ 00000000 T _PEXDestroyStructures libPEX5        pl_struct
+ 00000000 T _PEXCopyStructure    libPEX5        pl_struct
+ 00000000 T _PEXGetStructureInfo libPEX5        pl_struct
+ 00000000 T _PEXGetElementInfo   libPEX5        pl_struct
+ 00000000 T _PEXGetStructuresInNetwork libPEX5        pl_struct
+ 00000000 T _PEXGetAncestors     libPEX5        pl_struct
+ 00000000 T _PEXGetDescendants   libPEX5        pl_struct
+ 00000000 T _PEXFetchElements    libPEX5        pl_struct
+ 00000000 T _PEXFetchElementsAndSend libPEX5        pl_struct
+ 00000000 T _PEXSetEditingMode   libPEX5        pl_struct
+ 00000000 T _PEXSetElementPtr    libPEX5        pl_struct
+ 00000000 T _PEXSetElementPtrAtLabel libPEX5        pl_struct
+ 00000000 T _PEXElementSearch    libPEX5        pl_struct
+ 00000000 T _PEXDeleteElements   libPEX5        pl_struct
+ 00000000 T _PEXDeleteToLabel    libPEX5        pl_struct
+ 00000000 T _PEXDeleteBetweenLabels libPEX5        pl_struct
+ 00000000 T _PEXCopyElements     libPEX5        pl_struct
+ 00000000 T _PEXChangeStructureRefs libPEX5        pl_struct
+ 00000000 T _PEXRotate           libPEX5        pl_util
+ 00000000 T _PEXRotate2D         libPEX5        pl_util
+ 00000000 T _PEXRotateGeneral    libPEX5        pl_util
+ 00000000 T _PEXScale            libPEX5        pl_util
+ 00000000 T _PEXScale2D          libPEX5        pl_util
+ 00000000 T _PEXTranslate        libPEX5        pl_util
+ 00000000 T _PEXTranslate2D      libPEX5        pl_util
+ 00000000 T _PEXMatrixMult       libPEX5        pl_util
+ 00000000 T _PEXMatrixMult2D     libPEX5        pl_util
+ 00000000 T _PEXBuildTransform   libPEX5        pl_util
+ 00000000 T _PEXBuildTransform2D libPEX5        pl_util
+ 00000000 T _PEXViewOrientationMatrix libPEX5        pl_util
+ 00000000 T _PEXViewOrientationMatrix2D libPEX5        pl_util
+ 00000000 T _PEXViewMappingMatrix libPEX5        pl_util
+ 00000000 T _PEXViewMappingMatrix2D libPEX5        pl_util
+ 00000000 T _PEXLookAtViewMatrix libPEX5        pl_util
+ 00000000 T _PEXPolarViewMatrix  libPEX5        pl_util
+ 00000000 T _PEXOrthoProjMatrix  libPEX5        pl_util
+ 00000000 T _PEXPerspProjMatrix  libPEX5        pl_util
+ 00000000 T _PEXTransformPoints  libPEX5        pl_util
+ 00000000 T _PEXTransformPoints2D libPEX5        pl_util
+ 00000000 T _PEXTransformPoints4D libPEX5        pl_util
+ 00000000 T _PEXTransformPoints2DH libPEX5        pl_util
+ 00000000 T _PEXTransformVectors libPEX5        pl_util
+ 00000000 T _PEXTransformVectors2D libPEX5        pl_util
+ 00000000 T _PEXNormalizeVectors libPEX5        pl_util
+ 00000000 T _PEXNormalizeVectors2D libPEX5        pl_util
+ 00000000 T _PEXNPCToXCTransform libPEX5        pl_util
+ 00000000 T _PEXNPCToXCTransform2D libPEX5        pl_util
+ 00000000 T _PEXXCToNPCTransform libPEX5        pl_util
+ 00000000 T _PEXXCToNPCTransform2D libPEX5        pl_util
+ 00000000 T _PEXMapXCToNPC       libPEX5        pl_util
+ 00000000 T _PEXMapXCToNPC2D     libPEX5        pl_util
+ 00000000 T _PEXInvertMatrix     libPEX5        pl_util
+ 00000000 T _PEXInvertMatrix2D   libPEX5        pl_util
+ 00000000 T _PEXIdentityMatrix   libPEX5        pl_util
+ 00000000 T _PEXIdentityMatrix2D libPEX5        pl_util
+ 00000000 T _PEXGeoNormFillArea  libPEX5        pl_util
+ 00000000 T _PEXGeoNormFillAreaSet libPEX5        pl_util
+ 00000000 T _PEXGeoNormTriangleStrip libPEX5        pl_util
+ 00000000 T _PEXGeoNormQuadrilateralMesh libPEX5        pl_util
+ 00000000 T _PEXGeoNormSetOfFillAreaSets libPEX5        pl_util
+ 00000000 T _PEXCreateWorkstation libPEX5        pl_wks
+ 00000000 T _PEXFreeWorkstation  libPEX5        pl_wks
+ 00000000 T _PEXGetWorkstationAttributes libPEX5        pl_wks
+ 00000000 T _PEXGetWorkstationDynamics libPEX5        pl_wks
+ 00000000 T _PEXGetWorkstationViewRep libPEX5        pl_wks
+ 00000000 T _PEXGetWorkstationPostings libPEX5        pl_wks
+ 00000000 T _PEXSetWorkstationViewPriority libPEX5        pl_wks
+ 00000000 T _PEXSetWorkstationDisplayUpdateMode libPEX5        pl_wks
+ 00000000 T _PEXSetWorkstationBufferMode libPEX5        pl_wks
+ 00000000 T _PEXSetWorkstationViewRep libPEX5        pl_wks
+ 00000000 T _PEXSetWorkstationWindow libPEX5        pl_wks
+ 00000000 T _PEXSetWorkstationViewport libPEX5        pl_wks
+ 00000000 T _PEXSetWorkstationHLHSRMode libPEX5        pl_wks
+ 00000000 T _PEXRedrawAllStructures libPEX5        pl_wks
+ 00000000 T _PEXUpdateWorkstation libPEX5        pl_wks
+ 00000000 T _PEXExecuteDeferredActions libPEX5        pl_wks
+ 00000000 T _PEXMapDCToWC        libPEX5        pl_wks
+ 00000000 T _PEXMapWCToDC        libPEX5        pl_wks
+ 00000000 T _PEXPostStructure    libPEX5        pl_wks
+ 00000000 T _PEXUnpostStructure  libPEX5        pl_wks
+ 00000000 T _PEXUnpostAllStructures libPEX5        pl_wks
+ 00000000 T _PEXRedrawClipRegion libPEX5        pl_wks
diff -c /dev/null mit/extensions/lib/PEXlib/jump_ignore:1.1
*** /dev/null	Sat Mar 12 00:41:53 1994
--- mit/extensions/lib/PEXlib/jump_ignore	Sat Mar 12 00:41:54 1994
***************
*** 0 ****
--- 1 ----
+ # $XFree86: mit/extensions/lib/PEXlib/jump_ignore,v 1.1 1993/04/17 02:36:07 dawes Exp $
diff -c /dev/null mit/extensions/lib/PEXlib/jump_vars:1.1
*** /dev/null	Sat Mar 12 00:41:54 1994
--- mit/extensions/lib/PEXlib/jump_vars	Sat Mar 12 00:41:54 1994
***************
*** 0 ****
--- 1,8 ----
+ # $XFree86: mit/extensions/lib/PEXlib/jump_vars,v 1.1 1993/04/16 14:18:11 dawes Exp $
+ #
+ 00000004 D _PEXDisplayInfoHeader libPEX5        pl_startup
+ 00000004 D _PEXPickCache        libPEX5        pl_startup
+ 00000004 D _PEXPickCacheSize    libPEX5        pl_startup
+ 00000004 D _PEXPickCacheInUse   libPEX5        pl_startup
+ 00000260 D _PEX_encode_oc_funcs libPEX5        pl_startup
+ 00000260 D _PEX_decode_oc_funcs libPEX5        pl_startup
diff -c /dev/null mit/extensions/lib/PEXlib/pl_glbl_def.h:2.0
*** /dev/null	Sat Mar 12 00:41:55 1994
--- mit/extensions/lib/PEXlib/pl_glbl_def.h	Sat Mar 12 00:41:55 1994
***************
*** 0 ****
--- 1,376 ----
+ /* $XFree86: mit/extensions/lib/PEXlib/pl_glbl_def.h,v 2.0 1993/06/13 07:04:44 dawes Exp $ */
+ /* $XConsortium: pl_global_def.h,v 1.6 92/08/26 13:05:23 mor Exp $ */
+ 
+ /******************************************************************************
+ Copyright 1992 by the Massachusetts Institute of Technology
+ 
+                         All Rights Reserved
+ 
+ Permission to use, copy, modify, distribute, and sell this software and its
+ documentation for any purpose is hereby granted without fee, provided that
+ the above copyright notice appear in all copies and that both that
+ copyright notice and this permission notice appear in supporting
+ documentation, and that the name of M.I.T. not be used in advertising or
+ publicity pertaining to distribution of the software without specific,
+ written prior permission.  M.I.T. makes no representations about the
+ suitability of this software for any purpose.  It is provided "as is"
+ without express or implied warranty.
+ ******************************************************************************/
+ 
+ /*
+  * Header to linked list of open displays.
+  */
+ 
+ PEXDisplayInfo 	*PEXDisplayInfoHeader = NULL;
+ 
+ 
+ /*
+  * Pick path cache.
+  */
+ 
+ PEXPickPath	*PEXPickCache = NULL;
+ unsigned int	PEXPickCacheSize = 0;
+ int		PEXPickCacheInUse = 0;
+ 
+ 
+ /*
+  * Encode OC function table.
+  */
+ 
+ extern void _PEXEncodeEnumType();
+ extern void _PEXEncodeTableIndex();
+ extern void _PEXEncodeColor();
+ extern void _PEXEncodeFloat();
+ extern void _PEXEncodeCARD16();
+ extern void _PEXEncodeVector2D();
+ extern void _PEXEncodeTextAlignment();
+ extern void _PEXEncodeCurveApprox();
+ extern void _PEXEncodeReflectionAttr();
+ extern void _PEXEncodeSurfaceApprox();
+ extern void _PEXEncodeCullMode();
+ extern void _PEXEncodeSwitch();
+ extern void _PEXEncodePatternSize();
+ extern void _PEXEncodePatternAttr2D();
+ extern void _PEXEncodePatternAttr();
+ extern void _PEXEncodeASF();
+ extern void _PEXEncodeLocalTransform();
+ extern void _PEXEncodeLocalTransform2D();
+ extern void _PEXEncodeGlobalTransform();
+ extern void _PEXEncodeGlobalTransform2D();
+ extern void _PEXEncodeModelClipVolume();
+ extern void _PEXEncodeModelClipVolume2D();
+ extern void _PEXEncodeRestoreModelClip();
+ extern void _PEXEncodeLightSourceState();
+ extern void _PEXEncodeID();
+ extern void _PEXEncodePSC();
+ extern void _PEXEncodeNameSet();
+ extern void _PEXEncodeExecuteStructure();
+ extern void _PEXEncodeLabel();
+ extern void _PEXEncodeApplicationData();
+ extern void _PEXEncodeGSE();
+ extern void _PEXEncodeMarkers();
+ extern void _PEXEncodePolyline();
+ extern void _PEXEncodeMarkers2D();
+ extern void _PEXEncodePolyline2D();
+ extern void _PEXEncodeText();
+ extern void _PEXEncodeText2D();
+ extern void _PEXEncodeAnnoText();
+ extern void _PEXEncodeAnnoText2D();
+ extern void _PEXEncodePolylineSet();
+ extern void _PEXEncodeNURBCurve();
+ extern void _PEXEncodeFillArea();
+ extern void _PEXEncodeFillArea2D();
+ extern void _PEXEncodeFillAreaWithData();
+ extern void _PEXEncodeFillAreaSet();
+ extern void _PEXEncodeFillAreaSet2D();
+ extern void _PEXEncodeFillAreaSetWithData();
+ extern void _PEXEncodeTriangleStrip();
+ extern void _PEXEncodeQuadMesh();
+ extern void _PEXEncodeSOFA();
+ extern void _PEXEncodeNURBSurface();
+ extern void _PEXEncodeCellArray();
+ extern void _PEXEncodeCellArray2D();
+ extern void _PEXEncodeExtendedCellArray();
+ extern void _PEXEncodeGDP();
+ extern void _PEXEncodeGDP2D();
+ extern void _PEXEncodeNoop();
+ 
+ void (*(PEX_encode_oc_funcs[]))() = {
+ NULL,				/* DUMMY		           0 */
+ _PEXEncodeEnumType,		/* PEXOCMarkerType                 1 */
+ _PEXEncodeFloat,		/* PEXOCMarkerScale                2 */
+ _PEXEncodeTableIndex,		/* PEXOCMarkerColorIndex           3 */
+ _PEXEncodeColor,		/* PEXOCMarkerColor                4 */
+ _PEXEncodeTableIndex,		/* PEXOCMarkerBundleIndex          5 */
+ _PEXEncodeTableIndex,		/* PEXOCTextFontIndex              6 */
+ _PEXEncodeCARD16,		/* PEXOCTextPrecision              7 */
+ _PEXEncodeFloat,		/* PEXOCCharExpansion              8 */
+ _PEXEncodeFloat,		/* PEXOCCharSpacing                9 */
+ _PEXEncodeTableIndex,		/* PEXOCTextColorIndex             10 */
+ _PEXEncodeColor,		/* PEXOCTextColor                  11 */
+ _PEXEncodeFloat,		/* PEXOCCharHeight                 12 */
+ _PEXEncodeVector2D,		/* PEXOCCharUpVector               13 */
+ _PEXEncodeCARD16,		/* PEXOCTextPath                   14 */
+ _PEXEncodeTextAlignment,	/* PEXOCTextAlignment              15 */
+ _PEXEncodeFloat,		/* PEXOCATextHeight                16 */
+ _PEXEncodeVector2D,		/* PEXOCATextUpVector              17 */
+ _PEXEncodeCARD16,		/* PEXOCATextPath                  18 */
+ _PEXEncodeTextAlignment,	/* PEXOCATextAlignment             19 */
+ _PEXEncodeEnumType,		/* PEXOCATextStyle                 20 */
+ _PEXEncodeTableIndex,		/* PEXOCTextBundleIndex            21 */
+ _PEXEncodeEnumType,		/* PEXOCLineType                   22 */
+ _PEXEncodeFloat,		/* PEXOCLineWidth                  23 */
+ _PEXEncodeTableIndex,		/* PEXOCLineColorIndex             24 */
+ _PEXEncodeColor,		/* PEXOCLineColor                  25 */
+ _PEXEncodeCurveApprox,		/* PEXOCCurveApprox                26 */
+ _PEXEncodeEnumType,		/* PEXOCPolylineInterpMethod       27 */
+ _PEXEncodeTableIndex,		/* PEXOCLineBundleIndex            28 */
+ _PEXEncodeEnumType,		/* PEXOCInteriorStyle              29 */
+ _PEXEncodeTableIndex,		/* PEXOCInteriorStyleIndex         30 */
+ _PEXEncodeTableIndex,		/* PEXOCSurfaceColorIndex          31 */
+ _PEXEncodeColor,		/* PEXOCSurfaceColor               32 */
+ _PEXEncodeReflectionAttr,	/* PEXOCReflectionAttributes       33 */
+ _PEXEncodeEnumType,		/* PEXOCReflectionModel            34 */
+ _PEXEncodeEnumType,		/* PEXOCSurfaceInterpMethod        35 */
+ _PEXEncodeEnumType,		/* PEXOCBFInteriorStyle            36 */
+ _PEXEncodeTableIndex,		/* PEXOCBFInteriorStyleIndex       37 */
+ _PEXEncodeTableIndex,		/* PEXOCBFSurfaceColorIndex        38 */
+ _PEXEncodeColor,		/* PEXOCBFSurfaceColor             39 */
+ _PEXEncodeReflectionAttr,	/* PEXOCBFReflectionAttributes     40 */
+ _PEXEncodeEnumType,		/* PEXOCBFReflectionModel          41 */
+ _PEXEncodeEnumType,		/* PEXOCBFSurfaceInterpMethod      42 */
+ _PEXEncodeSurfaceApprox,	/* PEXOCSurfaceApprox              43 */
+ _PEXEncodeCullMode,		/* PEXOCFacetCullingMode           44 */
+ _PEXEncodeSwitch,		/* PEXOCFacetDistinguishFlag       45 */
+ _PEXEncodePatternSize,		/* PEXOCPatternSize                46 */
+ _PEXEncodePatternAttr2D,	/* PEXOCPatternAttributes2D        47 */
+ _PEXEncodePatternAttr,		/* PEXOCPatternAttributes          48 */
+ _PEXEncodeTableIndex,		/* PEXOCInteriorBundleIndex        49 */
+ _PEXEncodeSwitch,		/* PEXOCSurfaceEdgeFlag            50 */
+ _PEXEncodeEnumType,		/* PEXOCSurfaceEdgeType            51 */
+ _PEXEncodeFloat,		/* PEXOCSurfaceEdgeWidth           52 */
+ _PEXEncodeTableIndex,		/* PEXOCSurfaceEdgeColorIndex      53 */
+ _PEXEncodeColor,		/* PEXOCSurfaceEdgeColor           54 */
+ _PEXEncodeTableIndex,		/* PEXOCEdgeBundleIndex            55 */
+ _PEXEncodeASF,			/* PEXOCIndividualASF              56 */
+ _PEXEncodeLocalTransform,	/* PEXOCLocalTransform             57 */
+ _PEXEncodeLocalTransform2D,	/* PEXOCLocalTransform2D           58 */
+ _PEXEncodeGlobalTransform,	/* PEXOCGlobalTransform            59 */
+ _PEXEncodeGlobalTransform2D,	/* PEXOCGlobalTransform2D          60 */
+ _PEXEncodeSwitch,		/* PEXOCModelClipFlag              61 */
+ _PEXEncodeModelClipVolume,	/* PEXOCModelClipVolume            62 */
+ _PEXEncodeModelClipVolume2D,	/* PEXOCModelClipVolume2D          63 */
+ _PEXEncodeRestoreModelClip,	/* PEXOCRestoreModelClipVolume     64 */
+ _PEXEncodeTableIndex,		/* PEXOCViewIndex                  65 */
+ _PEXEncodeLightSourceState,	/* PEXOCLightSourceState           66 */
+ _PEXEncodeTableIndex,		/* PEXOCDepthCueIndex              67 */
+ _PEXEncodeID,			/* PEXOCPickID                     68 */
+ _PEXEncodeID,			/* PEXOCHLHSRID                    69 */
+ _PEXEncodeTableIndex,		/* PEXOCColorApproxIndex           70 */
+ _PEXEncodeEnumType,		/* PEXOCRenderingColorModel        71 */
+ _PEXEncodePSC,			/* PEXOCParaSurfCharacteristics    72 */
+ _PEXEncodeNameSet,		/* PEXOCAddToNameSet               73 */
+ _PEXEncodeNameSet,		/* PEXOCRemoveFromNameSet          74 */
+ _PEXEncodeExecuteStructure,	/* PEXOCExecuteStructure           75 */
+ _PEXEncodeLabel,		/* PEXOCLabel                      76 */
+ _PEXEncodeApplicationData,	/* PEXOCApplicationData            77 */
+ _PEXEncodeGSE,			/* PEXOCGSE                        78 */
+ _PEXEncodeMarkers,		/* PEXOCMarkers                    79 */
+ _PEXEncodeMarkers2D,		/* PEXOCMarkers2D                  80 */
+ _PEXEncodeText,			/* PEXOCText                       81 */
+ _PEXEncodeText2D,		/* PEXOCText2D                     82 */
+ _PEXEncodeAnnoText,		/* PEXOCAnnotationText             83 */
+ _PEXEncodeAnnoText2D,		/* PEXOCAnnotationText2D           84 */
+ _PEXEncodePolyline,		/* PEXOCPolyline                   85 */
+ _PEXEncodePolyline2D,		/* PEXOCPolyline2D                 86 */
+ _PEXEncodePolylineSet,		/* PEXOCPolylineSetWithData        87 */
+ _PEXEncodeNURBCurve,		/* PEXOCNURBCurve                  88 */
+ _PEXEncodeFillArea,		/* PEXOCFillArea                   89 */
+ _PEXEncodeFillArea2D,		/* PEXOCFillArea2D                 90 */
+ _PEXEncodeFillAreaWithData,	/* PEXOCFillAreaWithData           91 */
+ _PEXEncodeFillAreaSet,		/* PEXOCFillAreaSet                92 */
+ _PEXEncodeFillAreaSet2D,	/* PEXOCFillAreaSet2D              93 */
+ _PEXEncodeFillAreaSetWithData,	/* PEXOCFillAreaSetWithData        94 */
+ _PEXEncodeTriangleStrip,	/* PEXOCTriangleStrip              95 */
+ _PEXEncodeQuadMesh,		/* PEXOCQuadrilateralMesh          96 */
+ _PEXEncodeSOFA,			/* PEXOCSetOfFillAreaSets          97 */
+ _PEXEncodeNURBSurface,		/* PEXOCNURBSurface                98 */
+ _PEXEncodeCellArray,		/* PEXOCCellArray                  99 */
+ _PEXEncodeCellArray2D,		/* PEXOCCellArray2D                100 */
+ _PEXEncodeExtendedCellArray,	/* PEXOCExtendedCellArray          101 */
+ _PEXEncodeGDP,			/* PEXOCGDP                        102 */
+ _PEXEncodeGDP2D,		/* PEXOCGDP2D                      103 */
+ _PEXEncodeNoop			/* PEXOCNoop                       104 */
+ };
+ 
+ 
+ /*
+  * Decode OC function table.
+  */
+ 
+ extern void _PEXDecodeEnumType();
+ extern void _PEXDecodeTableIndex();
+ extern void _PEXDecodeColor();
+ extern void _PEXDecodeFloat();
+ extern void _PEXDecodeCARD16();
+ extern void _PEXDecodeVector2D();
+ extern void _PEXDecodeTextAlignment();
+ extern void _PEXDecodeCurveApprox();
+ extern void _PEXDecodeReflectionAttr();
+ extern void _PEXDecodeSurfaceApprox();
+ extern void _PEXDecodeCullMode();
+ extern void _PEXDecodeSwitch();
+ extern void _PEXDecodePatternSize();
+ extern void _PEXDecodePatternAttr2D();
+ extern void _PEXDecodePatternAttr();
+ extern void _PEXDecodeASF();
+ extern void _PEXDecodeLocalTransform();
+ extern void _PEXDecodeLocalTransform2D();
+ extern void _PEXDecodeGlobalTransform();
+ extern void _PEXDecodeGlobalTransform2D();
+ extern void _PEXDecodeModelClipVolume();
+ extern void _PEXDecodeModelClipVolume2D();
+ extern void _PEXDecodeRestoreModelClip();
+ extern void _PEXDecodeLightSourceState();
+ extern void _PEXDecodeID();
+ extern void _PEXDecodePSC();
+ extern void _PEXDecodeNameSet();
+ extern void _PEXDecodeExecuteStructure();
+ extern void _PEXDecodeLabel();
+ extern void _PEXDecodeApplicationData();
+ extern void _PEXDecodeGSE();
+ extern void _PEXDecodeMarkers();
+ extern void _PEXDecodePolyline();
+ extern void _PEXDecodeMarkers2D();
+ extern void _PEXDecodePolyline2D();
+ extern void _PEXDecodeText();
+ extern void _PEXDecodeText2D();
+ extern void _PEXDecodeAnnoText();
+ extern void _PEXDecodeAnnoText2D();
+ extern void _PEXDecodePolylineSet();
+ extern void _PEXDecodeNURBCurve();
+ extern void _PEXDecodeFillArea();
+ extern void _PEXDecodeFillArea2D();
+ extern void _PEXDecodeFillAreaWithData();
+ extern void _PEXDecodeFillAreaSet();
+ extern void _PEXDecodeFillAreaSet2D();
+ extern void _PEXDecodeFillAreaSetWithData();
+ extern void _PEXDecodeTriangleStrip();
+ extern void _PEXDecodeQuadMesh();
+ extern void _PEXDecodeSOFA();
+ extern void _PEXDecodeNURBSurface();
+ extern void _PEXDecodeCellArray();
+ extern void _PEXDecodeCellArray2D();
+ extern void _PEXDecodeExtendedCellArray();
+ extern void _PEXDecodeGDP();
+ extern void _PEXDecodeGDP2D();
+ extern void _PEXDecodeNoop();
+ 
+ void (*(PEX_decode_oc_funcs[]))() = {
+ NULL,				/* DUMMY		           0 */
+ _PEXDecodeEnumType,		/* PEXOCMarkerType                 1 */
+ _PEXDecodeFloat,		/* PEXOCMarkerScale                2 */
+ _PEXDecodeTableIndex,		/* PEXOCMarkerColorIndex           3 */
+ _PEXDecodeColor,		/* PEXOCMarkerColor                4 */
+ _PEXDecodeTableIndex,		/* PEXOCMarkerBundleIndex          5 */
+ _PEXDecodeTableIndex,		/* PEXOCTextFontIndex              6 */
+ _PEXDecodeCARD16,		/* PEXOCTextPrecision              7 */
+ _PEXDecodeFloat,		/* PEXOCCharExpansion              8 */
+ _PEXDecodeFloat,		/* PEXOCCharSpacing                9 */
+ _PEXDecodeTableIndex,		/* PEXOCTextColorIndex             10 */
+ _PEXDecodeColor,		/* PEXOCTextColor                  11 */
+ _PEXDecodeFloat,		/* PEXOCCharHeight                 12 */
+ _PEXDecodeVector2D,		/* PEXOCCharUpVector               13 */
+ _PEXDecodeCARD16,		/* PEXOCTextPath                   14 */
+ _PEXDecodeTextAlignment,	/* PEXOCTextAlignment              15 */
+ _PEXDecodeFloat,		/* PEXOCATextHeight                16 */
+ _PEXDecodeVector2D,		/* PEXOCATextUpVector              17 */
+ _PEXDecodeCARD16,		/* PEXOCATextPath                  18 */
+ _PEXDecodeTextAlignment,	/* PEXOCATextAlignment             19 */
+ _PEXDecodeEnumType,		/* PEXOCATextStyle                 20 */
+ _PEXDecodeTableIndex,		/* PEXOCTextBundleIndex            21 */
+ _PEXDecodeEnumType,		/* PEXOCLineType                   22 */
+ _PEXDecodeFloat,		/* PEXOCLineWidth                  23 */
+ _PEXDecodeTableIndex,		/* PEXOCLineColorIndex             24 */
+ _PEXDecodeColor,		/* PEXOCLineColor                  25 */
+ _PEXDecodeCurveApprox,		/* PEXOCCurveApprox                26 */
+ _PEXDecodeEnumType,		/* PEXOCPolylineInterpMethod       27 */
+ _PEXDecodeTableIndex,		/* PEXOCLineBundleIndex            28 */
+ _PEXDecodeEnumType,		/* PEXOCInteriorStyle              29 */
+ _PEXDecodeTableIndex,		/* PEXOCInteriorStyleIndex         30 */
+ _PEXDecodeTableIndex,		/* PEXOCSurfaceColorIndex          31 */
+ _PEXDecodeColor,		/* PEXOCSurfaceColor               32 */
+ _PEXDecodeReflectionAttr,	/* PEXOCReflectionAttributes       33 */
+ _PEXDecodeEnumType,		/* PEXOCReflectionModel            34 */
+ _PEXDecodeEnumType,		/* PEXOCSurfaceInterpMethod        35 */
+ _PEXDecodeEnumType,		/* PEXOCBFInteriorStyle            36 */
+ _PEXDecodeTableIndex,		/* PEXOCBFInteriorStyleIndex       37 */
+ _PEXDecodeTableIndex,		/* PEXOCBFSurfaceColorIndex        38 */
+ _PEXDecodeColor,		/* PEXOCBFSurfaceColor             39 */
+ _PEXDecodeReflectionAttr,	/* PEXOCBFReflectionAttributes     40 */
+ _PEXDecodeEnumType,		/* PEXOCBFReflectionModel          41 */
+ _PEXDecodeEnumType,		/* PEXOCBFSurfaceInterpMethod      42 */
+ _PEXDecodeSurfaceApprox,	/* PEXOCSurfaceApprox              43 */
+ _PEXDecodeCullMode,		/* PEXOCFacetCullingMode           44 */
+ _PEXDecodeSwitch,		/* PEXOCFacetDistinguishFlag       45 */
+ _PEXDecodePatternSize,		/* PEXOCPatternSize                46 */
+ _PEXDecodePatternAttr2D,	/* PEXOCPatternAttributes2D        47 */
+ _PEXDecodePatternAttr,		/* PEXOCPatternAttributes          48 */
+ _PEXDecodeTableIndex,		/* PEXOCInteriorBundleIndex        49 */
+ _PEXDecodeSwitch,		/* PEXOCSurfaceEdgeFlag            50 */
+ _PEXDecodeEnumType,		/* PEXOCSurfaceEdgeType            51 */
+ _PEXDecodeFloat,		/* PEXOCSurfaceEdgeWidth           52 */
+ _PEXDecodeTableIndex,		/* PEXOCSurfaceEdgeColorIndex      53 */
+ _PEXDecodeColor,		/* PEXOCSurfaceEdgeColor           54 */
+ _PEXDecodeTableIndex,		/* PEXOCEdgeBundleIndex            55 */
+ _PEXDecodeASF,			/* PEXOCIndividualASF              56 */
+ _PEXDecodeLocalTransform,	/* PEXOCLocalTransform             57 */
+ _PEXDecodeLocalTransform2D,	/* PEXOCLocalTransform2D           58 */
+ _PEXDecodeGlobalTransform,	/* PEXOCGlobalTransform            59 */
+ _PEXDecodeGlobalTransform2D,	/* PEXOCGlobalTransform2D          60 */
+ _PEXDecodeSwitch,		/* PEXOCModelClipFlag              61 */
+ _PEXDecodeModelClipVolume,	/* PEXOCModelClipVolume            62 */
+ _PEXDecodeModelClipVolume2D,	/* PEXOCModelClipVolume2D          63 */
+ _PEXDecodeRestoreModelClip,	/* PEXOCRestoreModelClipVolume     64 */
+ _PEXDecodeTableIndex,		/* PEXOCViewIndex                  65 */
+ _PEXDecodeLightSourceState,	/* PEXOCLightSourceState           66 */
+ _PEXDecodeTableIndex,		/* PEXOCDepthCueIndex              67 */
+ _PEXDecodeID,			/* PEXOCPickID                     68 */
+ _PEXDecodeID,			/* PEXOCHLHSRID                    69 */
+ _PEXDecodeTableIndex,		/* PEXOCColorApproxIndex           70 */
+ _PEXDecodeEnumType,		/* PEXOCRenderingColorModel        71 */
+ _PEXDecodePSC,			/* PEXOCParaSurfCharacteristics    72 */
+ _PEXDecodeNameSet,		/* PEXOCAddToNameSet               73 */
+ _PEXDecodeNameSet,		/* PEXOCRemoveFromNameSet          74 */
+ _PEXDecodeExecuteStructure,	/* PEXOCExecuteStructure           75 */
+ _PEXDecodeLabel,		/* PEXOCLabel                      76 */
+ _PEXDecodeApplicationData,	/* PEXOCApplicationData            77 */
+ _PEXDecodeGSE,			/* PEXOCGSE                        78 */
+ _PEXDecodeMarkers,		/* PEXOCMarkers                    79 */
+ _PEXDecodeMarkers2D,		/* PEXOCMarkers2D                  80 */
+ _PEXDecodeText,			/* PEXOCText                       81 */
+ _PEXDecodeText2D,		/* PEXOCText2D                     82 */
+ _PEXDecodeAnnoText,		/* PEXOCAnnotationText             83 */
+ _PEXDecodeAnnoText2D,		/* PEXOCAnnotationText2D           84 */
+ _PEXDecodePolyline,		/* PEXOCPolyline                   85 */
+ _PEXDecodePolyline2D,		/* PEXOCPolyline2D                 86 */
+ _PEXDecodePolylineSet,		/* PEXOCPolylineSetWithData        87 */
+ _PEXDecodeNURBCurve,		/* PEXOCNURBCurve                  88 */
+ _PEXDecodeFillArea,		/* PEXOCFillArea                   89 */
+ _PEXDecodeFillArea2D,		/* PEXOCFillArea2D                 90 */
+ _PEXDecodeFillAreaWithData,	/* PEXOCFillAreaWithData           91 */
+ _PEXDecodeFillAreaSet,		/* PEXOCFillAreaSet                92 */
+ _PEXDecodeFillAreaSet2D,	/* PEXOCFillAreaSet2D              93 */
+ _PEXDecodeFillAreaSetWithData,	/* PEXOCFillAreaSetWithData        94 */
+ _PEXDecodeTriangleStrip,	/* PEXOCTriangleStrip              95 */
+ _PEXDecodeQuadMesh,		/* PEXOCQuadrilateralMesh          96 */
+ _PEXDecodeSOFA,			/* PEXOCSetOfFillAreaSets          97 */
+ _PEXDecodeNURBSurface,		/* PEXOCNURBSurface                98 */
+ _PEXDecodeCellArray,		/* PEXOCCellArray                  99 */
+ _PEXDecodeCellArray2D,		/* PEXOCCellArray2D                100 */
+ _PEXDecodeExtendedCellArray,	/* PEXOCExtendedCellArray          101 */
+ _PEXDecodeGDP,			/* PEXOCGDP                        102 */
+ _PEXDecodeGDP2D,		/* PEXOCGDP2D                      103 */
+ _PEXDecodeNoop			/* PEXOCNoop                       104 */
+ };
+ 
diff -c mit/extensions/lib/PEXlib/pl_global_def.h:1.1.1.1 mit/extensions/lib/PEXlib/pl_global_def.h:removed
*** mit/extensions/lib/PEXlib/pl_global_def.h:1.1.1.1	Sat Mar 12 00:41:58 1994
--- mit/extensions/lib/PEXlib/pl_global_def.h	Sat Mar 12 00:41:56 1994
***************
*** 1,375 ****
- /* $XConsortium: pl_global_def.h,v 1.6 92/08/26 13:05:23 mor Exp $ */
- 
- /******************************************************************************
- Copyright 1992 by the Massachusetts Institute of Technology
- 
-                         All Rights Reserved
- 
- Permission to use, copy, modify, distribute, and sell this software and its
- documentation for any purpose is hereby granted without fee, provided that
- the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation, and that the name of M.I.T. not be used in advertising or
- publicity pertaining to distribution of the software without specific,
- written prior permission.  M.I.T. makes no representations about the
- suitability of this software for any purpose.  It is provided "as is"
- without express or implied warranty.
- ******************************************************************************/
- 
- /*
-  * Header to linked list of open displays.
-  */
- 
- PEXDisplayInfo 	*PEXDisplayInfoHeader = NULL;
- 
- 
- /*
-  * Pick path cache.
-  */
- 
- PEXPickPath	*PEXPickCache = NULL;
- unsigned int	PEXPickCacheSize = 0;
- int		PEXPickCacheInUse = 0;
- 
- 
- /*
-  * Encode OC function table.
-  */
- 
- extern void _PEXEncodeEnumType();
- extern void _PEXEncodeTableIndex();
- extern void _PEXEncodeColor();
- extern void _PEXEncodeFloat();
- extern void _PEXEncodeCARD16();
- extern void _PEXEncodeVector2D();
- extern void _PEXEncodeTextAlignment();
- extern void _PEXEncodeCurveApprox();
- extern void _PEXEncodeReflectionAttr();
- extern void _PEXEncodeSurfaceApprox();
- extern void _PEXEncodeCullMode();
- extern void _PEXEncodeSwitch();
- extern void _PEXEncodePatternSize();
- extern void _PEXEncodePatternAttr2D();
- extern void _PEXEncodePatternAttr();
- extern void _PEXEncodeASF();
- extern void _PEXEncodeLocalTransform();
- extern void _PEXEncodeLocalTransform2D();
- extern void _PEXEncodeGlobalTransform();
- extern void _PEXEncodeGlobalTransform2D();
- extern void _PEXEncodeModelClipVolume();
- extern void _PEXEncodeModelClipVolume2D();
- extern void _PEXEncodeRestoreModelClip();
- extern void _PEXEncodeLightSourceState();
- extern void _PEXEncodeID();
- extern void _PEXEncodePSC();
- extern void _PEXEncodeNameSet();
- extern void _PEXEncodeExecuteStructure();
- extern void _PEXEncodeLabel();
- extern void _PEXEncodeApplicationData();
- extern void _PEXEncodeGSE();
- extern void _PEXEncodeMarkers();
- extern void _PEXEncodePolyline();
- extern void _PEXEncodeMarkers2D();
- extern void _PEXEncodePolyline2D();
- extern void _PEXEncodeText();
- extern void _PEXEncodeText2D();
- extern void _PEXEncodeAnnoText();
- extern void _PEXEncodeAnnoText2D();
- extern void _PEXEncodePolylineSet();
- extern void _PEXEncodeNURBCurve();
- extern void _PEXEncodeFillArea();
- extern void _PEXEncodeFillArea2D();
- extern void _PEXEncodeFillAreaWithData();
- extern void _PEXEncodeFillAreaSet();
- extern void _PEXEncodeFillAreaSet2D();
- extern void _PEXEncodeFillAreaSetWithData();
- extern void _PEXEncodeTriangleStrip();
- extern void _PEXEncodeQuadMesh();
- extern void _PEXEncodeSOFA();
- extern void _PEXEncodeNURBSurface();
- extern void _PEXEncodeCellArray();
- extern void _PEXEncodeCellArray2D();
- extern void _PEXEncodeExtendedCellArray();
- extern void _PEXEncodeGDP();
- extern void _PEXEncodeGDP2D();
- extern void _PEXEncodeNoop();
- 
- void (*(PEX_encode_oc_funcs[]))() = {
- NULL,				/* DUMMY		           0 */
- _PEXEncodeEnumType,		/* PEXOCMarkerType                 1 */
- _PEXEncodeFloat,		/* PEXOCMarkerScale                2 */
- _PEXEncodeTableIndex,		/* PEXOCMarkerColorIndex           3 */
- _PEXEncodeColor,		/* PEXOCMarkerColor                4 */
- _PEXEncodeTableIndex,		/* PEXOCMarkerBundleIndex          5 */
- _PEXEncodeTableIndex,		/* PEXOCTextFontIndex              6 */
- _PEXEncodeCARD16,		/* PEXOCTextPrecision              7 */
- _PEXEncodeFloat,		/* PEXOCCharExpansion              8 */
- _PEXEncodeFloat,		/* PEXOCCharSpacing                9 */
- _PEXEncodeTableIndex,		/* PEXOCTextColorIndex             10 */
- _PEXEncodeColor,		/* PEXOCTextColor                  11 */
- _PEXEncodeFloat,		/* PEXOCCharHeight                 12 */
- _PEXEncodeVector2D,		/* PEXOCCharUpVector               13 */
- _PEXEncodeCARD16,		/* PEXOCTextPath                   14 */
- _PEXEncodeTextAlignment,	/* PEXOCTextAlignment              15 */
- _PEXEncodeFloat,		/* PEXOCATextHeight                16 */
- _PEXEncodeVector2D,		/* PEXOCATextUpVector              17 */
- _PEXEncodeCARD16,		/* PEXOCATextPath                  18 */
- _PEXEncodeTextAlignment,	/* PEXOCATextAlignment             19 */
- _PEXEncodeEnumType,		/* PEXOCATextStyle                 20 */
- _PEXEncodeTableIndex,		/* PEXOCTextBundleIndex            21 */
- _PEXEncodeEnumType,		/* PEXOCLineType                   22 */
- _PEXEncodeFloat,		/* PEXOCLineWidth                  23 */
- _PEXEncodeTableIndex,		/* PEXOCLineColorIndex             24 */
- _PEXEncodeColor,		/* PEXOCLineColor                  25 */
- _PEXEncodeCurveApprox,		/* PEXOCCurveApprox                26 */
- _PEXEncodeEnumType,		/* PEXOCPolylineInterpMethod       27 */
- _PEXEncodeTableIndex,		/* PEXOCLineBundleIndex            28 */
- _PEXEncodeEnumType,		/* PEXOCInteriorStyle              29 */
- _PEXEncodeTableIndex,		/* PEXOCInteriorStyleIndex         30 */
- _PEXEncodeTableIndex,		/* PEXOCSurfaceColorIndex          31 */
- _PEXEncodeColor,		/* PEXOCSurfaceColor               32 */
- _PEXEncodeReflectionAttr,	/* PEXOCReflectionAttributes       33 */
- _PEXEncodeEnumType,		/* PEXOCReflectionModel            34 */
- _PEXEncodeEnumType,		/* PEXOCSurfaceInterpMethod        35 */
- _PEXEncodeEnumType,		/* PEXOCBFInteriorStyle            36 */
- _PEXEncodeTableIndex,		/* PEXOCBFInteriorStyleIndex       37 */
- _PEXEncodeTableIndex,		/* PEXOCBFSurfaceColorIndex        38 */
- _PEXEncodeColor,		/* PEXOCBFSurfaceColor             39 */
- _PEXEncodeReflectionAttr,	/* PEXOCBFReflectionAttributes     40 */
- _PEXEncodeEnumType,		/* PEXOCBFReflectionModel          41 */
- _PEXEncodeEnumType,		/* PEXOCBFSurfaceInterpMethod      42 */
- _PEXEncodeSurfaceApprox,	/* PEXOCSurfaceApprox              43 */
- _PEXEncodeCullMode,		/* PEXOCFacetCullingMode           44 */
- _PEXEncodeSwitch,		/* PEXOCFacetDistinguishFlag       45 */
- _PEXEncodePatternSize,		/* PEXOCPatternSize                46 */
- _PEXEncodePatternAttr2D,	/* PEXOCPatternAttributes2D        47 */
- _PEXEncodePatternAttr,		/* PEXOCPatternAttributes          48 */
- _PEXEncodeTableIndex,		/* PEXOCInteriorBundleIndex        49 */
- _PEXEncodeSwitch,		/* PEXOCSurfaceEdgeFlag            50 */
- _PEXEncodeEnumType,		/* PEXOCSurfaceEdgeType            51 */
- _PEXEncodeFloat,		/* PEXOCSurfaceEdgeWidth           52 */
- _PEXEncodeTableIndex,		/* PEXOCSurfaceEdgeColorIndex      53 */
- _PEXEncodeColor,		/* PEXOCSurfaceEdgeColor           54 */
- _PEXEncodeTableIndex,		/* PEXOCEdgeBundleIndex            55 */
- _PEXEncodeASF,			/* PEXOCIndividualASF              56 */
- _PEXEncodeLocalTransform,	/* PEXOCLocalTransform             57 */
- _PEXEncodeLocalTransform2D,	/* PEXOCLocalTransform2D           58 */
- _PEXEncodeGlobalTransform,	/* PEXOCGlobalTransform            59 */
- _PEXEncodeGlobalTransform2D,	/* PEXOCGlobalTransform2D          60 */
- _PEXEncodeSwitch,		/* PEXOCModelClipFlag              61 */
- _PEXEncodeModelClipVolume,	/* PEXOCModelClipVolume            62 */
- _PEXEncodeModelClipVolume2D,	/* PEXOCModelClipVolume2D          63 */
- _PEXEncodeRestoreModelClip,	/* PEXOCRestoreModelClipVolume     64 */
- _PEXEncodeTableIndex,		/* PEXOCViewIndex                  65 */
- _PEXEncodeLightSourceState,	/* PEXOCLightSourceState           66 */
- _PEXEncodeTableIndex,		/* PEXOCDepthCueIndex              67 */
- _PEXEncodeID,			/* PEXOCPickID                     68 */
- _PEXEncodeID,			/* PEXOCHLHSRID                    69 */
- _PEXEncodeTableIndex,		/* PEXOCColorApproxIndex           70 */
- _PEXEncodeEnumType,		/* PEXOCRenderingColorModel        71 */
- _PEXEncodePSC,			/* PEXOCParaSurfCharacteristics    72 */
- _PEXEncodeNameSet,		/* PEXOCAddToNameSet               73 */
- _PEXEncodeNameSet,		/* PEXOCRemoveFromNameSet          74 */
- _PEXEncodeExecuteStructure,	/* PEXOCExecuteStructure           75 */
- _PEXEncodeLabel,		/* PEXOCLabel                      76 */
- _PEXEncodeApplicationData,	/* PEXOCApplicationData            77 */
- _PEXEncodeGSE,			/* PEXOCGSE                        78 */
- _PEXEncodeMarkers,		/* PEXOCMarkers                    79 */
- _PEXEncodeMarkers2D,		/* PEXOCMarkers2D                  80 */
- _PEXEncodeText,			/* PEXOCText                       81 */
- _PEXEncodeText2D,		/* PEXOCText2D                     82 */
- _PEXEncodeAnnoText,		/* PEXOCAnnotationText             83 */
- _PEXEncodeAnnoText2D,		/* PEXOCAnnotationText2D           84 */
- _PEXEncodePolyline,		/* PEXOCPolyline                   85 */
- _PEXEncodePolyline2D,		/* PEXOCPolyline2D                 86 */
- _PEXEncodePolylineSet,		/* PEXOCPolylineSetWithData        87 */
- _PEXEncodeNURBCurve,		/* PEXOCNURBCurve                  88 */
- _PEXEncodeFillArea,		/* PEXOCFillArea                   89 */
- _PEXEncodeFillArea2D,		/* PEXOCFillArea2D                 90 */
- _PEXEncodeFillAreaWithData,	/* PEXOCFillAreaWithData           91 */
- _PEXEncodeFillAreaSet,		/* PEXOCFillAreaSet                92 */
- _PEXEncodeFillAreaSet2D,	/* PEXOCFillAreaSet2D              93 */
- _PEXEncodeFillAreaSetWithData,	/* PEXOCFillAreaSetWithData        94 */
- _PEXEncodeTriangleStrip,	/* PEXOCTriangleStrip              95 */
- _PEXEncodeQuadMesh,		/* PEXOCQuadrilateralMesh          96 */
- _PEXEncodeSOFA,			/* PEXOCSetOfFillAreaSets          97 */
- _PEXEncodeNURBSurface,		/* PEXOCNURBSurface                98 */
- _PEXEncodeCellArray,		/* PEXOCCellArray                  99 */
- _PEXEncodeCellArray2D,		/* PEXOCCellArray2D                100 */
- _PEXEncodeExtendedCellArray,	/* PEXOCExtendedCellArray          101 */
- _PEXEncodeGDP,			/* PEXOCGDP                        102 */
- _PEXEncodeGDP2D,		/* PEXOCGDP2D                      103 */
- _PEXEncodeNoop			/* PEXOCNoop                       104 */
- };
- 
- 
- /*
-  * Decode OC function table.
-  */
- 
- extern void _PEXDecodeEnumType();
- extern void _PEXDecodeTableIndex();
- extern void _PEXDecodeColor();
- extern void _PEXDecodeFloat();
- extern void _PEXDecodeCARD16();
- extern void _PEXDecodeVector2D();
- extern void _PEXDecodeTextAlignment();
- extern void _PEXDecodeCurveApprox();
- extern void _PEXDecodeReflectionAttr();
- extern void _PEXDecodeSurfaceApprox();
- extern void _PEXDecodeCullMode();
- extern void _PEXDecodeSwitch();
- extern void _PEXDecodePatternSize();
- extern void _PEXDecodePatternAttr2D();
- extern void _PEXDecodePatternAttr();
- extern void _PEXDecodeASF();
- extern void _PEXDecodeLocalTransform();
- extern void _PEXDecodeLocalTransform2D();
- extern void _PEXDecodeGlobalTransform();
- extern void _PEXDecodeGlobalTransform2D();
- extern void _PEXDecodeModelClipVolume();
- extern void _PEXDecodeModelClipVolume2D();
- extern void _PEXDecodeRestoreModelClip();
- extern void _PEXDecodeLightSourceState();
- extern void _PEXDecodeID();
- extern void _PEXDecodePSC();
- extern void _PEXDecodeNameSet();
- extern void _PEXDecodeExecuteStructure();
- extern void _PEXDecodeLabel();
- extern void _PEXDecodeApplicationData();
- extern void _PEXDecodeGSE();
- extern void _PEXDecodeMarkers();
- extern void _PEXDecodePolyline();
- extern void _PEXDecodeMarkers2D();
- extern void _PEXDecodePolyline2D();
- extern void _PEXDecodeText();
- extern void _PEXDecodeText2D();
- extern void _PEXDecodeAnnoText();
- extern void _PEXDecodeAnnoText2D();
- extern void _PEXDecodePolylineSet();
- extern void _PEXDecodeNURBCurve();
- extern void _PEXDecodeFillArea();
- extern void _PEXDecodeFillArea2D();
- extern void _PEXDecodeFillAreaWithData();
- extern void _PEXDecodeFillAreaSet();
- extern void _PEXDecodeFillAreaSet2D();
- extern void _PEXDecodeFillAreaSetWithData();
- extern void _PEXDecodeTriangleStrip();
- extern void _PEXDecodeQuadMesh();
- extern void _PEXDecodeSOFA();
- extern void _PEXDecodeNURBSurface();
- extern void _PEXDecodeCellArray();
- extern void _PEXDecodeCellArray2D();
- extern void _PEXDecodeExtendedCellArray();
- extern void _PEXDecodeGDP();
- extern void _PEXDecodeGDP2D();
- extern void _PEXDecodeNoop();
- 
- void (*(PEX_decode_oc_funcs[]))() = {
- NULL,				/* DUMMY		           0 */
- _PEXDecodeEnumType,		/* PEXOCMarkerType                 1 */
- _PEXDecodeFloat,		/* PEXOCMarkerScale                2 */
- _PEXDecodeTableIndex,		/* PEXOCMarkerColorIndex           3 */
- _PEXDecodeColor,		/* PEXOCMarkerColor                4 */
- _PEXDecodeTableIndex,		/* PEXOCMarkerBundleIndex          5 */
- _PEXDecodeTableIndex,		/* PEXOCTextFontIndex              6 */
- _PEXDecodeCARD16,		/* PEXOCTextPrecision              7 */
- _PEXDecodeFloat,		/* PEXOCCharExpansion              8 */
- _PEXDecodeFloat,		/* PEXOCCharSpacing                9 */
- _PEXDecodeTableIndex,		/* PEXOCTextColorIndex             10 */
- _PEXDecodeColor,		/* PEXOCTextColor                  11 */
- _PEXDecodeFloat,		/* PEXOCCharHeight                 12 */
- _PEXDecodeVector2D,		/* PEXOCCharUpVector               13 */
- _PEXDecodeCARD16,		/* PEXOCTextPath                   14 */
- _PEXDecodeTextAlignment,	/* PEXOCTextAlignment              15 */
- _PEXDecodeFloat,		/* PEXOCATextHeight                16 */
- _PEXDecodeVector2D,		/* PEXOCATextUpVector              17 */
- _PEXDecodeCARD16,		/* PEXOCATextPath                  18 */
- _PEXDecodeTextAlignment,	/* PEXOCATextAlignment             19 */
- _PEXDecodeEnumType,		/* PEXOCATextStyle                 20 */
- _PEXDecodeTableIndex,		/* PEXOCTextBundleIndex            21 */
- _PEXDecodeEnumType,		/* PEXOCLineType                   22 */
- _PEXDecodeFloat,		/* PEXOCLineWidth                  23 */
- _PEXDecodeTableIndex,		/* PEXOCLineColorIndex             24 */
- _PEXDecodeColor,		/* PEXOCLineColor                  25 */
- _PEXDecodeCurveApprox,		/* PEXOCCurveApprox                26 */
- _PEXDecodeEnumType,		/* PEXOCPolylineInterpMethod       27 */
- _PEXDecodeTableIndex,		/* PEXOCLineBundleIndex            28 */
- _PEXDecodeEnumType,		/* PEXOCInteriorStyle              29 */
- _PEXDecodeTableIndex,		/* PEXOCInteriorStyleIndex         30 */
- _PEXDecodeTableIndex,		/* PEXOCSurfaceColorIndex          31 */
- _PEXDecodeColor,		/* PEXOCSurfaceColor               32 */
- _PEXDecodeReflectionAttr,	/* PEXOCReflectionAttributes       33 */
- _PEXDecodeEnumType,		/* PEXOCReflectionModel            34 */
- _PEXDecodeEnumType,		/* PEXOCSurfaceInterpMethod        35 */
- _PEXDecodeEnumType,		/* PEXOCBFInteriorStyle            36 */
- _PEXDecodeTableIndex,		/* PEXOCBFInteriorStyleIndex       37 */
- _PEXDecodeTableIndex,		/* PEXOCBFSurfaceColorIndex        38 */
- _PEXDecodeColor,		/* PEXOCBFSurfaceColor             39 */
- _PEXDecodeReflectionAttr,	/* PEXOCBFReflectionAttributes     40 */
- _PEXDecodeEnumType,		/* PEXOCBFReflectionModel          41 */
- _PEXDecodeEnumType,		/* PEXOCBFSurfaceInterpMethod      42 */
- _PEXDecodeSurfaceApprox,	/* PEXOCSurfaceApprox              43 */
- _PEXDecodeCullMode,		/* PEXOCFacetCullingMode           44 */
- _PEXDecodeSwitch,		/* PEXOCFacetDistinguishFlag       45 */
- _PEXDecodePatternSize,		/* PEXOCPatternSize                46 */
- _PEXDecodePatternAttr2D,	/* PEXOCPatternAttributes2D        47 */
- _PEXDecodePatternAttr,		/* PEXOCPatternAttributes          48 */
- _PEXDecodeTableIndex,		/* PEXOCInteriorBundleIndex        49 */
- _PEXDecodeSwitch,		/* PEXOCSurfaceEdgeFlag            50 */
- _PEXDecodeEnumType,		/* PEXOCSurfaceEdgeType            51 */
- _PEXDecodeFloat,		/* PEXOCSurfaceEdgeWidth           52 */
- _PEXDecodeTableIndex,		/* PEXOCSurfaceEdgeColorIndex      53 */
- _PEXDecodeColor,		/* PEXOCSurfaceEdgeColor           54 */
- _PEXDecodeTableIndex,		/* PEXOCEdgeBundleIndex            55 */
- _PEXDecodeASF,			/* PEXOCIndividualASF              56 */
- _PEXDecodeLocalTransform,	/* PEXOCLocalTransform             57 */
- _PEXDecodeLocalTransform2D,	/* PEXOCLocalTransform2D           58 */
- _PEXDecodeGlobalTransform,	/* PEXOCGlobalTransform            59 */
- _PEXDecodeGlobalTransform2D,	/* PEXOCGlobalTransform2D          60 */
- _PEXDecodeSwitch,		/* PEXOCModelClipFlag              61 */
- _PEXDecodeModelClipVolume,	/* PEXOCModelClipVolume            62 */
- _PEXDecodeModelClipVolume2D,	/* PEXOCModelClipVolume2D          63 */
- _PEXDecodeRestoreModelClip,	/* PEXOCRestoreModelClipVolume     64 */
- _PEXDecodeTableIndex,		/* PEXOCViewIndex                  65 */
- _PEXDecodeLightSourceState,	/* PEXOCLightSourceState           66 */
- _PEXDecodeTableIndex,		/* PEXOCDepthCueIndex              67 */
- _PEXDecodeID,			/* PEXOCPickID                     68 */
- _PEXDecodeID,			/* PEXOCHLHSRID                    69 */
- _PEXDecodeTableIndex,		/* PEXOCColorApproxIndex           70 */
- _PEXDecodeEnumType,		/* PEXOCRenderingColorModel        71 */
- _PEXDecodePSC,			/* PEXOCParaSurfCharacteristics    72 */
- _PEXDecodeNameSet,		/* PEXOCAddToNameSet               73 */
- _PEXDecodeNameSet,		/* PEXOCRemoveFromNameSet          74 */
- _PEXDecodeExecuteStructure,	/* PEXOCExecuteStructure           75 */
- _PEXDecodeLabel,		/* PEXOCLabel                      76 */
- _PEXDecodeApplicationData,	/* PEXOCApplicationData            77 */
- _PEXDecodeGSE,			/* PEXOCGSE                        78 */
- _PEXDecodeMarkers,		/* PEXOCMarkers                    79 */
- _PEXDecodeMarkers2D,		/* PEXOCMarkers2D                  80 */
- _PEXDecodeText,			/* PEXOCText                       81 */
- _PEXDecodeText2D,		/* PEXOCText2D                     82 */
- _PEXDecodeAnnoText,		/* PEXOCAnnotationText             83 */
- _PEXDecodeAnnoText2D,		/* PEXOCAnnotationText2D           84 */
- _PEXDecodePolyline,		/* PEXOCPolyline                   85 */
- _PEXDecodePolyline2D,		/* PEXOCPolyline2D                 86 */
- _PEXDecodePolylineSet,		/* PEXOCPolylineSetWithData        87 */
- _PEXDecodeNURBCurve,		/* PEXOCNURBCurve                  88 */
- _PEXDecodeFillArea,		/* PEXOCFillArea                   89 */
- _PEXDecodeFillArea2D,		/* PEXOCFillArea2D                 90 */
- _PEXDecodeFillAreaWithData,	/* PEXOCFillAreaWithData           91 */
- _PEXDecodeFillAreaSet,		/* PEXOCFillAreaSet                92 */
- _PEXDecodeFillAreaSet2D,	/* PEXOCFillAreaSet2D              93 */
- _PEXDecodeFillAreaSetWithData,	/* PEXOCFillAreaSetWithData        94 */
- _PEXDecodeTriangleStrip,	/* PEXOCTriangleStrip              95 */
- _PEXDecodeQuadMesh,		/* PEXOCQuadrilateralMesh          96 */
- _PEXDecodeSOFA,			/* PEXOCSetOfFillAreaSets          97 */
- _PEXDecodeNURBSurface,		/* PEXOCNURBSurface                98 */
- _PEXDecodeCellArray,		/* PEXOCCellArray                  99 */
- _PEXDecodeCellArray2D,		/* PEXOCCellArray2D                100 */
- _PEXDecodeExtendedCellArray,	/* PEXOCExtendedCellArray          101 */
- _PEXDecodeGDP,			/* PEXOCGDP                        102 */
- _PEXDecodeGDP2D,		/* PEXOCGDP2D                      103 */
- _PEXDecodeNoop			/* PEXOCNoop                       104 */
- };
- 
--- 0 ----
diff -c mit/extensions/lib/PEXlib/pl_startup.c:1.1.1.1 mit/extensions/lib/PEXlib/pl_startup.c:2.0
*** mit/extensions/lib/PEXlib/pl_startup.c:1.1.1.1	Sat Mar 12 00:42:00 1994
--- mit/extensions/lib/PEXlib/pl_startup.c	Sat Mar 12 00:42:00 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/extensions/lib/PEXlib/pl_startup.c,v 2.0 1993/06/13 06:57:57 dawes Exp $ */
  /* $XConsortium: pl_startup.c,v 1.9 92/08/26 13:06:22 mor Exp $ */
  
  /******************************************************************************
***************
*** 27,33 ****
  
  #include "PEXlib.h"
  #include "PEXlibint.h"
! #include "pl_global_def.h"
  #include <stdio.h>
  
  
--- 28,34 ----
  
  #include "PEXlib.h"
  #include "PEXlibint.h"
! #include "pl_glbl_def.h"
  #include <stdio.h>
  
  
diff -c mit/extensions/lib/xinput/Imakefile:1.1.1.1 mit/extensions/lib/xinput/Imakefile:1.3
*** mit/extensions/lib/xinput/Imakefile:1.1.1.1	Sat Mar 12 00:42:04 1994
--- mit/extensions/lib/xinput/Imakefile	Sat Mar 12 00:42:04 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/extensions/lib/xinput/Imakefile,v 1.3 1993/03/27 08:56:59 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.11 91/07/24 15:38:57 rws Exp $
  #define DoNormalLib NormalLibXinput
  #define DoSharedLib SharedLibXinput
***************
*** 17,23 ****
   DEFINES = -DMALLOC_0_RETURNS_NULL
  #endif
  INCLUDES = -I$(TOP) -I$(INCLUDESRC) -I$(XLIBSRC) -I../../include
! SRCS = XAllowDv.c \
  		  XChgDCtl.c \
  		  XChgFCtl.c \
  		  XChgKbd.c \
--- 18,25 ----
   DEFINES = -DMALLOC_0_RETURNS_NULL
  #endif
  INCLUDES = -I$(TOP) -I$(INCLUDESRC) -I$(XLIBSRC) -I../../include
! SRCS = globals.c \
! 		  XAllowDv.c \
  		  XChgDCtl.c \
  		  XChgFCtl.c \
  		  XChgKbd.c \
***************
*** 54,60 ****
  		  XUngrDvB.c \
  		  XUngrDvK.c \
  		  XExtInt.c 
! OBJS = XAllowDv.o \
  		  XChgDCtl.o \
  		  XChgFCtl.o \
  		  XChgKbd.o \
--- 56,63 ----
  		  XUngrDvB.c \
  		  XUngrDvK.c \
  		  XExtInt.c 
! OBJS = globals.o \
! 		  XAllowDv.o \
  		  XChgDCtl.o \
  		  XChgFCtl.o \
  		  XChgKbd.o \
***************
*** 95,100 ****
--- 98,107 ----
         LINTLIBS = $(LINTXLIB) $(LINTXEXT)
  
  LibraryObjectRule()
+ 
+ #if defined(i386SVR3Architecture)
+ SpecialLibObjectRule(globals.o,$(ICONFIGFILES),-D_libXi_import)
+ #endif
  
  #if DoSharedLib
  #if DoNormalLib
diff -c mit/extensions/lib/xinput/XExtInt.c:1.1.1.1 mit/extensions/lib/xinput/XExtInt.c:1.3
*** mit/extensions/lib/xinput/XExtInt.c:1.1.1.1	Sat Mar 12 00:42:04 1994
--- mit/extensions/lib/xinput/XExtInt.c	Sat Mar 12 00:42:04 1994
***************
*** 24,29 ****
--- 24,31 ----
  
  ********************************************************/
  
+ /* $XFree86: mit/extensions/lib/xinput/XExtInt.c,v 1.3 1993/03/27 08:57:01 dawes Exp $ */
+ 
  /***********************************************************************
   *
   * Input Extension library internal functions.
***************
*** 85,90 ****
--- 87,93 ----
   *
   */
  
+ #ifndef SVR3SHLIB
  XExtensionVersion versions[] = {{XI_Absent,0,0},
  	{XI_Present, XI_Initial_Release_Major, XI_Initial_Release_Minor},
  	{XI_Present, XI_Add_XDeviceBell_Major, XI_Add_XDeviceBell_Minor},
***************
*** 92,97 ****
--- 95,103 ----
  	 XI_Add_XSetDeviceValuators_Minor},
  	{XI_Present, XI_Add_XChangeDeviceControl_Major, 
  	 XI_Add_XChangeDeviceControl_Minor}};
+ #else
+ extern XExtensionVersion versions[];  /* for SVR3 shared lib in globals.c */
+ #endif
  
  /***********************************************************************
   *
diff -c /dev/null mit/extensions/lib/xinput/globals.c:1.2
*** /dev/null	Sat Mar 12 00:42:05 1994
--- mit/extensions/lib/xinput/globals.c	Sat Mar 12 00:42:05 1994
***************
*** 0 ****
--- 1,61 ----
+ /* libXi : libXi.c
+  * exported data
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/extensions/lib/xinput/globals.c,v 1.2 1993/03/27 08:57:03 dawes Exp $
+  */
+ 
+ #include "XI.h"         /* outside the guards to get a dependence */
+ 
+ #ifdef SVR3SHLIB
+ 
+ /***********************************************************************
+  *
+  * Input extension versions.
+  *
+  */
+ 
+ XExtensionVersion versions[] = {{XI_Absent,0,0},
+         {XI_Present, XI_Initial_Release_Major, XI_Initial_Release_Minor},
+         {XI_Present, XI_Add_XDeviceBell_Major, XI_Add_XDeviceBell_Minor},
+         {XI_Present, XI_Add_XSetDeviceValuators_Major,
+          XI_Add_XSetDeviceValuators_Minor},
+         {XI_Present, XI_Add_XChangeDeviceControl_Major, 
+          XI_Add_XChangeDeviceControl_Minor}};
+ 
+ /***********************************************************************
+  */
+ 
+ #define VoidInit(var) void *var = 0
+ 
+ VoidInit(_libXi_free);
+ VoidInit(_libXi_malloc);
+ VoidInit(_libXi_printf);
+ VoidInit(_libXi_sprintf);
+ 
+ 
+ #ifndef __GNUC__
+ /*
+  * If we are working with floating point aritmetic, stock AT&T cc generates
+  * an unresolved reference to __fltused. But we want to make a shared lib from
+  * this here and don't want to reference /lib/libc_s.a, just define this sym as
+  * (shared lib) static.
+  * The trick is that while building the shared lib all references to this
+  * symbol are resolved internally. But the symbol will be outside only visible
+  * as a static one, so preventing a name conflict with other shared libs.
+  */
+ long __fltused = 0;
+ #endif
+ 
+ /* A dummy function for free branchtab-slots.
+  * This would be a great place for an error-check mechanism for shared libs.
+  * (Print error message if not existent function is called.)
+  */
+ extern void _libXi_dummy() {};
+ 
+ #endif
+ 
+ 
diff -c /dev/null mit/extensions/lib/xinput/import.h:1.3
*** /dev/null	Sat Mar 12 00:42:05 1994
--- mit/extensions/lib/xinput/import.h	Sat Mar 12 00:42:05 1994
***************
*** 0 ****
--- 1,59 ----
+ /* libXi : import.h
+  * indirection defines
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/extensions/lib/xinput/import.h,v 1.3 1993/05/04 14:57:56 dawes Exp $
+  */
+ 
+ #ifndef _libXi_import
+ #define _libXi_import
+ #if defined(SVR3SHLIB) && !defined(SVR3SHDAT)
+ 
+ /* prevent name conflict with member free of XFontSetMethods */
+ #define free(ptr) (*_libXi_free)(ptr)
+ #define malloc  (*_libXi_malloc)
+ #define printf  (*_libXi_printf)
+ #define sprintf  (*_libXi_sprintf)
+ 
+ 
+ /* Imported functions declarations
+  * Why declaring some imported functions here?
+  * This should be done gracefully through including of the systems
+  * header files. Unfortunatly there are some source files don't
+  * include all headers they should include, there are also some functions
+  * nowhere declared in the systems headers and some are declared
+  * without extern and cause problems since the names are redefined
+  * and these declarations then become undesired false pointer definitions.
+  */
+ 
+ /* This section needs editing! It's only an example for the X libs. */
+ 
+ #ifdef __STDC__
+ #ifndef SCO
+ extern int printf(char const *, ...);
+ extern int sprintf(char *, char const *, ...);
+ #endif
+ #else
+ #ifndef SCO
+ extern int printf();
+ extern int sprintf();
+ #endif
+ #endif
+ 
+ /* use char * also for __STDC__, the sources want it */ 
+ extern char *malloc();
+ 
+ /* Functions with ambiguous names */
+ 
+ #ifdef __STDC__
+ extern void free(void *);
+ #else
+ extern void (*_libXi_free)();
+ #endif
+ 
+ #endif
+ #endif
+ 
diff -c /dev/null mit/extensions/lib/xinput/libXi.def:1.3
*** /dev/null	Sat Mar 12 00:42:06 1994
--- mit/extensions/lib/xinput/libXi.def	Sat Mar 12 00:42:06 1994
***************
*** 0 ****
--- 1,151 ----
+ /* libXi : libXi.def
+  * shared library description file
+  * Template created by mkshtmpl.sh 1.4
+  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
+  * (thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de)
+  * Conception derived partially from work of Thomas Roell
+  *
+  * $XFree86: mit/extensions/lib/xinput/libXi.def,v 1.3 1993/03/27 08:57:05 dawes Exp $
+  */
+ 
+ /**/#address .text 0xB3800000
+ /**/#address .data 0xB3C00000
+ 
+ 
+ /**/#objects noload
+ ../../../lib/X/libX11_s.a
+ ../libXext_s.a
+ 
+ /**/#branch
+ CheckExtInit 1
+ XAllowDeviceEvents 2
+ XChangeDeviceControl 3
+ XChangeDeviceDontPropagateList 4
+ XChangeDeviceKeyMapping 5
+ XChangeFeedbackControl 6
+ XChangeKeyboardDevice 7
+ XChangePointerDevice 8
+ XCloseDevice 9
+ XDeviceBell 10
+ XFreeDeviceControl 11
+ XFreeDeviceList 12
+ XFreeDeviceMotionEvents 13
+ XFreeDeviceState 14
+ XFreeFeedbackList 15
+ XGetDeviceButtonMapping 16
+ XGetDeviceControl 17
+ XGetDeviceDontPropagateList 18
+ XGetDeviceFocus 19
+ XGetDeviceKeyMapping 20
+ XGetDeviceModifierMapping 21
+ XGetDeviceMotionEvents 22
+ XGetExtensionVersion 23
+ XGetFeedbackControl 24
+ XGetSelectedExtensionEvents 25
+ XGrabDevice 26
+ XGrabDeviceButton 27
+ XGrabDeviceKey 28
+ XInputEventToWire 29
+ XInput_find_display 30
+ XListInputDevices 31
+ XOpenDevice 32
+ XQueryDeviceState 33
+ XSelectExtensionEvent 34
+ XSendExtensionEvent 35
+ XSetDeviceButtonMapping 36
+ XSetDeviceFocus 37
+ XSetDeviceMode 38
+ XSetDeviceModifierMapping 39
+ XSetDeviceValuators 40
+ XUngrabDevice 41
+ XUngrabDeviceButton 42
+ XUngrabDeviceKey 43
+ _xibadclass 44
+ _xibaddevice 45
+ _xibadevent 46
+ _xibadmode 47
+ _xidevicebusy 48
+ 
+ _libXi_dummy 49-100
+ 
+ 
+ /**/#objects
+ DOWN/globals.o  /* All objects with global data must be come at first!*/
+ DOWN/XAllowDv.o
+ DOWN/XChgDCtl.o
+ DOWN/XChgFCtl.o
+ DOWN/XChgKMap.o
+ DOWN/XChgKbd.o
+ DOWN/XChgPnt.o
+ DOWN/XChgProp.o
+ DOWN/XCloseDev.o
+ DOWN/XDevBell.o
+ DOWN/XExtInt.o
+ DOWN/XExtToWire.o
+ DOWN/XGMotion.o
+ DOWN/XGetBMap.o
+ DOWN/XGetDCtl.o
+ DOWN/XGetFCtl.o
+ DOWN/XGetKMap.o
+ DOWN/XGetMMap.o
+ DOWN/XGetProp.o
+ DOWN/XGetVers.o
+ DOWN/XGrDvBut.o
+ DOWN/XGrDvKey.o
+ DOWN/XGrabDev.o
+ DOWN/XGtFocus.o
+ DOWN/XGtSelect.o
+ DOWN/XListDev.o
+ DOWN/XOpenDev.o
+ DOWN/XQueryDv.o
+ DOWN/XSelect.o
+ DOWN/XSetBMap.o
+ DOWN/XSetDVal.o
+ DOWN/XSetMMap.o
+ DOWN/XSetMode.o
+ DOWN/XSndExEv.o
+ DOWN/XStFocus.o
+ DOWN/XUngrDev.o
+ DOWN/XUngrDvB.o
+ DOWN/XUngrDvK.o
+ 
+ 
+ /* init section
+  */
+ 
+ /**/#init globals.o
+ _libXi_free  free
+ _libXi_malloc  malloc
+ 
+ /**/#init XExtInt.o
+ _libXi_printf  printf
+ _libXi_sprintf  sprintf
+ 
+ 
+ 
+ 
+ /**/#libraries
+ /* Here can objects be specified, which will extracted from
+  * an specified archive library and then linked to the shared
+  * library. This can avoid unwanted referencing of other
+  * shared libraries.
+  * NOTE: this objects must be listed also under #objects!
+  * e.g.:
+ /lib/libc.a memcpy.o
+  * or e.g.:
+ #ifdef __GNUC__
+ GNULIB  _fixdfsi.o
+ #endif
+  *
+  * NOT USED YET
+  *
+  */
+ 
+ /**/#externals
+ /* Here you can specify objects which will only linked to the
+  * host shared library.
+  * That are e.g. objects which contain only big data you want
+  * to seperate from the text section. (See mit/util/mksv3shlib/README.)
+  */
+ 
+ /* There must be a comment as last line */
diff -c mit/extensions/server/Imakefile:1.1.1.2 mit/extensions/server/Imakefile:1.6
*** mit/extensions/server/Imakefile:1.1.1.2	Sat Mar 12 00:42:09 1994
--- mit/extensions/server/Imakefile	Sat Mar 12 00:42:09 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/extensions/server/Imakefile,v 1.6 1993/03/27 08:57:10 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.15.1.1 92/09/09 15:32:22 rws Exp $
  #include <Server.tmpl>
  
***************
*** 29,34 ****
--- 30,37 ----
  NormalLibraryTarget(ext,$(OBJS))
  LintLibraryTarget(ext,$(SRCS))
  NormalLintTarget($(SRCS))
+ 
+ InstallLinkKitLibrary(ext,$(LINKKITDIR)/lib)
  
  DependTarget()
  
diff -c mit/extensions/server/multibuf.c:1.1.1.2 mit/extensions/server/multibuf.c:1.2
*** mit/extensions/server/multibuf.c:1.1.1.2	Sat Mar 12 00:42:09 1994
--- mit/extensions/server/multibuf.c	Sat Mar 12 00:42:09 1994
***************
*** 24,29 ****
--- 24,30 ----
  
  ********************************************************/
  
+ /* $XFree86: mit/extensions/server/multibuf.c,v 1.2 1993/03/20 02:26:02 dawes Exp $ */
  /* $XConsortium: multibuf.c,v 1.16 92/11/14 16:40:25 rws Exp $ */
  #define NEED_REPLIES
  #define NEED_EVENTS
***************
*** 44,50 ****
--- 45,55 ----
  #include "regionstr.h"
  #include "gcstruct.h"
  #include "inputstr.h"
+ #ifndef _MINIX
  #include <sys/time.h>
+ #else
+ #include <time.h>
+ #endif
  
  /*
   * per-Multibuffer data
diff -c mit/extensions/server/shm.c:1.1.1.1 mit/extensions/server/shm.c:2.1
*** mit/extensions/server/shm.c:1.1.1.1	Sat Mar 12 00:42:10 1994
--- mit/extensions/server/shm.c	Sat Mar 12 00:42:10 1994
***************
*** 17,27 ****
--- 17,29 ----
  
  /* THIS IS NOT AN X CONSORTIUM STANDARD */
  
+ /* $XFree86: mit/extensions/server/shm.c,v 2.1 1994/03/01 12:26:12 dawes Exp $ */
  /* $XConsortium: shm.c,v 1.11 91/07/12 09:54:58 rws Exp $ */
  
  #include <sys/types.h>
  #include <sys/ipc.h>
  #include <sys/shm.h>
+ #include <sys/param.h>
  #define NEED_REPLIES
  #define NEED_EVENTS
  #include "X.h"
***************
*** 50,56 ****
--- 52,60 ----
  } ShmDescRec, *ShmDescPtr;
  
  #if NeedFunctionPrototypes && !defined(ultrix)
+ #ifndef linux
  void *shmat(int, void*, int);
+ #endif
  #else
  char *shmat();
  #endif
***************
*** 103,113 ****
--- 107,157 ----
      } \
  }
  
+ #ifdef BSD
+ #include <sys/signal.h>
+ 
+ static Bool badSysCall = FALSE;
+ 
+ static void
+ SigSysHandler(signo)
+ int signo;
+ {
+     badSysCall = TRUE;
+ }
+ 
+ static Bool CheckForShmSyscall()
+ {
+     void (*oldHandler)();
+     int shmid = -1;
+ 
+     /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */
+     oldHandler = signal(SIGSYS, SigSysHandler);
+ 
+     badSysCall = FALSE;
+     shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
+     /* Clean up */
+     if (shmid != -1)
+     {
+ 	shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL);
+     }
+     signal(SIGSYS, oldHandler);
+     return(!badSysCall);
+ }
+ #endif
+     
  void
  ShmExtensionInit()
  {
      ExtensionEntry *extEntry;
      int i;
+ 
+ #ifdef BSD
+     if (!CheckForShmSyscall())
+     {
+ 	ErrorF("MIT-SHM extension disabled due to lack of kernel support\n");
+ 	return;
+     }
+ #endif
  
      sharedPixmaps = xTrue;
      pixmapFormat = shmPixFormat[0];
diff -c mit/extensions/server/xtest1dd.c:1.1.1.1 mit/extensions/server/xtest1dd.c:1.2
*** mit/extensions/server/xtest1dd.c:1.1.1.1	Sat Mar 12 00:42:11 1994
--- mit/extensions/server/xtest1dd.c	Sat Mar 12 00:42:11 1994
***************
*** 5,10 ****
--- 5,12 ----
   *	synthesis extension.
   */
  
+ /* $XFree86: mit/extensions/server/xtest1dd.c,v 1.2 1993/03/20 02:26:05 dawes Exp $ */
+ 
  /*
  
  Copyright 1986, 1987, 1988 by Hewlett-Packard Corporation
***************
*** 45,50 ****
--- 47,63 ----
  #include "dixstruct.h"
  #define  XTestSERVER_SIDE
  #include "xtestext1.h"	
+ 
+ #ifdef _MINIX
+ /* Need a few BSD compatibility definitions here: */
+ struct timezone {
+     int  tz_minuteswest;
+     int  tz_dsttime;
+ };
+ 
+ typedef unsigned char u_char;
+ typedef char *caddr_t;
+ #endif
  
  /***************************************************************
   * defines
diff -c mit/extensions/server/PEX/ddpex/mi/level1/Imakefile:1.1.1.2 mit/extensions/server/PEX/ddpex/mi/level1/Imakefile:1.2
*** mit/extensions/server/PEX/ddpex/mi/level1/Imakefile:1.1.1.2	Sat Mar 12 00:42:16 1994
--- mit/extensions/server/PEX/ddpex/mi/level1/Imakefile	Sat Mar 12 00:42:16 1994
***************
*** 1,4 ****
--- 1,5 ----
  XCOMM
+ XCOMM $XFree86: mit/extensions/server/PEX/ddpex/mi/level1/Imakefile,v 1.2 1993/04/17 13:53:47 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.4 92/11/11 12:08:42 rws Exp $
  XCOMM
  XCOMM 
***************
*** 69,74 ****
--- 70,77 ----
  NormalLibraryObjectRule()
  
  NormalLibraryTarget(ddpex1,$(OBJS))
+ 
+ InstallLinkKitLibrary(ddpex1,$(LINKKITDIR)/lib)
  
  LintLibraryTarget(dp1, $(SRCS))
  NormalLintTarget($(SRCS))
diff -c mit/extensions/server/PEX/ddpex/mi/level2/Imakefile:1.1.1.1 mit/extensions/server/PEX/ddpex/mi/level2/Imakefile:1.2
*** mit/extensions/server/PEX/ddpex/mi/level2/Imakefile:1.1.1.1	Sat Mar 12 00:42:18 1994
--- mit/extensions/server/PEX/ddpex/mi/level2/Imakefile	Sat Mar 12 00:42:18 1994
***************
*** 1,4 ****
--- 1,5 ----
  XCOMM
+ XCOMM $XFree86: mit/extensions/server/PEX/ddpex/mi/level2/Imakefile,v 1.2 1993/04/17 13:54:13 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.3 91/07/24 16:57:31 rws Exp $
  XCOMM
  XCOMM 
***************
*** 107,112 ****
--- 108,115 ----
  NormalLibraryObjectRule()
  
  NormalLibraryTarget(ddpex2,$(OBJS))
+ 
+ InstallLinkKitLibrary(ddpex2,$(LINKKITDIR)/lib)
  
  LintLibraryTarget(dp2, $(SRCS))
  NormalLintTarget($(SRCS))
diff -c mit/extensions/server/PEX/ddpex/mi/level3/Imakefile:1.1.1.2 mit/extensions/server/PEX/ddpex/mi/level3/Imakefile:1.2
*** mit/extensions/server/PEX/ddpex/mi/level3/Imakefile:1.1.1.2	Sat Mar 12 00:42:19 1994
--- mit/extensions/server/PEX/ddpex/mi/level3/Imakefile	Sat Mar 12 00:42:19 1994
***************
*** 1,4 ****
--- 1,5 ----
  XCOMM
+ XCOMM $XFree86: mit/extensions/server/PEX/ddpex/mi/level3/Imakefile,v 1.2 1993/04/17 13:54:18 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.5 92/03/04 14:11:42 hersh Exp $
  XCOMM
  XCOMM 
***************
*** 53,58 ****
--- 54,61 ----
  NormalLibraryObjectRule()
  
  NormalLibraryTarget(ddpex3,$(OBJS))
+ 
+ InstallLinkKitLibrary(ddpex3,$(LINKKITDIR)/lib)
  
  LintLibraryTarget(dp3, $(SRCS))
  NormalLintTarget($(SRCS))
diff -c mit/extensions/server/PEX/ddpex/mi/level4/Imakefile:1.1.1.1 mit/extensions/server/PEX/ddpex/mi/level4/Imakefile:1.2
*** mit/extensions/server/PEX/ddpex/mi/level4/Imakefile:1.1.1.1	Sat Mar 12 00:42:20 1994
--- mit/extensions/server/PEX/ddpex/mi/level4/Imakefile	Sat Mar 12 00:42:20 1994
***************
*** 1,4 ****
--- 1,5 ----
  XCOMM
+ XCOMM $XFree86: mit/extensions/server/PEX/ddpex/mi/level4/Imakefile,v 1.2 1993/04/17 13:54:23 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.4 91/07/24 16:58:42 rws Exp $
  XCOMM
  XCOMM 
***************
*** 69,74 ****
--- 70,77 ----
  NormalLibraryObjectRule()
  
  NormalLibraryTarget(ddpex4,$(OBJS))
+ 
+ InstallLinkKitLibrary(ddpex4,$(LINKKITDIR)/lib)
  
  LintLibraryTarget(dp4, $(SRCS))
  NormalLintTarget($(SRCS))
diff -c mit/extensions/server/PEX/ddpex/mi/shared/Imakefile:1.1.1.1 mit/extensions/server/PEX/ddpex/mi/shared/Imakefile:1.2
*** mit/extensions/server/PEX/ddpex/mi/shared/Imakefile:1.1.1.1	Sat Mar 12 00:42:22 1994
--- mit/extensions/server/PEX/ddpex/mi/shared/Imakefile	Sat Mar 12 00:42:22 1994
***************
*** 1,4 ****
--- 1,5 ----
  XCOMM
+ XCOMM $XFree86: mit/extensions/server/PEX/ddpex/mi/shared/Imakefile,v 1.2 1993/04/17 13:54:28 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.4 91/07/24 16:59:20 rws Exp $
  XCOMM
  XCOMM 
***************
*** 86,91 ****
--- 87,94 ----
  NormalLibraryObjectRule()
  
  NormalLibraryTarget(ddpexs,$(OBJS))
+ 
+ InstallLinkKitLibrary(ddpexs,$(LINKKITDIR)/lib)
  
  LintLibraryTarget(dps, $(SRCS))
  NormalLintTarget($(SRCS))
diff -c mit/extensions/server/PEX/dipex/dispatch/Imakefile:1.1.1.1 mit/extensions/server/PEX/dipex/dispatch/Imakefile:1.2
*** mit/extensions/server/PEX/dipex/dispatch/Imakefile:1.1.1.1	Sat Mar 12 00:42:24 1994
--- mit/extensions/server/PEX/dipex/dispatch/Imakefile	Sat Mar 12 00:42:24 1994
***************
*** 1,4 ****
--- 1,5 ----
  XCOMM
+ XCOMM $XFree86: mit/extensions/server/PEX/dipex/dispatch/Imakefile,v 1.2 1993/04/17 13:54:35 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.4 91/07/24 17:00:06 rws Exp $
  XCOMM
  XCOMM 
***************
*** 65,70 ****
--- 66,73 ----
  NormalLibraryTarget(didipex,$(OBJS))
  LintLibraryTarget(dsp,$(SRCS))
  NormalLintTarget($(SRCS))
+ 
+ InstallLinkKitLibrary(didipex,$(LINKKITDIR)/lib)
  
  DependTarget()
  
diff -c mit/extensions/server/PEX/dipex/objects/Imakefile:1.1.1.2 mit/extensions/server/PEX/dipex/objects/Imakefile:1.2
*** mit/extensions/server/PEX/dipex/objects/Imakefile:1.1.1.2	Sat Mar 12 00:42:25 1994
--- mit/extensions/server/PEX/dipex/objects/Imakefile	Sat Mar 12 00:42:25 1994
***************
*** 1,4 ****
--- 1,5 ----
  XCOMM
+ XCOMM $XFree86: mit/extensions/server/PEX/dipex/objects/Imakefile,v 1.2 1993/04/17 13:54:43 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.5 92/03/04 14:16:00 hersh Exp $
  XCOMM
  XCOMM 
***************
*** 57,62 ****
--- 58,65 ----
  NormalLibraryTarget(diobpex,$(OBJS))
  LintLibraryTarget(obj,$(SRCS))
  NormalLintTarget($(SRCS))
+ 
+ InstallLinkKitLibrary(diobpex,$(LINKKITDIR)/lib)
  
  #ifdef HPArchitecture
  SpecialObjectRule(hpext.o, $(IRULESRC)/$(MACROFILE), $(EXT_DEFINES))
diff -c mit/extensions/server/PEX/dipex/swap/Imakefile:1.1.1.2 mit/extensions/server/PEX/dipex/swap/Imakefile:1.2
*** mit/extensions/server/PEX/dipex/swap/Imakefile:1.1.1.2	Sat Mar 12 00:42:27 1994
--- mit/extensions/server/PEX/dipex/swap/Imakefile	Sat Mar 12 00:42:27 1994
***************
*** 1,4 ****
--- 1,5 ----
  XCOMM
+ XCOMM $XFree86: mit/extensions/server/PEX/dipex/swap/Imakefile,v 1.2 1993/04/17 13:54:49 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.8 92/03/04 14:18:33 hersh Exp $
  XCOMM
  XCOMM 
***************
*** 64,68 ****
--- 65,71 ----
  NormalLibraryTarget(diswapex,$(OBJS))
  LintLibraryTarget(dsw,$(SRCS))
  NormalLintTarget($(SRCS))
+ 
+ InstallLinkKitLibrary(diswapex,$(LINKKITDIR)/lib)
  
  DependTarget()
diff -c mit/extensions/server/PEX/ospex/Imakefile:1.1.1.1 mit/extensions/server/PEX/ospex/Imakefile:1.2
*** mit/extensions/server/PEX/ospex/Imakefile:1.1.1.1	Sat Mar 12 00:42:31 1994
--- mit/extensions/server/PEX/ospex/Imakefile	Sat Mar 12 00:42:31 1994
***************
*** 1,4 ****
--- 1,5 ----
  XCOMM
+ XCOMM $XFree86: mit/extensions/server/PEX/ospex/Imakefile,v 1.2 1993/04/17 13:54:53 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.3 91/07/24 16:50:27 rws Exp $
  XCOMM
  XCOMM 
***************
*** 70,75 ****
--- 71,78 ----
  NormalLibraryTarget(ospex,$(OBJS))
  LintLibraryTarget(osp,$(SRCS))
  NormalLintTarget($(SRCS))
+ 
+ InstallLinkKitLibrary(ospex,$(LINKKITDIR)/lib)
  
  DependTarget()
  
diff -c mit/extensions/server/PEX/ospex/osPexFont.c:1.1.1.1 mit/extensions/server/PEX/ospex/osPexFont.c:1.2
*** mit/extensions/server/PEX/ospex/osPexFont.c:1.1.1.1	Sat Mar 12 00:42:31 1994
--- mit/extensions/server/PEX/ospex/osPexFont.c	Sat Mar 12 00:42:32 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/extensions/server/PEX/ospex/osPexFont.c,v 1.2 1993/04/09 11:26:04 dawes Exp $ */
  /* $XConsortium: osPexFont.c,v 5.6 91/06/04 16:35:40 hersh Exp $ */
  
  /***********************************************************
***************
*** 91,99 ****
  	       (char *)Xalloc((unsigned long)(1+strlen(getenv("PEX_FONTPATH"))));
  	    strcpy(font_dir_path, getenv("PEX_FONTPATH"));
  	} else {
! 	    font_dir_path =
! 		(char *)Xalloc((unsigned long)(1+strlen(PEX_DEFAULT_FONTPATH)));
! 	    strcpy(font_dir_path, PEX_DEFAULT_FONTPATH);
  	}
  	already_determined = 1;
      }
--- 92,110 ----
  	       (char *)Xalloc((unsigned long)(1+strlen(getenv("PEX_FONTPATH"))));
  	    strcpy(font_dir_path, getenv("PEX_FONTPATH"));
  	} else {
! 	    char *xwinhome;
! 
! 	    if ((xwinhome = getenv("XWINHOME")) != NULL) {
! 		font_dir_path =
! 		    (char *)Xalloc((unsigned long)(strlen(xwinhome) + 1 +
! 				   strlen("/lib/X11/fonts/PEX")));
! 		sprintf(font_dir_path, "%s/lib/X11/fonts/PEX", xwinhome);
! 	    } else {
! 		font_dir_path =
! 		    (char *)Xalloc((unsigned long)(1+
! 				   strlen(PEX_DEFAULT_FONTPATH)));
! 		strcpy(font_dir_path, PEX_DEFAULT_FONTPATH);
! 	    }
  	}
  	already_determined = 1;
      }
diff -c mit/clients/Imakefile:1.1.1.1 mit/clients/Imakefile:1.2
*** mit/clients/Imakefile:1.1.1.1	Sat Mar 12 00:42:47 1994
--- mit/clients/Imakefile	Sat Mar 12 00:42:47 1994
***************
*** 1,18 ****
  XCOMM $XConsortium: Imakefile,v 1.51 91/07/16 23:07:16 gildea Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
  
  #ifndef CrayArchitecture
  RUNDIRS = xdm xhost xinit
  #endif
  
  SUBDIRS = \
  	appres bitmap editres listres oclock twm viewres \
! 	xauth xbiff xcalc xclipboard xclock xcmsdb xconsole \
  	xditview xdpyinfo xedit xfd xkill xload xlogo \
! 	xlsatoms xlsclients xlsfonts xmag xman xmh \
  	xmodmap xpr xprop xrdb xrefresh xfontsel $(RUNDIRS) \
!  	xset xsetroot xstdcmap xterm xwd xwininfo xwud
  
  MakeSubdirs($(SUBDIRS))
  DependSubdirs($(SUBDIRS))
--- 1,31 ----
+ XCOMM $XFree86: mit/clients/Imakefile,v 1.2 1993/03/20 05:34:50 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.51 91/07/16 23:07:16 gildea Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
  
+ #ifdef Amoeba
+ XLOGIN = xlogin
+ RUNDIRS = xhost
+ #else /* !Amoeba */
+ #ifdef Minix
+ RUNDIRS = xhost xinit
+ XCONSOLE = xconsole
+ #else /* !Minix */
  #ifndef CrayArchitecture
  RUNDIRS = xdm xhost xinit
  #endif
+ XCONSOLE = xconsole
+ XMH = xmh
+ #endif /* !Minix */
+ #endif /* !Amoeba */
  
  SUBDIRS = \
  	appres bitmap editres listres oclock twm viewres \
! 	xauth xbiff xcalc xclipboard xclock xcmsdb $(XCONSOLE) \
  	xditview xdpyinfo xedit xfd xkill xload xlogo \
! 	xlsatoms xlsclients xlsfonts xmag xman $(XMH) \
  	xmodmap xpr xprop xrdb xrefresh xfontsel $(RUNDIRS) \
!  	xset xsetroot xstdcmap xterm xwd xwininfo xwud $(XLOGIN)
  
  MakeSubdirs($(SUBDIRS))
  DependSubdirs($(SUBDIRS))
diff -c mit/clients/bitmap/BitEdit.c:1.1.1.1 mit/clients/bitmap/BitEdit.c:1.2
*** mit/clients/bitmap/BitEdit.c:1.1.1.1	Sat Mar 12 00:42:51 1994
--- mit/clients/bitmap/BitEdit.c	Sat Mar 12 00:42:51 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/bitmap/BitEdit.c,v 1.2 1993/05/05 13:42:14 dawes Exp $
   * $XConsortium: BitEdit.c,v 1.22 91/07/22 19:57:49 keith Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 218,224 ****
  Pixmap check_mark;
  Dialog input_dialog, error_dialog, qsave_dialog;
  Time btime;
! String filename = NULL, basename = NULL, format;
  char message[80];
  
  
--- 219,225 ----
  Pixmap check_mark;
  Dialog input_dialog, error_dialog, qsave_dialog;
  Time btime;
! String filename = NULL, basenm = NULL, format;
  char message[80];
  
  
***************
*** 925,934 ****
  
  void DoBasename()
  {  
!   BWGetBasename(bitmap_widget, &basename);
    if (PopupDialog(input_dialog, "Change basename:",
! 		  basename, &basename, XtGrabExclusive) == Okay) {
!     BWChangeBasename(bitmap_widget, basename);
      FixStatus();
    }
  }
--- 926,935 ----
  
  void DoBasename()
  {  
!   BWGetBasename(bitmap_widget, &basenm);
    if (PopupDialog(input_dialog, "Change basename:",
! 		  basenm, &basenm, XtGrabExclusive) == Okay) {
!     BWChangeBasename(bitmap_widget, basenm);
      FixStatus();
    }
  }
diff -c mit/clients/bitmap/Handlers.c:1.1.1.1 mit/clients/bitmap/Handlers.c:1.2
*** mit/clients/bitmap/Handlers.c:1.1.1.1	Sat Mar 12 00:42:52 1994
--- mit/clients/bitmap/Handlers.c	Sat Mar 12 00:42:53 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/bitmap/Handlers.c,v 1.2 1993/03/21 05:22:55 dawes Exp $
   * $XConsortium: Handlers.c,v 1.10 91/07/24 15:25:01 converse Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 72,78 ****
  	    status->btime = event->xbutton.time;
  	    status->at_x = InBitmapX(BW, event->xbutton.x);
  	    status->at_y = InBitmapY(BW, event->xbutton.y);
! 	    status->success = (Boolean) status->draw;
  	    if (status->draw)
  		(*status->draw)(w,
  				status->at_x, status->at_y, status->value);
--- 73,79 ----
  	    status->btime = event->xbutton.time;
  	    status->at_x = InBitmapX(BW, event->xbutton.x);
  	    status->at_y = InBitmapY(BW, event->xbutton.y);
! 	    status->success = (status->draw != (void (*)())NULL) ;
  	    if (status->draw)
  		(*status->draw)(w,
  				status->at_x, status->at_y, status->value);
***************
*** 85,91 ****
  	    status->btime = event->xbutton.time;
  	    status->at_x = InBitmapX(BW, event->xbutton.x);
  	    status->at_y = InBitmapY(BW, event->xbutton.y);
! 	    status->success = (Boolean) status->draw;
  	    /* SUPPRESS 701 */
  	    BWTerminateRequest(w, TRUE); 
  	}
--- 86,92 ----
  	    status->btime = event->xbutton.time;
  	    status->at_x = InBitmapX(BW, event->xbutton.x);
  	    status->at_y = InBitmapY(BW, event->xbutton.y);
! 	    status->success = (status->draw != (void(*)())NULL);
  	    /* SUPPRESS 701 */
  	    BWTerminateRequest(w, TRUE); 
  	}
***************
*** 582,588 ****
  	    status->from_y = InBitmapY(BW, event->xbutton.y);
  	    status->to_x = InBitmapX(BW, event->xbutton.x);
  	    status->to_y = InBitmapY(BW, event->xbutton.y);
! 	    status->success = (Boolean) status->draw;
  	    if (status->draw)
  		(*status->draw)(w,
  				status->from_x, status->from_y, 
--- 583,589 ----
  	    status->from_y = InBitmapY(BW, event->xbutton.y);
  	    status->to_x = InBitmapX(BW, event->xbutton.x);
  	    status->to_y = InBitmapY(BW, event->xbutton.y);
! 	    status->success = (status->draw != (void(*)())NULL);
  	    if (status->draw)
  		(*status->draw)(w,
  				status->from_x, status->from_y, 
diff -c mit/clients/bitmap/Imakefile:1.1.1.1 mit/clients/bitmap/Imakefile:1.2
*** mit/clients/bitmap/Imakefile:1.1.1.1	Sat Mar 12 00:42:53 1994
--- mit/clients/bitmap/Imakefile	Sat Mar 12 00:42:53 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/clients/bitmap/Imakefile,v 1.2 1993/04/20 15:45:26 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.18 91/07/30 10:35:59 gildea Exp $
  INSTALLFLAGS = $(INSTINCFLAGS)
  BUTTONPICTURES = \
***************
*** 29,35 ****
--- 30,40 ----
         PROGRAMS = bitmap bmtoa atobm
  
  ComplexProgramTarget_1(bitmap,$(LOCAL_LIBRARIES),-lm)
+ #ifdef LinuxArchitecture
+ SingleProgramTarget(bmtoa,$(OBJS2),$(XMULIB) $(XLIB),NullParameter)
+ #else
  SingleProgramTarget(bmtoa,$(OBJS2),$(XMULIB),NullParameter)
+ #endif
  SingleProgramTarget(atobm,$(OBJS3),NullParameter,NullParameter)
  
  BuildIncludes($(BUTTONPICTURES),bitmaps,..)
diff -c mit/clients/bitmap/bmtoa.c:1.1.1.1 mit/clients/bitmap/bmtoa.c:1.2
*** mit/clients/bitmap/bmtoa.c:1.1.1.1	Sat Mar 12 00:42:53 1994
--- mit/clients/bitmap/bmtoa.c	Sat Mar 12 00:42:53 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * bmtoa - bitmap to ascii filter
   *
+  * $XFree86: mit/clients/bitmap/bmtoa.c,v 1.2 1993/03/20 05:36:36 dawes Exp $
   * $XConsortium: bmtoa.c,v 1.2 91/02/18 15:05:44 dave Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 24,29 ****
--- 25,31 ----
  
  #include <X11/Xmu/Drawing.h>
  
+ extern char *mktemp();
  extern char *malloc();
  
  char *ProgramName;
diff -c mit/clients/twm/Imakefile:1.1.1.1 mit/clients/twm/Imakefile:2.1
*** mit/clients/twm/Imakefile:1.1.1.1	Sat Mar 12 00:43:03 1994
--- mit/clients/twm/Imakefile	Sat Mar 12 00:43:03 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/clients/twm/Imakefile,v 2.1 1993/12/18 11:40:02 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.33 91/07/17 00:48:06 gildea Exp $
  XCOMM
  XCOMM Here is an Imakefile for twm.  It depends on having TWMDIR defined
***************
*** 8,14 ****
  
           YFLAGS = -d
          DEPLIBS = $(DEPXMULIB) $(DEPEXTENSIONLIB) $(DEPXLIB)
! LOCAL_LIBRARIES = $(XMULIB) $(EXTENSIONLIB) $(XLIB)
         LINTLIBS = $(LINTXMU) $(LINTEXTENSIONLIB) $(LINTXLIB)
          DEFINES = $(SIGNAL_DEFINES)
  
--- 9,15 ----
  
           YFLAGS = -d
          DEPLIBS = $(DEPXMULIB) $(DEPEXTENSIONLIB) $(DEPXLIB)
! LOCAL_LIBRARIES = $(XMULIB) $(EXTENSIONLIB) $(LEXLIB) $(XLIB)
         LINTLIBS = $(LINTXMU) $(LINTEXTENSIONLIB) $(LINTXLIB)
          DEFINES = $(SIGNAL_DEFINES)
  
***************
*** 22,30 ****
  
  AllTarget(twm)
  
! SpecialObjectRule(parse.o,NullParameter,'-DSYSTEM_INIT_FILE="'$(TWMDIR)'/system.twmrc"')
  #if !HasPutenv
! SpecialObjectRule(util.o,NullParameter,-DNOPUTENV)
  #endif
  
  depend:: lex.c gram.c deftwmrc.c 
--- 23,31 ----
  
  AllTarget(twm)
  
! SpecialObjectRule(parse.o,parse.c,'-DSYSTEM_INIT_FILE="'$(TWMDIR)'/system.twmrc"')
  #if !HasPutenv
! SpecialObjectRule(util.o,util.c,-DNOPUTENV)
  #endif
  
  depend:: lex.c gram.c deftwmrc.c 
***************
*** 33,39 ****
  InstallNonExecFile(system.twmrc,$(TWMDIR))
  
  gram.h gram.c: gram.y
! 	yacc $(YFLAGS) gram.y
  	$(MV) y.tab.c gram.c
  	$(MV) y.tab.h gram.h
  
--- 34,40 ----
  InstallNonExecFile(system.twmrc,$(TWMDIR))
  
  gram.h gram.c: gram.y
! 	$(YACC) $(YFLAGS) gram.y
  	$(MV) y.tab.c gram.c
  	$(MV) y.tab.h gram.h
  
***************
*** 48,54 ****
  	echo ' */' >>$@
  	echo '' >>$@
  	echo 'char *defTwmrc[] = {' >>$@
! 	sed -e '/^#/d' -e 's/"/\\"/g' -e 's/^/    "/' -e 's/$$/",/' \
! 		system.twmrc >>$@
  	echo '    (char *) 0 };' >>$@
  
--- 49,55 ----
  	echo ' */' >>$@
  	echo '' >>$@
  	echo 'char *defTwmrc[] = {' >>$@
! 	sed -e '/^#/d' -e 's/"/\\"/g' system.twmrc \
! 		| sed -e 's/^/    "/'  |  sed -e 's/$$/",/' >>$@
  	echo '    (char *) 0 };' >>$@
  
diff -c mit/clients/twm/add_window.c:1.1.1.1 mit/clients/twm/add_window.c:1.2
*** mit/clients/twm/add_window.c:1.1.1.1	Sat Mar 12 00:43:04 1994
--- mit/clients/twm/add_window.c	Sat Mar 12 00:43:04 1994
***************
*** 28,33 ****
--- 28,34 ----
  
  /**********************************************************************
   *
+  * $XFree86: mit/clients/twm/add_window.c,v 1.2 1993/03/20 06:05:30 dawes Exp $
   * $XConsortium: add_window.c,v 1.153 91/07/10 13:17:26 dave Exp $
   *
   * Add a new window, put the titlbar and other stuff around
***************
*** 795,801 ****
      /* wait until the window is iconified and the icon window is mapped
       * before creating the icon window 
       */
!     tmp_win->icon_w = NULL;
  
      if (!tmp_win->iconmgr)
      {
--- 796,802 ----
      /* wait until the window is iconified and the icon window is mapped
       * before creating the icon window 
       */
!     tmp_win->icon_w = 0;
  
      if (!tmp_win->iconmgr)
      {
***************
*** 930,936 ****
      {
  	for (j = 0; j < MOD_SIZE; j++)
  	{
! 	    if (Scr->Mouse[i][C_WINDOW][j].func != NULL)
  	    {
  	        /* twm used to do this grab on the application main window,
                   * tmp_win->w . This was not ICCCM complient and was changed.
--- 931,937 ----
      {
  	for (j = 0; j < MOD_SIZE; j++)
  	{
! 	    if (Scr->Mouse[i][C_WINDOW][j].func != 0)
  	    {
  	        /* twm used to do this grab on the application main window,
                   * tmp_win->w . This was not ICCCM complient and was changed.
diff -c mit/clients/twm/events.c:1.1.1.1 mit/clients/twm/events.c:1.2
*** mit/clients/twm/events.c:1.1.1.1	Sat Mar 12 00:43:05 1994
--- mit/clients/twm/events.c	Sat Mar 12 00:43:06 1994
***************
*** 28,33 ****
--- 28,34 ----
  
  /***********************************************************************
   *
+  * $XFree86: mit/clients/twm/events.c,v 1.2 1993/03/20 06:05:33 dawes Exp $
   * $XConsortium: events.c,v 1.182 91/07/17 13:59:14 dave Exp $
   *
   * twm event handling
***************
*** 130,137 ****
      int i;
  
  
!     ResizeWindow = NULL;
!     DragWindow = NULL;
      enter_flag = FALSE;
      enter_win = raise_win = NULL;
  
--- 131,138 ----
      int i;
  
  
!     ResizeWindow = 0;
!     DragWindow = 0;
      enter_flag = FALSE;
      enter_win = raise_win = NULL;
  
***************
*** 949,955 ****
  	    SortIconManager(Tmp_win->list->iconmgr);
      }
  
!     if (Tmp_win->icon_w == NULL)
  	return;
  
      if (Tmp_win->icon_not_ours)
--- 950,956 ----
  	    SortIconManager(Tmp_win->list->iconmgr);
      }
  
!     if (Tmp_win->icon_w == 0)
  	return;
  
      if (Tmp_win->icon_not_ours)
***************
*** 1487,1493 ****
  void
  HandleMotionNotify()
  {
!     if (ResizeWindow != NULL)
      {
  	XQueryPointer( dpy, Event.xany.window,
  	    &(Event.xmotion.root), &JunkChild,
--- 1488,1494 ----
  void
  HandleMotionNotify()
  {
!     if (ResizeWindow != 0)
      {
  	XQueryPointer( dpy, Event.xany.window,
  	    &(Event.xmotion.root), &JunkChild,
***************
*** 1602,1617 ****
  			 ? Tmp_win : NULL);
  	}
  
! 	DragWindow = NULL;
  	ConstMove = FALSE;
      }
  
!     if (ResizeWindow != NULL)
      {
  	EndResize();
      }
  
!     if (ActiveMenu != NULL && RootFunction == NULL)
      {
  	if (ActiveItem != NULL)
  	{
--- 1603,1618 ----
  			 ? Tmp_win : NULL);
  	}
  
! 	DragWindow = 0;
  	ConstMove = FALSE;
      }
  
!     if (ResizeWindow != 0)
      {
  	EndResize();
      }
  
!     if (ActiveMenu != NULL && RootFunction == 0)
      {
  	if (ActiveItem != NULL)
  	{
***************
*** 1640,1646 ****
  	    /* if we are not executing a defered command, then take down the
  	     * menu
  	     */
! 	    if (RootFunction == NULL)
  	    {
  		PopDownMenu();
  	    }
--- 1641,1647 ----
  	    /* if we are not executing a defered command, then take down the
  	     * menu
  	     */
! 	    if (RootFunction == 0)
  	    {
  		PopDownMenu();
  	    }
***************
*** 1659,1670 ****
  	case Button5: mask &= ~Button5Mask; break;
      }
  
!     if (RootFunction != NULL ||
  	ResizeWindow != None ||
  	DragWindow != None)
  	ButtonPressed = -1;
  
!     if (RootFunction == NULL &&
  	(Event.xbutton.state & mask) == 0 &&
  	DragWindow == None &&
  	ResizeWindow == None)
--- 1660,1671 ----
  	case Button5: mask &= ~Button5Mask; break;
      }
  
!     if (RootFunction != 0 ||
  	ResizeWindow != None ||
  	DragWindow != None)
  	ButtonPressed = -1;
  
!     if (RootFunction == 0 &&
  	(Event.xbutton.state & mask) == 0 &&
  	DragWindow == None &&
  	ResizeWindow == None)
***************
*** 1807,1813 ****
  	Context = C_ROOT;
      if (Tmp_win)
      {
! 	if (Tmp_win->list && RootFunction != NULL &&
  	    (Event.xany.window == Tmp_win->list->w ||
  		Event.xany.window == Tmp_win->list->icon))
  	{
--- 1808,1814 ----
  	Context = C_ROOT;
      if (Tmp_win)
      {
! 	if (Tmp_win->list && RootFunction != 0 &&
  	    (Event.xany.window == Tmp_win->list->w ||
  		Event.xany.window == Tmp_win->list->icon))
  	{
***************
*** 1867,1873 ****
      /* this section of code checks to see if we were in the middle of
       * a command executed from a menu
       */
!     if (RootFunction != NULL)
      {
  	if (Event.xany.window == Scr->Root)
  	{
--- 1868,1874 ----
      /* this section of code checks to see if we were in the middle of
       * a command executed from a menu
       */
!     if (RootFunction != 0)
      {
  	if (Event.xany.window == Scr->Root)
  	{
***************
*** 1884,1890 ****
  		(XFindContext(dpy, Event.xany.window, TwmContext,
  			      (caddr_t *)&Tmp_win) == XCNOENT))
  	    {
! 		RootFunction = NULL;
  		XBell(dpy, 0);
  		return;
  	    }
--- 1885,1891 ----
  		(XFindContext(dpy, Event.xany.window, TwmContext,
  			      (caddr_t *)&Tmp_win) == XCNOENT))
  	    {
! 		RootFunction = 0;
  		XBell(dpy, 0);
  		return;
  	    }
***************
*** 1904,1910 ****
  	  ExecuteFunction(RootFunction, Action, Event.xany.window,
  			  Tmp_win, &Event, Context, FALSE);
  
! 	RootFunction = NULL;
  	return;
      }
  
--- 1905,1911 ----
  	  ExecuteFunction(RootFunction, Action, Event.xany.window,
  			  Tmp_win, &Event, Context, FALSE);
  
! 	RootFunction = 0;
  	return;
      }
  
***************
*** 1919,1931 ****
      if (Context == C_NO_CONTEXT)
  	return;
  
!     RootFunction = NULL;
      if (Scr->Mouse[Event.xbutton.button][Context][modifier].func == F_MENU)
      {
  	do_menu (Scr->Mouse[Event.xbutton.button][Context][modifier].menu,
  		 (Window) None);
      }
!     else if (Scr->Mouse[Event.xbutton.button][Context][modifier].func != NULL)
      {
  	Action = Scr->Mouse[Event.xbutton.button][Context][modifier].item ?
  	    Scr->Mouse[Event.xbutton.button][Context][modifier].item->action : NULL;
--- 1920,1932 ----
      if (Context == C_NO_CONTEXT)
  	return;
  
!     RootFunction = 0;
      if (Scr->Mouse[Event.xbutton.button][Context][modifier].func == F_MENU)
      {
  	do_menu (Scr->Mouse[Event.xbutton.button][Context][modifier].menu,
  		 (Window) None);
      }
!     else if (Scr->Mouse[Event.xbutton.button][Context][modifier].func != 0)
      {
  	Action = Scr->Mouse[Event.xbutton.button][Context][modifier].item ?
  	    Scr->Mouse[Event.xbutton.button][Context][modifier].item->action : NULL;
***************
*** 1932,1938 ****
  	ExecuteFunction(Scr->Mouse[Event.xbutton.button][Context][modifier].func,
  	    Action, Event.xany.window, Tmp_win, &Event, Context, FALSE);
      }
!     else if (Scr->DefaultFunction.func != NULL)
      {
  	if (Scr->DefaultFunction.func == F_MENU)
  	{
--- 1933,1939 ----
  	ExecuteFunction(Scr->Mouse[Event.xbutton.button][Context][modifier].func,
  	    Action, Event.xany.window, Tmp_win, &Event, Context, FALSE);
      }
!     else if (Scr->DefaultFunction.func != 0)
      {
  	if (Scr->DefaultFunction.func == F_MENU)
  	{
***************
*** 2140,2146 ****
      if (XFindContext (dpy, ewp->window, MenuContext, (caddr_t *)&mr) != XCSUCCESS) return;
  
      mr->entered = TRUE;
!     if (ActiveMenu && mr == ActiveMenu->prev && RootFunction == NULL) {
  	if (Scr->Shadow) XUnmapWindow (dpy, ActiveMenu->shadow);
  	XUnmapWindow (dpy, ActiveMenu->w);
  	ActiveMenu->mapped = UNMAPPED;
--- 2141,2147 ----
      if (XFindContext (dpy, ewp->window, MenuContext, (caddr_t *)&mr) != XCSUCCESS) return;
  
      mr->entered = TRUE;
!     if (ActiveMenu && mr == ActiveMenu->prev && RootFunction == 0) {
  	if (Scr->Shadow) XUnmapWindow (dpy, ActiveMenu->shadow);
  	XUnmapWindow (dpy, ActiveMenu->w);
  	ActiveMenu->mapped = UNMAPPED;
diff -c mit/clients/twm/lex.l:1.1.1.1 mit/clients/twm/lex.l:2.0
*** mit/clients/twm/lex.l:1.1.1.1	Sat Mar 12 00:43:06 1994
--- mit/clients/twm/lex.l	Sat Mar 12 00:43:07 1994
***************
*** 28,33 ****
--- 28,34 ----
  
  /***********************************************************************
   *
+  * $XFree86: mit/clients/twm/lex.l,v 2.0 1994/02/10 21:20:40 dawes Exp $
   * $XConsortium: lex.l,v 1.62 89/12/10 17:46:33 jim Exp $
   *
   * .twmrc lex file
***************
*** 37,42 ****
--- 38,44 ----
   ***********************************************************************/
  
  /* #include <stdio.h> */		/* lex already includes stdio.h */
+ #include <X11/Xos.h>
  #include "gram.h"
  #include "parse.h"
  extern char *ProgramName;
***************
*** 43,48 ****
--- 45,69 ----
  
  extern int ParseError;
  
+ #if (BSD >= 199103) || defined(linux) || ((defined(AMOEBA) || defined(_MINIX)) && defined(yywrap))
+ #undef YY_INPUT
+ #define YY_INPUT(buf,result,size) ((result) = doinput((buf),(size)))
+ doinput (buf, size)
+ char *buf;
+ {
+ 	int c;
+ 
+ 	if (size == 0)
+ 		return (0);
+ 
+ 	if ((c = (*twmInputFunc)()) <= 0)
+ 		return (0);
+ 
+ 	buf[0] = c;
+ 	return (1);
+ }
+ #endif
+ 
  %}
  
  string				\"([^"]|\\.)*\"
***************
*** 82,94 ****
  .				{
  				  twmrc_error_prefix();
  				  fprintf (stderr, 
! 					   "ignoring character \"%s\"\n",
! 					   yytext);
  				  ParseError = 1;
  				}
  %%
  yywrap() { return(1);}
  
  #undef unput
  #undef input
  #undef output
--- 103,119 ----
  .				{
  				  twmrc_error_prefix();
  				  fprintf (stderr, 
! 					   "ignoring character \"%s\" %o\n",
! 					   yytext, yytext[0]);
  				  ParseError = 1;
  				}
  %%
+ #ifndef yywrap
  yywrap() { return(1);}
+ #endif
+ int yylineno;
  
+ #if !(BSD >= 199103) && !defined(linux)
  #undef unput
  #undef input
  #undef output
***************
*** 97,99 ****
--- 122,125 ----
  #define input()		(*twmInputFunc)()
  #define output(c)	TwmOutput(c)
  #define feof()		(1)
+ #endif
diff -c mit/clients/twm/menus.c:1.1.1.1 mit/clients/twm/menus.c:1.2
*** mit/clients/twm/menus.c:1.1.1.1	Sat Mar 12 00:43:08 1994
--- mit/clients/twm/menus.c	Sat Mar 12 00:43:09 1994
***************
*** 28,33 ****
--- 28,34 ----
  
  /***********************************************************************
   *
+  * $XFree86: mit/clients/twm/menus.c,v 1.2 1993/03/20 06:05:40 dawes Exp $
   * $XConsortium: menus.c,v 1.186 91/07/17 13:58:00 dave Exp $
   *
   * twm menu code
***************
*** 54,60 ****
  
  extern XEvent Event;
  
! int RootFunction = NULL;
  MenuRoot *ActiveMenu = NULL;		/* the active menu */
  MenuItem *ActiveItem = NULL;		/* the active menu item */
  int MoveFunction;			/* either F_MOVE or F_FORCEMOVE */
--- 55,61 ----
  
  extern XEvent Event;
  
! int RootFunction = 0;
  MenuRoot *ActiveMenu = NULL;		/* the active menu */
  MenuItem *ActiveItem = NULL;		/* the active menu item */
  int MoveFunction;			/* either F_MOVE or F_FORCEMOVE */
***************
*** 113,124 ****
  	for (j = 0; j < NUM_CONTEXTS; j++)
  	    for (k = 0; k < MOD_SIZE; k++)
  	    {
! 		Scr->Mouse[i][j][k].func = NULL;
  		Scr->Mouse[i][j][k].item = NULL;
  	    }
  
!     Scr->DefaultFunction.func = NULL;
!     Scr->WindowFunction.func = NULL;
  
      if (FirstScreen)
      {
--- 114,125 ----
  	for (j = 0; j < NUM_CONTEXTS; j++)
  	    for (k = 0; k < MOD_SIZE; k++)
  	    {
! 		Scr->Mouse[i][j][k].func = 0;
  		Scr->Mouse[i][j][k].item = NULL;
  	    }
  
!     Scr->DefaultFunction.func = 0;
!     Scr->WindowFunction.func = 0;
  
      if (FirstScreen)
      {
***************
*** 1341,1347 ****
      Bool fromtitlebar = False;
      extern int ConstrainedMoveTime;
  
!     RootFunction = NULL;
      if (Cancel)
  	return TRUE;			/* XXX should this be FALSE? */
  
--- 1342,1348 ----
      Bool fromtitlebar = False;
      extern int ConstrainedMoveTime;
  
!     RootFunction = 0;
      if (Cancel)
  	return TRUE;			/* XXX should this be FALSE? */
  
***************
*** 1387,1392 ****
--- 1388,1400 ----
  	XSync (dpy, 0);
  	Reborder (eventp->xbutton.time);
  	XSync (dpy, 0);
+ #ifdef AMOEBA
+ 	/* For some reason the following statement is only needed in the Amoeba
+ 	 * version of twm.  It might be a timing problem, or maybe it has
+ 	 * something to do with different execvp() semantics.
+ 	 */
+     	XCloseDisplay(dpy);
+ #endif
  	execvp(*Argv, Argv);
  	fprintf (stderr, "%s:  unable to restart:  %s\n", ProgramName, *Argv);
  	break;
***************
*** 1465,1471 ****
  
      case F_POPUP:
  	tmp_win = (TwmWindow *)action;
! 	if (Scr->WindowFunction.func != NULL)
  	{
  	   ExecuteFunction(Scr->WindowFunction.func,
  			   Scr->WindowFunction.item->action,
--- 1473,1479 ----
  
      case F_POPUP:
  	tmp_win = (TwmWindow *)action;
! 	if (Scr->WindowFunction.func != 0)
  	{
  	   ExecuteFunction(Scr->WindowFunction.func,
  			   Scr->WindowFunction.item->action,
***************
*** 2427,2433 ****
      {
  	if (tmp_win->icon_on)
  	    Zoom(tmp_win->icon_w, tmp_win->frame);
! 	else if (tmp_win->group != NULL)
  	{
  	    for (t = Scr->TwmRoot.next; t != NULL; t = t->next)
  	    {
--- 2435,2441 ----
      {
  	if (tmp_win->icon_on)
  	    Zoom(tmp_win->icon_w, tmp_win->frame);
! 	else if (tmp_win->group != 0)
  	{
  	    for (t = Scr->TwmRoot.next; t != NULL; t = t->next)
  	    {
***************
*** 2507,2513 ****
      iconify = ((!tmp_win->iconify_by_unmapping) || tmp_win->transient);
      if (iconify)
      {
! 	if (tmp_win->icon_w == NULL)
  	    CreateIconWindow(tmp_win, def_x, def_y);
  	else
  	    IconUp(tmp_win);
--- 2515,2521 ----
      iconify = ((!tmp_win->iconify_by_unmapping) || tmp_win->transient);
      if (iconify)
      {
! 	if (tmp_win->icon_w == 0)
  	    CreateIconWindow(tmp_win, def_x, def_y);
  	else
  	    IconUp(tmp_win);
diff -c mit/clients/twm/parse.c:1.1.1.1 mit/clients/twm/parse.c:1.2
*** mit/clients/twm/parse.c:1.1.1.1	Sat Mar 12 00:43:10 1994
--- mit/clients/twm/parse.c	Sat Mar 12 00:43:10 1994
***************
*** 28,33 ****
--- 28,34 ----
  
  /***********************************************************************
   *
+  * $XFree86: mit/clients/twm/parse.c,v 1.2 1993/04/09 11:24:24 dawes Exp $
   * $XConsortium: parse.c,v 1.52 91/07/12 09:59:37 dave Exp $
   *
   * parse the .twmrc file
***************
*** 47,52 ****
--- 48,64 ----
  #include "parse.h"
  #include <X11/Xatom.h> 
  
+ #ifndef PATH_MAX
+ #include <sys/param.h>
+ #ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+ #define PATH_MAX MAXPATHLEN
+ #else
+ #define PATH_MAX 1024
+ #endif
+ #endif
+ #endif
+ 
  #ifndef SYSTEM_INIT_FILE
  #define SYSTEM_INIT_FILE "/usr/lib/X11/twm/system.twmrc"
  #endif
***************
*** 117,122 ****
--- 129,136 ----
      int homelen = 0;
      char *cp = NULL;
      char tmpfilename[257];
+     char *xwinhome = NULL;
+     char sysfilepath[PATH_MAX];
  
      /*
       * If filename given, try it, else try ~/.twmrc.# then ~/.twmrc.  Then
***************
*** 148,154 ****
  	    break;
  
  	  case 3:			/* system.twmrc */
! 	    cp = SYSTEM_INIT_FILE;
  	    break;
  	}
  
--- 162,174 ----
  	    break;
  
  	  case 3:			/* system.twmrc */
! 	    if ((xwinhome = getenv("XWINHOME")) == NULL) {
! 		cp = SYSTEM_INIT_FILE;
! 	    }
! 	    else {
! 		sprintf(sysfilepath, "%s/lib/X11/twm/system.twmrc", xwinhome);
! 		cp = sysfilepath;
! 	    }
  	    break;
  	}
  
diff -c mit/clients/twm/twm.c:1.1.1.1 mit/clients/twm/twm.c:1.2
*** mit/clients/twm/twm.c:1.1.1.1	Sat Mar 12 00:43:11 1994
--- mit/clients/twm/twm.c	Sat Mar 12 00:43:11 1994
***************
*** 28,33 ****
--- 28,34 ----
  
  /***********************************************************************
   *
+  * $XFree86: mit/clients/twm/twm.c,v 1.2 1993/03/20 06:05:43 dawes Exp $
   * $XConsortium: twm.c,v 1.124 91/05/08 11:01:54 dave Exp $
   *
   * twm - "Tom's Window Manager"
***************
*** 191,196 ****
--- 192,199 ----
  	exit (1);
      }
  
+ #ifndef AMOEBA
+ #ifndef _MINIX
      if (fcntl(ConnectionNumber(dpy), F_SETFD, 1) == -1) {
  	fprintf (stderr, 
  		 "%s:  unable to mark display connection as close-on-exec\n",
***************
*** 197,202 ****
--- 200,220 ----
  		 ProgramName);
  	exit (1);
      }
+ #else /* _MINIX */
+     {
+ 	int fd, r;
+ 
+ 	fd = ConnectionNumber(dpy);
+ 	r = fcntl(fd, F_GETFD, 0);
+ 	if ((r == -1) || (fcntl(fd, F_SETFD, r | FD_CLOEXEC) == -1)) {
+ 	    fprintf (stderr,
+ 		    "%s: unable to mark display connection as close-on-exec\n",
+ 		    ProgramName);
+             exit (1);
+ 	}
+     }
+ #endif /* _MINIX */
+ #endif
  
      HasShape = XShapeQueryExtension (dpy, &ShapeEventBase, &ShapeErrorBase);
      TwmContext = XUniqueContext();
diff -c mit/clients/xauth/Imakefile:1.1.1.1 mit/clients/xauth/Imakefile:1.2
*** mit/clients/xauth/Imakefile:1.1.1.1	Sat Mar 12 00:43:14 1994
--- mit/clients/xauth/Imakefile	Sat Mar 12 00:43:14 1994
***************
*** 1,6 ****
--- 1,11 ----
+ XCOMM $XFree86: mit/clients/xauth/Imakefile,v 1.2 1993/04/20 15:45:38 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.14 91/07/16 23:06:17 gildea Exp $
  DEPLIBS = $(DEPXAUTHLIB) $(DEPXMULIB)
+ #ifdef LinuxArchitecture
+ LOCAL_LIBRARIES = $(XAUTHLIB) $(XMULIB) $(XLIB)
+ #else
  LOCAL_LIBRARIES = $(XAUTHLIB) $(XMULIB)
+ #endif
             SRCS = xauth.c gethost.c process.c parsedpy.c
             OBJS = xauth.o gethost.o process.o parsedpy.o
          DEFINES = ConnectionFlags $(SIGNAL_DEFINES)
diff -c mit/clients/xauth/gethost.c:1.1.1.1 mit/clients/xauth/gethost.c:1.3
*** mit/clients/xauth/gethost.c:1.1.1.1	Sat Mar 12 00:43:14 1994
--- mit/clients/xauth/gethost.c	Sat Mar 12 00:43:14 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/xauth/gethost.c,v 1.3 1993/05/05 13:42:28 dawes Exp $
   * $XConsortium: gethost.c,v 1.14 91/07/26 19:54:39 keith Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 38,43 ****
--- 39,45 ----
  #include <sys/types.h>
  #define __TYPES__
  #endif
+ #if !defined(AMOEBA) && !defined(_MINIX)
  #ifndef STREAMSCONN
  #include <sys/socket.h>
  #include <netdb.h>
***************
*** 50,55 ****
--- 52,70 ----
  #endif /* !SVR4 */
  #endif /* SYSV386 */
  #endif /* !STREAMSCONN */
+ #else /* AMOEBA || _MINIX */
+ #ifdef AMOEBA
+ #include <server/ip/types.h>
+ #include <server/ip/gen/socket.h>
+ #include <server/ip/gen/netdb.h>
+ #include <server/ip/gen/in.h>
+ #endif /* AMOEBA */
+ #ifdef _MINIX
+ #include <net/gen/in.h>
+ #include <net/gen/netdb.h>
+ #include <net/gen/socket.h>
+ #endif /* _MINIX */
+ #endif /* AMOEBA || _MINIX */
  #include <errno.h>
  extern int errno;			/* for stupid errno.h files */
  #ifdef DNETCONN
***************
*** 87,94 ****
--- 102,111 ----
  char *get_hostname (auth)
      Xauth *auth;
  {
+ #if defined(TCPCONN) || defined(AMTCPCONN)
      struct hostent *hp = NULL;
      char *inet_ntoa();
+ #endif
  #ifdef DNETCONN
      struct nodeent *np;
      static char nodeaddr[16];
***************
*** 96,102 ****
  
      if (auth->address_length == 0)
  	return "Illegal Address";
! #ifdef TCPCONN
      if (auth->family == FamilyInternet) {
  	/* gethostbyaddr can take a LONG time if the host does not exist.
  	   Assume that if it does not respond in NAMESERVER_TIMEOUT seconds
--- 113,119 ----
  
      if (auth->address_length == 0)
  	return "Illegal Address";
! #if defined(TCPCONN) || defined(AMTCPCONN)
      if (auth->family == FamilyInternet) {
  	/* gethostbyaddr can take a LONG time if the host does not exist.
  	   Assume that if it does not respond in NAMESERVER_TIMEOUT seconds
***************
*** 114,120 ****
--- 131,141 ----
  	if (hp)
  	  return (hp->h_name);
  	else
+ #if !defined(AMOEBA) && !defined(_MINIX)
  	  return (inet_ntoa(*((struct in_addr *)(auth->address))));
+ #else
+ 	  return (inet_ntoa(*((ipaddr_t *)(auth->address))));
+ #endif
      }
  #endif
  #ifdef DNETCONN
***************
*** 132,138 ****
      return (NULL);
  }
  
! #ifdef TCPCONN
  /*
   * cribbed from lib/X/XConnDis.c
   */
--- 153,159 ----
      return (NULL);
  }
  
! #if defined(TCPCONN) || defined(AMTCPCONN)
  /*
   * cribbed from lib/X/XConnDis.c
   */
***************
*** 142,148 ****
--- 163,171 ----
  {
      unsigned long hostinetaddr = inet_addr (name);
      struct hostent *host_ptr;
+ #if defined(TCPCONN) && !defined(_MINIX)
      struct sockaddr_in inaddr;		/* dummy variable for size calcs */
+ #endif
  
      if (hostinetaddr == -1) {		/* oh, gross.... */
  	if ((host_ptr = gethostbyname (name)) == NULL) {
***************
*** 153,164 ****
--- 176,197 ----
  	/* Check the address type for an internet host. */
  	if (host_ptr->h_addrtype != AF_INET) {
  	    /* Not an Internet host! */
+ #ifdef EPROTOTYPE
  	    errno = EPROTOTYPE;
+ #else
+ 	    errno = EINVAL;
+ #endif
  	    return False;
  	}
   
+ #if !defined(AMOEBA) && !defined(_MINIX)
  	bcopy((char *)host_ptr->h_addr, (char *)&hostinetaddr,
  	      sizeof(inaddr.sin_addr));
+ #else
+ 	bcopy((char *)host_ptr->h_addr, (char *)&hostinetaddr,
+ 	      sizeof(ipaddr_t));
+ #endif
+ 
      }
      *resultp = hostinetaddr;
      return True;
***************
*** 195,202 ****
      char *retval = NULL;
      int len = 0;
      char *src = NULL;
! #ifdef TCPCONN
      unsigned long hostinetaddr;
      struct sockaddr_in inaddr;		/* dummy variable for size calcs */
  #endif
  #ifdef DNETCONN
--- 228,237 ----
      char *retval = NULL;
      int len = 0;
      char *src = NULL;
! #if defined(TCPCONN) || defined(AMTCPCONN)
      unsigned long hostinetaddr;
+ #endif
+ #if defined(TCPCONN) && !defined(_MINIX)
      struct sockaddr_in inaddr;		/* dummy variable for size calcs */
  #endif
  #ifdef DNETCONN
***************
*** 227,233 ****
  	}
  	break;
        case FamilyInternet:		/* host:0 */
! #ifdef TCPCONN
  	if (!get_inet_address (host, &hostinetaddr)) return NULL;
  	src = (char *) &hostinetaddr;
  	len = 4; /* sizeof inaddr.sin_addr, would fail on Cray */
--- 262,268 ----
  	}
  	break;
        case FamilyInternet:		/* host:0 */
! #if defined(TCPCONN) || defined(AMTCPCONN)
  	if (!get_inet_address (host, &hostinetaddr)) return NULL;
  	src = (char *) &hostinetaddr;
  	len = 4; /* sizeof inaddr.sin_addr, would fail on Cray */
diff -c mit/clients/xauth/parsedpy.c:1.1.1.1 mit/clients/xauth/parsedpy.c:2.0
*** mit/clients/xauth/parsedpy.c:1.1.1.1	Sat Mar 12 00:43:15 1994
--- mit/clients/xauth/parsedpy.c	Sat Mar 12 00:43:15 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/xauth/parsedpy.c,v 2.0 1993/08/04 03:47:02 dawes Exp $
   * $XConsortium: parsedpy.c,v 1.7 89/12/10 17:00:56 rws Exp $
   *
   * parse_displayname - utility routine for splitting up display name strings
***************
*** 35,41 ****
  #include <X11/Xauth.h>			/* for FamilyLocal */
  #include <X11/Xmu/SysUtil.h>
  
! #ifdef UNIXCONN
  #define UNIX_CONNECTION "unix"
  #define UNIX_CONNECTION_LENGTH 4
  #endif
--- 36,42 ----
  #include <X11/Xauth.h>			/* for FamilyLocal */
  #include <X11/Xmu/SysUtil.h>
  
! #if defined(UNIXCONN) || defined(CLIENTS_LOCALCONN)
  #define UNIX_CONNECTION "unix"
  #define UNIX_CONNECTION_LENGTH 4
  #endif
***************
*** 72,78 ****
      return (buf[0] ? buf : NULL);
  }
  
! #ifndef UNIXCONN
  static char *copyhostname ()
  {
      char buf[256];
--- 73,79 ----
      return (buf[0] ? buf : NULL);
  }
  
! #if !defined(UNIXCONN) && !defined(CLIENTS_LOCALCONN)
  static char *copyhostname ()
  {
      char buf[256];
***************
*** 119,125 ****
  
      len = (ptr - displayname);	/* length of host name */
      if (len == 0) {			/* choose most efficient path */
! #ifdef UNIXCONN
  	host = copystring (UNIX_CONNECTION, UNIX_CONNECTION_LENGTH);
  	family = FamilyLocal;
  #else
--- 120,126 ----
  
      len = (ptr - displayname);	/* length of host name */
      if (len == 0) {			/* choose most efficient path */
! #if defined(UNIXCONN) || defined(CLIENTS_LOCALCONN)
  	host = copystring (UNIX_CONNECTION, UNIX_CONNECTION_LENGTH);
  	family = FamilyLocal;
  #else
***************
*** 136,142 ****
  	if (dnet) {
  	    family = dnet;
  	} else {
! #ifdef UNIXCONN
  	    if (host && strcmp (host, UNIX_CONNECTION) == 0)
  	      family = FamilyLocal;
  	    else
--- 137,143 ----
  	if (dnet) {
  	    family = dnet;
  	} else {
! #if defined(UNIXCONN) || defined(CLIENTS_LOCALCONN)
  	    if (host && strcmp (host, UNIX_CONNECTION) == 0)
  	      family = FamilyLocal;
  	    else
diff -c mit/clients/xcalc/math.c:1.1.1.1 mit/clients/xcalc/math.c:2.1
*** mit/clients/xcalc/math.c:1.1.1.1	Sat Mar 12 00:43:17 1994
--- mit/clients/xcalc/math.c	Sat Mar 12 00:43:17 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xcalc/math.c,v 2.1 1993/09/28 12:07:28 dawes Exp $ */
  /* $XConsortium: math.c,v 1.17 91/07/25 17:51:34 rws Exp $ 
   *
   *  math.c  -  mathematics functions for a hand calculator under X
***************
*** 219,225 ****
    int sig,code;
    sigcontextstructp scp;
  {
! #ifdef SYSV
      signal(SIGFPE,(signal_t (*)())fperr);
  #endif
      SignalKind = sig;
--- 220,226 ----
    int sig,code;
    sigcontextstructp scp;
  {
! #if defined(SYSV) || defined(SVR4) || defined(linux)
      signal(SIGFPE,(signal_t (*)())fperr);
  #endif
      SignalKind = sig;
diff -c mit/clients/xconsole/xconsole.c:1.1.1.1 mit/clients/xconsole/xconsole.c:2.1
*** mit/clients/xconsole/xconsole.c:1.1.1.1	Sat Mar 12 00:43:22 1994
--- mit/clients/xconsole/xconsole.c	Sat Mar 12 00:43:22 1994
***************
*** 1,5 ****
--- 1,7 ----
  /*
+  * $XFree86: mit/clients/xconsole/xconsole.c,v 2.1 1993/12/10 14:25:10 dawes Exp $
   * $XConsortium: xconsole.c,v 1.9 91/07/25 14:23:46 rws Exp $
+  *   Versiun 1.9.1 - changes for /dev/osm and SVR4 - dwex@mtgzfs3.att.com
   *
   * Copyright 1990 Massachusetts Institute of Technology
   *
***************
*** 46,56 ****
--- 48,66 ----
  #include <stdio.h>
  #include <ctype.h>
  
+ #if !defined(SEEK_END) && defined(L_XTND)
+ #define SEEK_END L_XTND
+ #endif
+ 
  /* Fix ISC brain damage.  When using gcc fdopen isn't declared in <stdio.h>. */
  #if defined(SYSV) && defined(SYSV386) && defined(__STDC__) && defined(ISC)
  extern FILE *fdopen(int, char const *);
  #endif
  
+ #if defined(SVR4) && defined(__STDC__) && (__STDC__ > 0)
+ extern FILE *fdopen(int, char const *);
+ #endif
+ 
  static long	TextLength ();
  
  static Widget	top, text;
***************
*** 75,87 ****
--- 85,103 ----
      Boolean daemon;
      Boolean verbose;
      Boolean exitOnFail;
+     Boolean tail;
  } app_resources;
  
  #define Offset(field) XtOffsetOf(struct _app_resources, field)
  
  static XtResource  resources[] = {
+ #ifdef SCO
      {"file",	"File",	    XtRString,	sizeof (char *),
+ 	Offset (file),	XtRString,  "/usr/adm/messages" },
+ #else
+     {"file",	"File",	    XtRString,	sizeof (char *),
  	Offset (file),	XtRString,  "console" },
+ #endif
      {"notify",	"Notify",   XtRBoolean,	sizeof (Boolean),
  	Offset (notify), XtRImmediate, (XtPointer)True },
      {"stripNonprint",	"StripNonprint",    XtRBoolean, sizeof (Boolean),
***************
*** 92,97 ****
--- 108,120 ----
  	Offset (verbose),XtRImmediate, (XtPointer)False},
      {"exitOnFail",	"ExitOnFail",    XtRBoolean,	sizeof (Boolean),
  	Offset (exitOnFail),XtRImmediate, (XtPointer)False},
+ #ifdef SCO
+     {"tail",		"Tail",	    	XtRBoolean,	sizeof (Boolean),
+ 	Offset (tail), XtRImmediate, (XtPointer)True},
+ #else
+     {"tail",		"Tail",	    	XtRBoolean,	sizeof (Boolean),
+ 	Offset (tail), XtRImmediate, (XtPointer)False},
+ #endif
  };
  
  #undef Offset
***************
*** 103,108 ****
--- 126,132 ----
      {"-daemon",	    "*daemon",		XrmoptionNoArg,	    "TRUE"},
      {"-verbose",    "*verbose",		XrmoptionNoArg,	    "TRUE"},
      {"-exitOnFail", "*exitOnFail",	XrmoptionNoArg,	    "TRUE"},
+     {"-tail",       "*tail",		XrmoptionNoArg,	    "TRUE"},
  };
  
  #ifdef ultrix
***************
*** 117,123 ****
  #include    <sys/stropts.h>		/* for I_PUSH */
  #endif
  
! #ifdef TIOCCONS
  #define USE_PTY
  static int  tty_fd, pty_fd;
  static char ttydev[64], ptydev[64];
--- 141,151 ----
  #include    <sys/stropts.h>		/* for I_PUSH */
  #endif
  
! #if defined(TIOCCONS) || defined(SOLX86)
! #ifdef SOLX86
! #include <sys/strredir.h>
! static int SolX86cons;
! #endif
  #define USE_PTY
  static int  tty_fd, pty_fd;
  static char ttydev[64], ptydev[64];
***************
*** 124,131 ****
  #endif
  #endif
  
! #if defined(SYSV) && defined(SYSV386)
  #define USE_OSM
  #endif
  
  static void inputReady ();
--- 152,161 ----
  #endif
  #endif
  
! #if ((defined(SYSV) || defined(SVR4)) && defined(SYSV386)) && !defined(SOLX86)
  #define USE_OSM
+ #include <signal.h>
+ static int child_pid;
  #endif
  
  static void inputReady ();
***************
*** 147,153 ****
  #ifdef USE_FILE
  	    	input = fopen (FILE_NAME, "r");
  #endif
! #ifdef USE_PTY
  		int	on = 1;
  
  		if (get_pty (&pty_fd, &tty_fd, ttydev, ptydev) == 0 &&
--- 177,183 ----
  #ifdef USE_FILE
  	    	input = fopen (FILE_NAME, "r");
  #endif
! #if defined(USE_PTY) && !defined(SOLX86)
  		int	on = 1;
  
  		if (get_pty (&pty_fd, &tty_fd, ttydev, ptydev) == 0 &&
***************
*** 156,165 ****
  		    input = fdopen (pty_fd, "r");
  		}
  #endif
  	    }
  #ifdef USE_OSM
  	    /* Don't have to be owner of /dev/console when using /dev/osm. */
! 	    input = fdopen(osm_pipe(), "r");
  #endif
  	    if (input && app_resources.verbose)
  	    {
--- 186,207 ----
  		    input = fdopen (pty_fd, "r");
  		}
  #endif
+ #ifdef SOLX86
+ 		int 	on = 1;
+ 		if (get_pty(&pty_fd, &tty_fd, ttydev, ptydev) == 0)
+ 		{
+ 		    SolX86cons = open("/dev/console", O_RDONLY);
+ 		    input = fdopen(pty_fd, "r");
+ 		    ioctl(SolX86cons, SRIOCSREDIR, tty_fd);
+ 		}
+ #endif
  	    }
  #ifdef USE_OSM
  	    /* Don't have to be owner of /dev/console when using /dev/osm. */
! 	    if (!access("/dev/osm", R_OK))
! 	    {
! 	        input = fdopen(osm_pipe(), "r");
! 	    }
  #endif
  	    if (input && app_resources.verbose)
  	    {
***************
*** 173,178 ****
--- 215,222 ----
  	else
  	{
  	    input = fopen (app_resources.file, "r");
+ 	    if (app_resources.tail && input)
+ 	        fseek(input, 0L, SEEK_END);
  	}
  	if (!input)
  	{
***************
*** 203,209 ****
--- 247,256 ----
      }
  #ifdef USE_PTY
      close (tty_fd);
+ #ifdef SOLX86
+     close (SolX86cons);
  #endif
+ #endif
  }
  
  /*ARGSUSED*/
***************
*** 214,223 ****
      String *params;
      Cardinal *num_params;
  {
      exit (0);
  }
  
! extern char *malloc ();
  
  static void
  Notify ()
--- 261,290 ----
      String *params;
      Cardinal *num_params;
  {
+ #ifdef USE_OSM
+     kill (child_pid, SIGTERM);
+ #endif
+     exit (0);
+ }
+ 
+ #ifdef USE_OSM
+ static void
+ Killer(sig)
+ int sig;
+ {
+     kill (child_pid, SIGTERM);
      exit (0);
  }
  
! static int 
! MyIOErrorHandler(disp)
! Display *disp;
! {
!     Killer(0);
! }
! #endif
! 
! extern char *malloc (), *realloc ();
  
  static void
  Notify ()
***************
*** 341,346 ****
--- 408,425 ----
      n = read (*source, buffer, sizeof (buffer) - 1);
      if (n <= 0)
      {
+ 	if (app_resources.tail)
+ 	{
+ /*
+  *		make this tail option usable otherwise events just aren't processed
+  *		often enough, resizes etc take forever.
+  */
+     	Display* d = XtDisplay(w);
+ 		if (XPending(d))
+ 			return;
+ 		sleep(1);
+ 		return;
+ 	}
  	fclose (input);
  	XtRemoveInput (*id);
      }
***************
*** 523,528 ****
--- 602,610 ----
  		       ConvertSelection, LoseSelection, NULL);
  	OpenConsole ();
      }
+ #ifdef USE_OSM
+     (void) XSetIOErrorHandler(MyIOErrorHandler);
+ #endif
      XtMainLoop ();
      return 0;
  }
***************
*** 703,709 ****
   */
  osm_pipe()
  {
!   int tty, pid;
    char ttydev[64];
      
    if ((tty = open("/dev/ptmx", O_RDWR)) < 0)  return -1;
--- 785,791 ----
   */
  osm_pipe()
  {
!   int tty;
    char ttydev[64];
      
    if ((tty = open("/dev/ptmx", O_RDWR)) < 0)  return -1;
***************
*** 712,725 ****
    unlockpt(tty);
    strcpy(ttydev, (char *)ptsname(tty));
  
!   if ((pid = fork()) == 0) {
      int pty, osm, buf, nbytes;
  
      pty = open(ttydev, O_RDWR);
!     osm = open("/dev/osm", O_RDWR);
      while ((nbytes = read(osm, &buf, sizeof(buf))) >= 0)
        write(pty, &buf, nbytes);
    }
    return tty;
  }
  #endif  /* USE_OSM */
--- 794,821 ----
    unlockpt(tty);
    strcpy(ttydev, (char *)ptsname(tty));
  
!   if ((child_pid = fork()) == 0) {
      int pty, osm, buf, nbytes;
+     char *dummy = malloc(50);
  
+     buf = 0;
+     if ((osm = open("/dev/osm1", O_RDONLY)) != -1) {
+       while ((nbytes = read(osm, dummy, 50)) > 0)
+ 	buf += nbytes;
+       dummy = realloc(dummy, buf);
+     }
      pty = open(ttydev, O_RDWR);
!     osm = open("/dev/osm", O_RDONLY);
!     if (buf)
!       read(osm, dummy, buf);
!     free(dummy);
      while ((nbytes = read(osm, &buf, sizeof(buf))) >= 0)
        write(pty, &buf, nbytes);
    }
+   signal(SIGHUP, Killer);
+   signal(SIGINT, Killer);
+   signal(SIGTERM, Killer);
+ 
    return tty;
  }
  #endif  /* USE_OSM */
diff -c mit/clients/xconsole/xconsole.man:1.1.1.1 mit/clients/xconsole/xconsole.man:1.4
*** mit/clients/xconsole/xconsole.man:1.1.1.1	Sat Mar 12 00:43:22 1994
--- mit/clients/xconsole/xconsole.man	Sat Mar 12 00:43:22 1994
***************
*** 4,10 ****
  .SH SYNOPSIS
  .ta 8n
  \fBxconsole\fP	[-\fItoolkitoption\fP ...] [-file \fIfile-name\fP]
! [-notify] [-stripNonprint] [-daemon] [-verbose] [-exitOnFail]
  .SH DESCRIPTION
  The
  .I xconsole 
--- 4,10 ----
  .SH SYNOPSIS
  .ta 8n
  \fBxconsole\fP	[-\fItoolkitoption\fP ...] [-file \fIfile-name\fP]
! [-notify] [-stripNonprint] [-daemon] [-verbose] [-exitOnFail] [-tail]
  .SH DESCRIPTION
  The
  .I xconsole 
***************
*** 17,22 ****
--- 17,29 ----
  .B \-file \fIfile-name\fP
  To monitor some other device, use this option to specify the device name.
  This does not work on regular files as they are always ready to be read from.
+ .TP 8
+ .B \-tail
+ This option makes
+ .I xconsole
+ work on a regular file.  Only data appended to the file after
+ .I xconsole
+ starts is displayed.
  .TP 8
  .B \-notify \-nonotify
  When new data are received from the console and the notify option is set,
diff -c mit/clients/xditview/draw.c:1.1.1.1 mit/clients/xditview/draw.c:2.0
*** mit/clients/xditview/draw.c:1.1.1.1	Sat Mar 12 00:43:25 1994
--- mit/clients/xditview/draw.c	Sat Mar 12 00:43:25 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/xditview/draw.c,v 2.0 1993/08/01 05:51:38 dawes Exp $
   * $XConsortium: draw.c,v 1.7 91/08/26 11:02:36 gildea Exp $
   *
   * Copyright 1991 Massachusetts Institute of Technology
***************
*** 44,51 ****
  #include <math.h>
  #include "DviP.h"
  
! #if defined(ISC) && defined(SYSV) && defined(SYSV386) && __STDC__
! extern double atof(char *);
  #endif
  
  #ifndef M_PI
--- 45,56 ----
  #include <math.h>
  #include "DviP.h"
  
! #if defined(ISC) && defined(__STDC__)
! #ifdef ISC30
! extern double atof(const char *);
! #else
! extern double atof();
! #endif
  #endif
  
  #ifndef M_PI
diff -c mit/clients/xditview/lex.c:1.1.1.1 mit/clients/xditview/lex.c:1.2
*** mit/clients/xditview/lex.c:1.1.1.1	Sat Mar 12 00:43:25 1994
--- mit/clients/xditview/lex.c	Sat Mar 12 00:43:25 1994
***************
*** 1,3 ****
--- 1,5 ----
+ /* $XFree86: mit/clients/xditview/lex.c,v 1.2 1993/03/21 05:47:56 dawes Exp $ */
+ 
  #include <X11/Xos.h>
  #include <X11/IntrinsicP.h>
  #include <X11/StringDefs.h>
***************
*** 41,47 ****
  	if (c == '\n')
  		DviUngetC(dw, c);
  	if (p)	
! 		*p = NULL;
  	return (Buffer);
  } 
  
--- 43,49 ----
  	if (c == '\n')
  		DviUngetC(dw, c);
  	if (p)	
! 		*p = 0;
  	return (Buffer);
  } 
  
***************
*** 65,71 ****
  	if (c != EOF)
  		DviUngetC(dw, c);
  	if (p)
! 		*p = NULL;
  	return (Buffer);
  } 
  
--- 67,73 ----
  	if (c != EOF)
  		DviUngetC(dw, c);
  	if (p)
! 		*p = 0;
  	return (Buffer);
  } 
  
diff -c mit/clients/xditview/xditview.c:1.1.1.1 mit/clients/xditview/xditview.c:1.2
*** mit/clients/xditview/xditview.c:1.1.1.1	Sat Mar 12 00:43:26 1994
--- mit/clients/xditview/xditview.c	Sat Mar 12 00:43:26 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xditview/xditview.c,v 1.2 1993/03/21 05:47:58 dawes Exp $ */
  /* $XConsortium: xditview.c,v 1.30 91/07/30 14:10:37 keith Exp $ */
  /*
   * Copyright 1991 Massachusetts Institute of Technology
***************
*** 586,593 ****
  char	*def;
  {
      static Arg dialogArgs[] = {
! 	{XtNlabel, NULL},
! 	{XtNvalue, NULL},
      };
      Arg valueArgs[1];
      Arg centerArgs[2];
--- 587,594 ----
  char	*def;
  {
      static Arg dialogArgs[] = {
! 	{XtNlabel, (XtArgVal)NULL},
! 	{XtNvalue, (XtArgVal)NULL},
      };
      Arg valueArgs[1];
      Arg centerArgs[2];
diff -c mit/clients/xdm/Imakefile:1.1.1.2 mit/clients/xdm/Imakefile:2.4
*** mit/clients/xdm/Imakefile:1.1.1.2	Sat Mar 12 00:43:29 1994
--- mit/clients/xdm/Imakefile	Sat Mar 12 00:43:29 1994
***************
*** 1,8 ****
  XCOMM $XConsortium: Imakefile,v 1.58.1.1 92/12/17 20:08:19 gildea Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
  
! #define BuildChooser !SystemV
  
  #if HasXdmAuth
  XDMAUTH_DEFINES = -DHASXDMAUTH
--- 1,9 ----
+ XCOMM $XFree86: mit/clients/xdm/Imakefile,v 2.4 1993/09/13 15:31:05 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.58.1.1 92/12/17 20:08:19 gildea Exp $
  #define IHaveSubdirs
  #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
  
! #define BuildChooser !SystemV || defined(i386SVR3Architecture)
  
  #if HasXdmAuth
  XDMAUTH_DEFINES = -DHASXDMAUTH
***************
*** 18,29 ****
--- 19,39 ----
  #endif
  
  #if SystemV4 || HasShadowPasswd
+ #if defined(LinuxArchitecture)
+ PWD_DEFINES = -DUSESHADOW -DSHADOW_PWD
+ SYS_LIBRARIES = -lshadow
+ #else
  PWD_DEFINES = -DUSESHADOW
+ #endif
  #if SystemV
  SYS_LIBRARIES = -lsec
  #endif
  #endif
  
+ #if defined(XFree86Version) && HasLibCrypt
+ SYS_LIBRARIES = -lcrypt
+ #endif
+ 
  #if (defined(AIXArchitecture) && (OSMajorVersion >= 3))
  SYS_LIBRARIES = -ls
  #endif
***************
*** 94,99 ****
--- 104,111 ----
  ComplexProgramTarget_1(xdm,$(LOCAL_LIBRARIES),$(SYSLIBS))
  SingleProgramTarget(xdmshell,$(OBJS2),NullParameter,NullParameter)
  SingleProgramTarget(sessreg,$(OBJS4),NullParameter,NullParameter)
+ InstallProgram(sessreg,$(BINDIR))
+ InstallManPage(sessreg,$(MANDIR))
  #if BuildChooser
  NormalProgramTarget(chooser,$(OBJS3),$(DEPLIBS3),$(LIBS3),NullParameter)
  SaberProgramTarget(chooser,$(SRCS3),$(OBJS3),$(LIBS3),NullParameter)
***************
*** 101,107 ****
  InstallAppDefaults(Chooser)
  #endif
  
! SpecialObjectRule(resource.o, $(ICONFIGFILES), $(RES_DEFINES))
  
  XCOMM these files depend on HASXDMAUTH
  auth.o policy.o: $(ICONFIGFILES)
--- 113,119 ----
  InstallAppDefaults(Chooser)
  #endif
  
! SpecialObjectRule(resource.o, resource.c $(ICONFIGFILES), $(RES_DEFINES))
  
  XCOMM these files depend on HASXDMAUTH
  auth.o policy.o: $(ICONFIGFILES)
diff -c mit/clients/xdm/auth.c:1.1.1.1 mit/clients/xdm/auth.c:2.6
*** mit/clients/xdm/auth.c:1.1.1.1	Sat Mar 12 00:43:31 1994
--- mit/clients/xdm/auth.c	Sat Mar 12 00:43:32 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xdm - display manager daemon
   *
+  * $XFree86: mit/clients/xdm/auth.c,v 2.6 1993/09/24 17:05:56 dawes Exp $
   * $XConsortium: auth.c,v 1.47 91/11/08 15:18:18 eswu Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 24,37 ****
   * maintain the authorization generation daemon
   */
  
  #include "dm.h"
  #include <X11/X.h>
! #include <sys/types.h>
  #include <sys/stat.h>
! #include <sys/socket.h>
! #ifndef ESIX
  # include <sys/ioctl.h>
- #endif /* !ESIX */
  
  #ifdef TCPCONN
  # include <netinet/in.h>
--- 25,47 ----
   * maintain the authorization generation daemon
   */
  
+ #if defined(TCPCONN) || defined(DNETCONN) || defined(UNIXCONN)
+ # define HASSOCKETS
+ #endif
+ 
  #include "dm.h"
  #include <X11/X.h>
! #if defined(USG) || defined(SYSV)
! # ifndef __TYPES__
! #  include <sys/types.h>
! #  define __TYPES__
! # endif
! #endif
  #include <sys/stat.h>
! #ifdef HASSOCKETS
! # include <sys/socket.h>
! #endif /* HASSOCKETS */
  # include <sys/ioctl.h>
  
  #ifdef TCPCONN
  # include <netinet/in.h>
***************
*** 41,47 ****
  # include <netdnet/dnetdb.h>
  #endif
  
! #if (defined(_POSIX_SOURCE) && !defined(AIXV3)) || defined(hpux) || defined(USG) || defined(SVR4)
  #define NEED_UTSNAME
  #include <sys/utsname.h>
  #endif
--- 51,62 ----
  # include <netdnet/dnetdb.h>
  #endif
  
! #if defined(SVR4) || defined(ISC) || defined(linux)
! #define USE_FALLBACK_DEFINESELF
! static FallbackDefineSelf();
! #endif
! 
! #if (defined(_POSIX_SOURCE) && !defined(AIXV3)) || defined(hpux) || defined(USG) || defined(SYSV) || defined(SVR4) || defined(USE_FALLBACK_DEFINESELF)
  #define NEED_UTSNAME
  #include <sys/utsname.h>
  #endif
***************
*** 49,70 ****
  #if defined(SYSV) && defined(SYSV386)
  # include <sys/stream.h>
  # ifdef ISC
  #  include <sys/sioctl.h>
  # endif /* ISC */
  # ifdef ESIX
  #  include <lan/net_ioctl.h>
  # endif /* ESIX */
  #endif /* SYSV386 */
  
  #ifdef SVR4
  # include <netdb.h>
  # include <sys/sockio.h>
  #endif
  #ifdef __convex__
  # include <sync/queue.h>
  # include <sync/sema.h>
  #endif
! #include <net/if.h>
  
  extern int	MitInitAuth ();
  extern Xauth	*MitGetAuth ();
--- 64,95 ----
  #if defined(SYSV) && defined(SYSV386)
  # include <sys/stream.h>
  # ifdef ISC
+ #  include <netdb.h>
+ #  include <sys/stropts.h>
  #  include <sys/sioctl.h>
  # endif /* ISC */
+ #if 0
  # ifdef ESIX
  #  include <lan/net_ioctl.h>
  # endif /* ESIX */
+ #endif
  #endif /* SYSV386 */
  
  #ifdef SVR4
  # include <netdb.h>
  # include <sys/sockio.h>
+ # include <stropts.h>
  #endif
  #ifdef __convex__
  # include <sync/queue.h>
  # include <sync/sema.h>
  #endif
! #ifdef linux
! # include <netdb.h>
! #endif
! #ifdef HASSOCKETS
! # include <net/if.h>
! #endif /* HASSOCKETS */
  
  extern int	MitInitAuth ();
  extern Xauth	*MitGetAuth ();
***************
*** 111,116 ****
--- 136,194 ----
  
  #define NUM_AUTHORIZATION (sizeof (AuthProtocols) / sizeof (AuthProtocols[0]))
  
+ #if defined(SVR4) || defined(ISC)
+ /* ifioctl() for SVR4 from Ian Donaldson <iand@labtam.labtam.oz.au> */
+ static int
+ ifioctl (fd, cmd, arg)
+     int fd;
+     int cmd;
+     char *arg;
+ {
+     struct strioctl ioc;
+     int ret;
+ 
+     bzero((char *) &ioc, sizeof(ioc));
+     ioc.ic_cmd = cmd;
+     ioc.ic_timout = 0;
+     if (cmd == SIOCGIFCONF)
+     {
+ 	ioc.ic_len = ((struct ifconf *) arg)->ifc_len;
+ 	ioc.ic_dp = ((struct ifconf *) arg)->ifc_buf;
+ #ifdef ISC
+ 	/* SIOCGIFCONF is somewhat brain damaged on ISC. The argument
+ 	 * buffer must contain the ifconf structure as header. Ifc_req
+ 	 * is also not a pointer but a one element array of ifreq
+ 	 * structures. On return this array is extended by enough
+ 	 * ifreq fields to hold all interfaces. The return buffer length
+ 	 * is placed in the buffer header.
+ 	 */
+         ((struct ifconf *) ioc.ic_dp)->ifc_len =
+                                          ioc.ic_len - sizeof(struct ifconf);
+ #endif
+     }
+     else
+     {
+ 	ioc.ic_len = sizeof(struct ifreq);
+ 	ioc.ic_dp = arg;
+     }
+     ret = ioctl(fd, I_STR, (char *) &ioc);
+     if (ret >= 0 && cmd == SIOCGIFCONF)
+ #ifdef SVR4
+ 	((struct ifconf *) arg)->ifc_len = ioc.ic_len;
+ #endif
+ #ifdef ISC
+     { ((struct ifconf *) arg)->ifc_len =
+ 				 ((struct ifconf *)ioc.ic_dp)->ifc_len;
+ 	((struct ifconf *) arg)->ifc_buf = 
+ 			(caddr_t)((struct ifconf *)ioc.ic_dp)->ifc_req;
+     }
+ #endif
+     return(ret);
+ }
+ #else /* SVR4 || ISC */
+ #define ifioctl ioctl
+ #endif /* SVR4 || ISC */
+ 
  static struct AuthProtocol *
  findProtocol (name_length, name)
      unsigned short  name_length;
***************
*** 643,650 ****
  }
  
  #else /* STREAMSCONN */
! #ifdef SIOCGIFCONF
  
  /* Define this host for access control.  Find all the hosts the OS knows about 
   * for this fd and add them to the selfhosts list.
   */
--- 721,734 ----
  }
  
  #else /* STREAMSCONN */
! #if defined(SIOCGIFCONF) && defined(HASSOCKETS)
  
+ #ifdef AF_LINK
+ #define ifr_size(p) ((p).sa_len > sizeof(p) ? (p).sa_len : sizeof(p))
+ #else
+ #define ifr_size(p) (sizeof(p))
+ #endif
+ 
  /* Define this host for access control.  Find all the hosts the OS knows about 
   * for this fd and add them to the selfhosts list.
   */
***************
*** 654,660 ****
      FILE	*file;
      Xauth	*auth;
  {
!     char		buf[2048];
      struct ifconf	ifc;
      register int	n;
      int 		len;
--- 738,744 ----
      FILE	*file;
      Xauth	*auth;
  {
!     char		buf[2048], *cp, *cplim;
      struct ifconf	ifc;
      register int	n;
      int 		len;
***************
*** 661,674 ****
      char 		*addr;
      int 		family;
      register struct ifreq *ifr;
!     
      ifc.ifc_len = sizeof (buf);
      ifc.ifc_buf = buf;
!     if (ioctl (fd, SIOCGIFCONF, (char *) &ifc) < 0)
          LogError ("Trouble getting network interface configuration");
!     for (ifr = ifc.ifc_req, n = ifc.ifc_len / sizeof (struct ifreq); --n >= 0;
!      ifr++)
      {
  #ifdef DNETCONN
  	/*
  	 * this is ugly but SIOCGIFCONF returns decnet addresses in
--- 745,769 ----
      char 		*addr;
      int 		family;
      register struct ifreq *ifr;
! 
      ifc.ifc_len = sizeof (buf);
      ifc.ifc_buf = buf;
!     if (ifioctl (fd, SIOCGIFCONF, (char *) &ifc) < 0)
! #ifdef USE_FALLBACK_DEFINESELF
! 	return FallbackDefineSelf();
! #else
          LogError ("Trouble getting network interface configuration");
! #endif
! #ifndef ISC
! #define IFC_IFC_REQ ifc.ifc_req
! #else
! #define IFC_IFC_REQ (struct ifreq *)ifc.ifc_buf
! #endif
!     cplim = (char *)IFC_IFC_REQ + ifc.ifc_len;
!     for (cp = (char *)IFC_IFC_REQ; cp < cplim;
! 	 cp += sizeof(ifr->ifr_name) + ifr_size(ifr->ifr_addr))
      {
+         ifr = (struct ifreq *)cp;
  #ifdef DNETCONN
  	/*
  	 * this is ugly but SIOCGIFCONF returns decnet addresses in
***************
*** 709,723 ****
      }
  }
  
! #else /* SIOCGIFCONF */
  
  /* Define this host for access control.  Find all the hosts the OS knows about 
   * for this fd and add them to the selfhosts list.
   */
  static
  DefineSelf (fd, file, auth)
      int fd;
  {
      register int n;
      int	len;
      caddr_t	addr;
--- 804,826 ----
      }
  }
  
! #endif /* SIOCGIFCONF && HASSOCKETS */
! #if !defined(SIOCGIFCONF) || !defined(HASSOCKETS) || defined(USE_FALLBACK_DEFINESELF)
  
  /* Define this host for access control.  Find all the hosts the OS knows about 
   * for this fd and add them to the selfhosts list.
   */
  static
+ #ifdef USE_FALLBACK_DEFINESELF
+ FallbackDefineSelf (fd, file, auth)
+ #else
  DefineSelf (fd, file, auth)
+ #endif
      int fd;
  {
+ #ifndef HASSOCKETS
+     return -1;
+ #else
      register int n;
      int	len;
      caddr_t	addr;
***************
*** 751,759 ****
  			(char *) (&inetaddr->sin_addr), file, auth);
  	}
      }
  }
  
! #endif /* SIOCGIFCONF else */
  #endif /* STREAMSCONN else */
  
  static
--- 854,863 ----
  			(char *) (&inetaddr->sin_addr), file, auth);
  	}
      }
+ #endif /* HASSOCKETS */
  }
  
! #endif /* !SIOCGIFCONF || !HASSOCKETS || USE_FALLBACK_DEFINESELF */
  #endif /* STREAMSCONN else */
  
  static
diff -c mit/clients/xdm/choose.c:1.1.1.1 mit/clients/xdm/choose.c:1.7
*** mit/clients/xdm/choose.c:1.1.1.1	Sat Mar 12 00:43:32 1994
--- mit/clients/xdm/choose.c	Sat Mar 12 00:43:32 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xdm/choose.c,v 1.7 1993/05/04 14:56:39 dawes Exp $ */
  /*
   * $XConsortium: choose.c,v 1.9 91/08/25 10:48:43 keith Exp $
   *
***************
*** 37,43 ****
  # include	<sys/types.h>
  # include	<sys/socket.h>
  # include	<netinet/in.h>
! # include	<sys/un.h>
  # include	<ctype.h>
  
  static
--- 38,46 ----
  # include	<sys/types.h>
  # include	<sys/socket.h>
  # include	<netinet/in.h>
! # if !defined(ISC) && !defined(SCO)
! #  include	<sys/un.h>
! # endif
  # include	<ctype.h>
  
  static
***************
*** 340,346 ****
  
      Debug ("Process chooser socket\n");
      len = sizeof (buf);
!     client_fd = accept (fd, buf, &len);
      if (client_fd == -1)
      {
  	LogError ("Cannot accept chooser connection\n");
--- 343,349 ----
  
      Debug ("Process chooser socket\n");
      len = sizeof (buf);
!     client_fd = accept (fd, (struct sockaddr *)buf, &len);
      if (client_fd == -1)
      {
  	LogError ("Cannot accept chooser connection\n");
diff -c mit/clients/xdm/chooser.c:1.1.1.1 mit/clients/xdm/chooser.c:2.5
*** mit/clients/xdm/chooser.c:1.1.1.1	Sat Mar 12 00:43:34 1994
--- mit/clients/xdm/chooser.c	Sat Mar 12 00:43:34 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/xdm/chooser.c,v 2.5 1994/02/10 21:21:03 dawes Exp $
   * $XConsortium: chooser.c,v 1.10 91/08/25 10:49:47 keith Exp $
   *
   * Copyright 1990 Massachusetts Institute of Technology
***************
*** 67,73 ****
--- 68,82 ----
  
  #ifdef SVR4
  #include    <sys/sockio.h>
+ #include    <stropts.h>
  #endif
+ #if defined(SYSV) && defined(SYSV386)
+ # include    <sys/stream.h>
+ # ifdef ISC
+ #  include <sys/stropts.h>
+ #  include <sys/sioctl.h>
+ # endif /* ISC */
+ #endif
  #include    <sys/socket.h>
  #include    <netinet/in.h>
  #include    <sys/ioctl.h>
***************
*** 149,154 ****
--- 158,217 ----
  static XdmcpBuffer	directBuffer, broadcastBuffer;
  static XdmcpBuffer	buffer;
  
+ #if defined(SVR4) || defined(ISC)
+ /* ifioctl() for SVR4 from Ian Donaldson <iand@labtam.labtam.oz.au> */
+ static int
+ ifioctl (fd, cmd, arg)
+     int fd;
+     int cmd;
+     char *arg;
+ {
+     struct strioctl ioc;
+     int ret;
+ 
+     bzero((char *) &ioc, sizeof(ioc));
+     ioc.ic_cmd = cmd;
+     ioc.ic_timout = 0;
+     if (cmd == SIOCGIFCONF)
+     {
+ 	ioc.ic_len = ((struct ifconf *) arg)->ifc_len;
+ 	ioc.ic_dp = ((struct ifconf *) arg)->ifc_buf;
+     }
+     else
+     {
+ 	ioc.ic_len = sizeof(struct ifreq);
+ 	ioc.ic_dp = arg;
+ #ifdef ISC
+ 	/* SIOCGIFCONF is somewhat brain damaged on ISC. The argument
+ 	 * buffer must contain the ifconf structure as header. Ifc_req
+ 	 * is also not a pointer but a one element array of ifreq
+ 	 * structures. On return this array is extended by enough
+ 	 * ifreq fields to hold all interfaces. The return buffer length
+ 	 * is placed in the buffer header.
+ 	 */
+         ((struct ifconf *) ioc.ic_dp)->ifc_len =
+                                          ioc.ic_len - sizeof(struct ifconf);
+ #endif
+     }
+     ret = ioctl(fd, I_STR, (char *) &ioc);
+     if (ret >= 0 && cmd == SIOCGIFCONF)
+ #ifdef SVR4
+ 	((struct ifconf *) arg)->ifc_len = ioc.ic_len;
+ #endif
+ #ifdef ISC
+     {
+ 	((struct ifconf *) arg)->ifc_len =
+ 				 ((struct ifconf *)ioc.ic_dp)->ifc_len;
+ 	((struct ifconf *) arg)->ifc_buf = 
+ 			(caddr_t)((struct ifconf *)ioc.ic_dp)->ifc_req;
+     }
+ #endif
+     return(ret);
+ }
+ #else /* SVR4 || ISC */
+ #define ifioctl ioctl
+ #endif /* SVR4 || ISC */
+ 
  /* ARGSUSED */
  static void
  PingHosts (closure, id)
***************
*** 256,262 ****
  	    	    struct hostent  *hostent;
  		    char	    *host;
      	
! 	    	    hostent = gethostbyaddr (hostAddr.data, hostAddr.length, AF_INET);
  	    	    if (hostent)
  	    	    {
  			XdmcpDisposeARRAY8 (hostname);
--- 319,331 ----
  	    	    struct hostent  *hostent;
  		    char	    *host;
      	
! #if (BSD >= 199103)
! 	    	    hostent = gethostbyaddr ((const char *)hostAddr.data,
! 					     hostAddr.length, AF_INET);
! #else
! 	    	    hostent = gethostbyaddr (hostAddr.data,
! 					     hostAddr.length, AF_INET);
! #endif /* (BSD >= 199103) */
  	    	    if (hostent)
  	    	    {
  			XdmcpDisposeARRAY8 (hostname);
***************
*** 444,449 ****
--- 513,524 ----
      host->next = NULL;
  }
  
+ #ifdef AF_LINK
+ #define ifr_size(p) ((p).sa_len > sizeof(p) ? (p).sa_len : sizeof(p))
+ #else
+ #define ifr_size(p) (sizeof(p))
+ #endif
+ 
  /*
   * Register the address for this host.
   * Called with each of the names on the command line.
***************
*** 456,476 ****
  {
      struct hostent	*hostent;
      struct sockaddr_in	in_addr;
      struct ifconf	ifc;
      register struct ifreq *ifr;
      struct sockaddr	broad_addr;
!     char		buf[2048];
      int			n;
  
      if (!strcmp (name, BROADCAST_HOSTNAME))
      {
  	ifc.ifc_len = sizeof (buf);
  	ifc.ifc_buf = buf;
! 	if (ioctl (socketFD, (int) SIOCGIFCONF, (char *) &ifc) < 0)
  	    return;
! 	for (ifr = ifc.ifc_req, n = ifc.ifc_len / sizeof (struct ifreq); --n >= 0;
! 	    ifr++)
  	{
  	    if (ifr->ifr_addr.sa_family != AF_INET)
  		continue;
  
--- 531,561 ----
  {
      struct hostent	*hostent;
      struct sockaddr_in	in_addr;
+ #ifdef SIOCGIFCONF
      struct ifconf	ifc;
+ #endif
      register struct ifreq *ifr;
      struct sockaddr	broad_addr;
!     char		buf[2048], *cp, *cplim;
      int			n;
  
      if (!strcmp (name, BROADCAST_HOSTNAME))
      {
+ #ifdef SIOCGIFCONF
  	ifc.ifc_len = sizeof (buf);
  	ifc.ifc_buf = buf;
! 	if (ifioctl (socketFD, (int) SIOCGIFCONF, (char *) &ifc) < 0)
  	    return;
! #ifndef ISC
! #define IFC_IFC_REQ ifc.ifc_req
! #else
! #define IFC_IFC_REQ (struct ifreq *)ifc.ifc_buf
! #endif
! 	cplim = (char *)IFC_IFC_REQ + ifc.ifc_len;
! 	for (cp = (char *)IFC_IFC_REQ; cp < cplim;
! 	     cp += sizeof (ifr->ifr_name) + ifr_size(ifr->ifr_addr))
  	{
+ 	    ifr = (struct ifreq*)cp;
  	    if (ifr->ifr_addr.sa_family != AF_INET)
  		continue;
  
***************
*** 482,494 ****
  		struct ifreq    broad_req;
      
  		broad_req = *ifr;
! 		if (ioctl (socketFD, SIOCGIFFLAGS, (char *) &broad_req) != -1 &&
  		    (broad_req.ifr_flags & IFF_BROADCAST) &&
  		    (broad_req.ifr_flags & IFF_UP)
  		    )
  		{
  		    broad_req = *ifr;
! 		    if (ioctl (socketFD, SIOCGIFBRDADDR, &broad_req) != -1)
  			broad_addr = broad_req.ifr_addr;
  		    else
  			continue;
--- 567,580 ----
  		struct ifreq    broad_req;
      
  		broad_req = *ifr;
! 		if (ifioctl (socketFD, SIOCGIFFLAGS, (char *) &broad_req)
! 		      != -1 &&
  		    (broad_req.ifr_flags & IFF_BROADCAST) &&
  		    (broad_req.ifr_flags & IFF_UP)
  		    )
  		{
  		    broad_req = *ifr;
! 		    if (ifioctl (socketFD, SIOCGIFBRDADDR, &broad_req) != -1)
  			broad_addr = broad_req.ifr_addr;
  		    else
  			continue;
***************
*** 502,507 ****
--- 588,594 ----
  	    RegisterHostaddr ((struct sockaddr *)&in_addr, sizeof (in_addr),
  			      BROADCAST_QUERY);
  	}
+ #endif /* SIOCGIFCONF */
      }
      else
      {
diff -c mit/clients/xdm/daemon.c:1.1.1.1 mit/clients/xdm/daemon.c:1.9
*** mit/clients/xdm/daemon.c:1.1.1.1	Sat Mar 12 00:43:34 1994
--- mit/clients/xdm/daemon.c	Sat Mar 12 00:43:34 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xdm - display manager daemon
   *
+  * $XFree86: mit/clients/xdm/daemon.c,v 1.9 1993/05/05 13:43:05 dawes Exp $
   * $XConsortium: daemon.c,v 1.8 91/05/11 15:37:38 gildea Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 52,58 ****
       * Close standard file descriptors and get rid of controlling tty
       */
  
! #if defined(SYSV) || defined(SVR4)
      setpgrp ();
  #else
      setpgrp (0, getpid());
--- 53,59 ----
       * Close standard file descriptors and get rid of controlling tty
       */
  
! #if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__OSF__)
      setpgrp ();
  #else
      setpgrp (0, getpid());
***************
*** 62,68 ****
      close (1);
      close (2);
  
! #ifndef SYSV386
      if ((i = open ("/dev/tty", O_RDWR)) >= 0) {	/* did open succeed? */
  #if (defined(SYSV) || defined(SVR4)) && defined(TIOCTTY)
  	int zero = 0;
--- 63,69 ----
      close (1);
      close (2);
  
! #if !defined(SYSV386)
      if ((i = open ("/dev/tty", O_RDWR)) >= 0) {	/* did open succeed? */
  #if (defined(SYSV) || defined(SVR4)) && defined(TIOCTTY)
  	int zero = 0;
diff -c mit/clients/xdm/dm.c:1.1.1.1 mit/clients/xdm/dm.c:2.1
*** mit/clients/xdm/dm.c:1.1.1.1	Sat Mar 12 00:43:36 1994
--- mit/clients/xdm/dm.c	Sat Mar 12 00:43:36 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xdm - display manager daemon
   *
+  * $XFree86: mit/clients/xdm/dm.c,v 2.1 1994/02/19 09:23:40 dawes Exp $
   * $XConsortium: dm.c,v 1.64 91/07/31 16:55:01 keith Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 32,37 ****
--- 33,41 ----
  # include	<signal.h>
  #undef _POSIX_SOURCE
  #endif
+ #ifdef linux
+ #include <sys/file.h>
+ #endif
  
  #ifndef sigmask
  #define sigmask(m)  (1 << ((m - 1)))
***************
*** 678,684 ****
--- 682,696 ----
      if (pidFile[0] != '\0') {
  	pidFd = open (pidFile, 2);
  	if (pidFd == -1 && errno == ENOENT)
+ #if !(BSD >= 199103)
  	    pidFd = creat (pidFile, 0666);
+ #else
+ 	    { /* workaround failure of lock after creat on 386bsd */
+ 	      pidFd = creat (pidFile, 0666);
+ 	      close (pidFd);
+ 	      pidFd = open (pidFile, 2);
+ 	    }
+ #endif
  	if (pidFd == -1 || !(pidFilePtr = fdopen (pidFd, "r+")))
  	{
  	    LogError ("process-id file %s cannot be opened\n",
diff -c mit/clients/xdm/dm.h:1.1.1.1 mit/clients/xdm/dm.h:2.2
*** mit/clients/xdm/dm.h:1.1.1.1	Sat Mar 12 00:43:36 1994
--- mit/clients/xdm/dm.h	Sat Mar 12 00:43:36 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xdm - display manager daemon
   *
+  * $XFree86: mit/clients/xdm/dm.h,v 2.2 1994/02/10 21:21:07 dawes Exp $
   * $XConsortium: dm.h,v 1.51 91/09/19 16:28:35 keith Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 39,45 ****
--- 40,48 ----
  
  /* If XDMCP symbol defined, compile to run XDMCP protocol */
  
+ #if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN)
  #define XDMCP
+ #endif
  
  #ifdef XDMCP
  # include	<X11/Xdmcp.h>
***************
*** 61,66 ****
--- 64,73 ----
  #endif
  #endif
  
+ #ifdef SCO
+ #define	Jmp_buf	jmp_buf
+ #endif
+ 
  #ifdef pegasus
  #undef dirty		/* Some bozo put a macro called dirty in sys/param.h */
  #endif /* pegasus */
***************
*** 234,240 ****
  };
  
  /* setgroups is not covered by POSIX, arg type varies */
! #if defined(SYSV) || defined(SVR4)
  #define GID_T gid_t
  #else
  #define GID_T int
--- 241,247 ----
  };
  
  /* setgroups is not covered by POSIX, arg type varies */
! #if defined(SYSV) || defined(SVR4) || defined(linux) || (BSD >= 199103)
  #define GID_T gid_t
  #else
  #define GID_T int
***************
*** 316,322 ****
  #define SIGVAL void
  #endif
  
! #ifdef X_NOT_POSIX
  #ifdef SYSV
  #define SIGNALS_RESET_WHEN_CAUGHT
  #define UNRELIABLE_SIGNALS
--- 323,329 ----
  #define SIGVAL void
  #endif
  
! #if defined(X_NOT_POSIX) || (BSD >= 199103)
  #ifdef SYSV
  #define SIGNALS_RESET_WHEN_CAUGHT
  #define UNRELIABLE_SIGNALS
diff -c mit/clients/xdm/genauth.c:1.1.1.1 mit/clients/xdm/genauth.c:1.6
*** mit/clients/xdm/genauth.c:1.1.1.1	Sat Mar 12 00:43:38 1994
--- mit/clients/xdm/genauth.c	Sat Mar 12 00:43:38 1994
***************
*** 1,7 ****
--- 1,9 ----
  /*
   * xdm - display manager daemon
   *
+  * $XFree86: mit/clients/xdm/genauth.c,v 1.6 1993/03/27 07:40:31 dawes Exp $
   * $XConsortium: genauth.c,v 1.8 91/07/24 00:07:03 keith Exp $
+  * <SYSV386 /dev/mem fix - dwex@mtgzfs3.att.com>
   *
   * Copyright 1988 Massachusetts Institute of Technology
   *
***************
*** 61,66 ****
--- 63,78 ----
      fd = open (name, 0);
      if (fd < 0)
  	return 0;
+ #ifdef SYSV386
+     /*
+      * For x86 Unix, we need to stay the hell OUT of memory in the
+      * range 640k-1M.  If there are devices with shared memory out there,
+      * the reads could blow their poor little minds!  So if the file
+      * being read is /dev/mem, skip up to 1M, then start reading.
+      */
+     if (!strcmp(name, "/dev/mem"))
+ 	lseek(fd, 0x100000, SEEK_SET);
+ #endif
      reads = FILE_LIMIT;
      while ((cnt = read (fd, buf, sizeof (buf))) > 0 && --reads > 0) {
  	loops = cnt / (2 * sizeof (long));
diff -c mit/clients/xdm/greet.c:1.1.1.1 mit/clients/xdm/greet.c:1.6
*** mit/clients/xdm/greet.c:1.1.1.1	Sat Mar 12 00:43:38 1994
--- mit/clients/xdm/greet.c	Sat Mar 12 00:43:38 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xdm/greet.c,v 1.6 1993/03/27 07:40:32 dawes Exp $ */
  /*
   * xdm - display manager daemon
   *
***************
*** 166,174 ****
  	Debug ("Disabling access control\n");
  	XSetAccessControl (XtDisplay (toplevel), DisableAccess);
      }
-     XtDestroyWidget (toplevel);
      ClearCloseOnFork (ConnectionNumber (XtDisplay (toplevel)));
!     XCloseDisplay (XtDisplay (toplevel));
      Debug ("Greet connection closed\n");
  }
  
--- 167,174 ----
  	Debug ("Disabling access control\n");
  	XSetAccessControl (XtDisplay (toplevel), DisableAccess);
      }
      ClearCloseOnFork (ConnectionNumber (XtDisplay (toplevel)));
!     XtCloseDisplay (XtDisplay (toplevel));
      Debug ("Greet connection closed\n");
  }
  
diff -c mit/clients/xdm/resource.c:1.1.1.1 mit/clients/xdm/resource.c:1.5
*** mit/clients/xdm/resource.c:1.1.1.1	Sat Mar 12 00:43:41 1994
--- mit/clients/xdm/resource.c	Sat Mar 12 00:43:41 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xdm - display manager daemon
   *
+  * $XFree86: mit/clients/xdm/resource.c,v 1.5 1993/04/11 13:24:57 dawes Exp $
   * $XConsortium: resource.c,v 1.45 92/04/15 11:12:41 rws Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 26,31 ****
--- 27,43 ----
  # include <X11/Intrinsic.h>
  # include <X11/Xmu/CharSet.h>
  
+ #ifndef PATH_MAX
+ #include <sys/param.h>
+ #ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+ #define PATH_MAX MAXPATHLEN
+ #else
+ #define PATH_MAX 1024
+ #endif
+ #endif
+ #endif
+ 
  char	*config;
  
  char	*servers;
***************
*** 105,110 ****
--- 117,124 ----
  
  #define DEF_UDP_PORT	"177"	    /* registered XDMCP port, dont change */
  
+ char *defconfig = DEF_XDM_CONFIG;
+ 
  struct dmResources {
  	char	*name, *class;
  	int	type;
***************
*** 326,331 ****
--- 340,425 ----
  static int	originalArgc;
  static char	**originalArgv;
  
+ 
+ static char *
+ AllocString (str1, len2)
+ char    *str1;
+ int     len2;
+ {
+     char *s;
+ 
+     if (!(s = malloc(strlen(str1) + len2)))
+ 	LogPanic ("no space for resource realloc\n");
+     return(s);
+ }
+ 
+ 
+ /* If XWINHOME is set, adjust the default values of some resources */
+ 
+ static 
+ AdjustDefResources ()
+ {
+     char	*xwinhome = NULL;
+     char 	bindir[PATH_MAX], xdmdir[PATH_MAX];
+     int		i;
+ 
+     if (!(xwinhome = getenv("XWINHOME")))
+ 	return;
+     if (!strcmp(xwinhome, "/usr"))
+ 	strcpy(bindir, "/usr/bin/X11");
+     else
+ 	sprintf(bindir, "%s/bin", xwinhome);
+     sprintf(xdmdir, "%s/lib/X11/xdm", xwinhome);
+ 
+     defconfig = AllocString(xdmdir, sizeof("/xdm-config"));
+     sprintf(defconfig, "%s/xdm-config", xdmdir);
+ 
+     for (i = 0; i < NUM_DM_RESOURCES; i++)
+     {
+ 	if (!strcmp(DmResources[i].name, "servers"))
+ 	{
+ 	    DmResources[i].default_value =
+ 			AllocString(bindir, sizeof(":0 local /X :0"));
+ 	    sprintf(DmResources[i].default_value, ":0 local %s/X :0", bindir);
+ 	}
+ 	else if (!strcmp(DmResources[i].name, "authDir"))
+ 	{
+ 	    DmResources[i].default_value = AllocString(xdmdir, 1);
+ 	    strcpy(DmResources[i].default_value, xdmdir);
+ 	}
+     }
+ 
+     for (i = 0; i < NUM_SESSION_RESOURCES; i++)
+     {
+ 	if (!strcmp(sessionResources[i].name, "xrdb"))
+ 	{
+ 	    sessionResources[i].default_value =
+ 			AllocString(bindir, sizeof("/xrdb"));
+ 	    sprintf(sessionResources[i].default_value, "%s/xrdb", bindir);
+ 	}
+ 	else if (!strcmp(sessionResources[i].name, "session"))
+ 	{
+ 	    sessionResources[i].default_value =
+ 			AllocString(bindir, sizeof("/xterm -ls"));
+ 	    sprintf(sessionResources[i].default_value, "%s/xterm -ls", bindir);
+ 	}
+ 	else if (!strcmp(sessionResources[i].name, "failsafeClient"))
+ 	{
+ 	    sessionResources[i].default_value =
+ 			AllocString(bindir, sizeof("/xterm"));
+ 	    sprintf(sessionResources[i].default_value, "%s/xterm", bindir);
+ 	}
+ 	else if (!strcmp(sessionResources[i].name, "chooser"))
+ 	{
+ 	    sessionResources[i].default_value =
+ 			AllocString(xdmdir, sizeof("/chooser"));
+ 	    sprintf(sessionResources[i].default_value, "%s/chooser", xdmdir);
+ 	}
+     }
+ }
+ 
+ 
+ 
  InitResources (argc, argv)
  int	argc;
  char	**argv;
***************
*** 333,338 ****
--- 427,433 ----
  	XrmInitialize ();
  	originalArgc = argc;
  	originalArgv = argv;
+ 	AdjustDefResources ();
  	ReinitResources ();
  }
  
***************
*** 357,363 ****
  		     sizeof (configTable) / sizeof (configTable[0]),
  		     "DisplayManager", &argc, argv);
      GetResource ("DisplayManager.configFile", "DisplayManager.ConfigFile",
! 		 DM_STRING, &config, DEF_XDM_CONFIG);
      newDB = XrmGetFileDatabase ( config );
      if (newDB)
      {
--- 452,458 ----
  		     sizeof (configTable) / sizeof (configTable[0]),
  		     "DisplayManager", &argc, argv);
      GetResource ("DisplayManager.configFile", "DisplayManager.ConfigFile",
! 		 DM_STRING, &config, defconfig);
      newDB = XrmGetFileDatabase ( config );
      if (newDB)
      {
diff -c mit/clients/xdm/server.c:1.1.1.1 mit/clients/xdm/server.c:2.0
*** mit/clients/xdm/server.c:1.1.1.1	Sat Mar 12 00:43:42 1994
--- mit/clients/xdm/server.c	Sat Mar 12 00:43:42 1994
***************
*** 34,39 ****
--- 34,43 ----
  extern int  errno;
  static serverPause ();
  
+ #ifndef X_NO_STRERROR
+ #include <string.h>
+ #endif
+ 
  static Display	*dpy;
  
  /* ARGSUSED */
***************
*** 48,53 ****
--- 52,58 ----
      ++receivedUsr1;
  }
  
+ #ifdef X_NO_STRERROR
  static char *_SysErrorMsg (n)
      int n;
  {
***************
*** 57,62 ****
--- 62,70 ----
  
      return (s ? s : "no such error");
  }
+ #else
+ #define _SysErrorMsg(n) strerror(n)
+ #endif
  
  StartServerOnce (d)
  struct display	*d;
diff -c mit/clients/xdm/session.c:1.1.1.2 mit/clients/xdm/session.c:2.2
*** mit/clients/xdm/session.c:1.1.1.2	Sat Mar 12 00:43:43 1994
--- mit/clients/xdm/session.c	Sat Mar 12 00:43:43 1994
***************
*** 37,42 ****
--- 37,46 ----
  # include <rpc/key_prot.h>
  #endif
  
+ #ifndef X_NO_STRERROR
+ #include <string.h>
+ #endif
+ 
  extern int  errno;
  extern char **setEnv();
  
***************
*** 90,99 ****
--- 94,107 ----
  IOErrorHandler (dpy)
      Display *dpy;
  {
+ #ifdef X_NO_STRERROR
      extern char *sys_errlist[];
      extern int sys_nerr;
      char *s = ((errno >= 0 && errno < sys_nerr) ? sys_errlist[errno]
  						: "unknown error");
+ #else
+     char *s = strerror(errno);
+ #endif
  
      LogError("fatal IO error %d (%s)\n", errno, s);
      exit(RESERVER_DISPLAY);
***************
*** 405,413 ****
--- 413,428 ----
  #else /* AIXV3 */
  #ifdef NGROUPS_MAX
  	setgid (verify->groups[0]);
+ #if (BSD >= 199103)
+ 	setgroups (verify->ngroups, (const int *)verify->groups);
+ #else
  	setgroups (verify->ngroups, verify->groups);
+ #endif /* (BSD >= 199103) */
  #else
  	setgid (verify->gid);
+ #endif
+ #if (BSD >= 199103)
+ 	setlogin(name);
  #endif
  	setuid (verify->uid);
  #endif /* AIXV3 */
diff -c mit/clients/xdm/sessreg.c:1.1.1.1 mit/clients/xdm/sessreg.c:1.5
*** mit/clients/xdm/sessreg.c:1.1.1.1	Sat Mar 12 00:43:43 1994
--- mit/clients/xdm/sessreg.c	Sat Mar 12 00:43:43 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/xdm/sessreg.c,v 1.5 1993/03/27 07:40:34 dawes Exp $
   * $XConsortium: sessreg.c,v 1.8 91/07/18 22:00:12 rws Exp $
   *
   * Copyright 1990 Massachusetts Institute of Technology
***************
*** 198,204 ****
  		wtmp_file = WTMP_FILE;
  	if (!uflag)
  		utmp_file = UTMP_FILE;
! #ifndef SYSV
  	if (!tflag)
  		ttys_file = TTYS_FILE;
  	if (!sflag) {
--- 199,205 ----
  		wtmp_file = WTMP_FILE;
  	if (!uflag)
  		utmp_file = UTMP_FILE;
! #if !defined(SYSV) && !defined(linux)
  	if (!tflag)
  		ttys_file = TTYS_FILE;
  	if (!sflag) {
diff -c mit/clients/xdm/socket.c:1.1.1.1 mit/clients/xdm/socket.c:1.6
*** mit/clients/xdm/socket.c:1.1.1.1	Sat Mar 12 00:43:44 1994
--- mit/clients/xdm/socket.c	Sat Mar 12 00:43:44 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xdm/socket.c,v 1.6 1993/05/04 14:56:47 dawes Exp $ */
  /*
   * xdm - display manager daemon
   *
***************
*** 29,35 ****
--- 30,38 ----
  
  #include <sys/socket.h>
  #include <netinet/in.h>
+ #if !defined(ISC) && !defined(SCO)
  #include <sys/un.h>
+ #endif
  #include <netdb.h>
  
  extern int	xdmcpFd;
***************
*** 59,65 ****
      sock_addr.sin_family = AF_INET;
      sock_addr.sin_port = htons ((short) request_port);
      sock_addr.sin_addr.s_addr = htonl (INADDR_ANY);
!     if (bind (xdmcpFd, &sock_addr, sizeof (sock_addr)) == -1)
      {
  	LogError ("error binding socket address %d\n", request_port);
  	close (xdmcpFd);
--- 62,68 ----
      sock_addr.sin_family = AF_INET;
      sock_addr.sin_port = htons ((short) request_port);
      sock_addr.sin_addr.s_addr = htonl (INADDR_ANY);
!     if (bind (xdmcpFd, (struct sockaddr *)&sock_addr, sizeof (sock_addr)) == -1)
      {
  	LogError ("error binding socket address %d\n", request_port);
  	close (xdmcpFd);
***************
*** 90,96 ****
      int			len;
  
      len = sizeof in_addr;
!     if (getsockname (chooserFd, &in_addr, &len) < 0)
  	return -1;
      bcopy ((char *) &in_addr, addr, len);
      *lenp = len;
--- 93,99 ----
      int			len;
  
      len = sizeof in_addr;
!     if (getsockname (chooserFd, (struct sockaddr *)&in_addr, &len) < 0)
  	return -1;
      bcopy ((char *) &in_addr, addr, len);
      *lenp = len;
diff -c mit/clients/xdm/util.c:1.1.1.1 mit/clients/xdm/util.c:1.8
*** mit/clients/xdm/util.c:1.1.1.1	Sat Mar 12 00:43:45 1994
--- mit/clients/xdm/util.c	Sat Mar 12 00:43:45 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xdm - display manager daemon
   *
+  * $XFree86: mit/clients/xdm/util.c,v 1.8 1993/05/05 13:43:07 dawes Exp $
   * $XConsortium: util.c,v 1.14 92/01/21 15:38:28 gildea Exp $
   *
   * Copyright 1988 Massachusetts Institute of Technology
***************
*** 195,202 ****
  
  CleanUpChild ()
  {
! #if defined(SYSV) || defined(SVR4)
  	setpgrp ();
  #else
  	setpgrp (0, getpid ());
  	sigsetmask (0);
--- 196,205 ----
  
  CleanUpChild ()
  {
! #if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__OSF__)
! #if !defined(SYSV386) || defined(SYSV)
  	setpgrp ();
+ #endif
  #else
  	setpgrp (0, getpid ());
  	sigsetmask (0);
diff -c mit/clients/xdm/verify.c:1.1.1.1 mit/clients/xdm/verify.c:2.0
*** mit/clients/xdm/verify.c:1.1.1.1	Sat Mar 12 00:43:45 1994
--- mit/clients/xdm/verify.c	Sat Mar 12 00:43:46 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xdm/verify.c,v 2.0 1993/09/12 11:16:53 dawes Exp $ */
  /*
   * xdm - display manager daemon
   *
***************
*** 71,77 ****
--- 72,80 ----
  #ifdef USESHADOW
  	struct spwd	*sp;
  #endif
+ #if (!defined(SCO) || defined(SCO_USA)) && !defined(SHADOW_PWD)
  	char		*crypt ();
+ #endif /* (!SCO || SCO_USA) && !SHADOW_PWD */
  	char		**userEnv (), **systemEnv (), **parseArgs ();
  	char		*shell, *home;
  	char		**argv;
***************
*** 88,95 ****
--- 91,102 ----
  	}
  	endspent();
  
+ #if !defined(SCO) || defined(SCO_USA)
  	if (strcmp (crypt (greet->password, sp->sp_pwdp), sp->sp_pwdp))
  #else
+ 	if (0)
+ #endif /* !SCO || SCO_USA */
+ #else
  	if (strcmp (crypt (greet->password, p->pw_passwd), p->pw_passwd))
  #endif
  	{
***************
*** 157,162 ****
--- 164,172 ----
      env = setEnv (env, "DISPLAY", d->name);
      env = setEnv (env, "HOME", home);
      env = setEnv (env, "USER", user);
+ #if defined(SYSV) || defined(SVR4)
+     env = setEnv (env, "LOGNAME", user);
+ #endif
      env = setEnv (env, "PATH", useSystemPath ? d->systemPath : d->userPath);
      env = setEnv (env, "SHELL", shell);
      for (envvar = envvars; *envvar; envvar++)
***************
*** 178,185 ****
      env = setEnv (env, "DISPLAY", d->name);
      if (home)
  	env = setEnv (env, "HOME", home);
!     if (user)
  	env = setEnv (env, "USER", user);
      env = setEnv (env, "PATH", d->systemPath);
      env = setEnv (env, "SHELL", d->systemShell);
      if (d->authFile)
--- 188,199 ----
      env = setEnv (env, "DISPLAY", d->name);
      if (home)
  	env = setEnv (env, "HOME", home);
!     if (user) {
  	env = setEnv (env, "USER", user);
+ #if defined(SYSV) || defined(SVR4)
+         env = setEnv (env, "LOGNAME", user);
+ #endif
+     }
      env = setEnv (env, "PATH", d->systemPath);
      env = setEnv (env, "SHELL", d->systemShell);
      if (d->authFile)
diff -c mit/clients/xdm/xdmcp.c:1.1.1.1 mit/clients/xdm/xdmcp.c:1.6
*** mit/clients/xdm/xdmcp.c:1.1.1.1	Sat Mar 12 00:43:48 1994
--- mit/clients/xdm/xdmcp.c	Sat Mar 12 00:43:48 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xdm/xdmcp.c,v 1.6 1993/05/04 14:56:51 dawes Exp $ */
  /*
   * xdm - display manager daemon
   *
***************
*** 33,39 ****
--- 34,42 ----
  
  #include	<sys/socket.h>
  #include	<netinet/in.h>
+ #if !defined(ISC) && !defined(SCO)
  #include	<sys/un.h>
+ #endif
  #include	<netdb.h>
  
  #define getString(name,len)	((name = malloc (len + 1)) ? 1 : 0)
***************
*** 463,468 ****
--- 466,472 ----
  		}
  		break;
  #endif
+ #if !defined(ISC) && !defined(SCO)
  #ifdef AF_UNIX
  	    case AF_UNIX:
  		{
***************
*** 479,484 ****
--- 483,489 ----
  		}
  		break;
  #endif
+ #endif /* ISC */
  #ifdef AF_CHAOS
  	    case AF_CHAOS:
  		goto badAddress;
diff -c mit/clients/xdm/xdmshell.c:1.1.1.1 mit/clients/xdm/xdmshell.c:2.0
*** mit/clients/xdm/xdmshell.c:1.1.1.1	Sat Mar 12 00:43:48 1994
--- mit/clients/xdm/xdmshell.c	Sat Mar 12 00:43:48 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xdm/xdmshell.c,v 2.0 1993/12/18 11:40:53 dawes Exp $ */
  /*
   * xdmshell - simple program for running xdm from login
   *
***************
*** 35,42 ****
--- 36,47 ----
  #include "dm.h"
  #include <errno.h>
  extern int errno;
+ #ifdef X_NO_STRERROR
  extern int sys_nerr;
  extern char *sys_errlist[];
+ #else
+ #include <string.h>
+ #endif
  
  #ifdef macII
  #define ON_CONSOLE_ONLY
***************
*** 53,64 ****
  /*
   * HP-UX does have vfork, but A/UX doesn't
   */
! #if (defined(SYSV) || defined(macII)) && !defined(hpux)
  #define vfork() fork()
  #endif
  
  char *ProgramName;
  
  static char *SysErrorMsg (n)
      int n;
  {
--- 58,70 ----
  /*
   * HP-UX does have vfork, but A/UX doesn't
   */
! #if (defined(SYSV) || defined(macII)) && !defined(hpux) || defined(__OSF__)
  #define vfork() fork()
  #endif
  
  char *ProgramName;
  
+ #ifdef X_NO_STRERROR
  static char *SysErrorMsg (n)
      int n;
  {
***************
*** 65,70 ****
--- 71,79 ----
      char *s = (n > 0 && n < sys_nerr) ? sys_errlist[n] : "unknown";
      return (s ? s : "null system error");
  }
+ #else
+ #define SysErrorMsg(n) strerror(n)
+ #endif
  
  
  static int exec_args (filename, args)
***************
*** 116,121 ****
--- 125,132 ----
  {
      int ttyfd;
      char cmdbuf[256];
+     char binpath[256];
+     char *xwinhome;
      char *args[10];
  #ifdef ON_CONSOLE_ONLY
      int consfd;
***************
*** 179,184 ****
--- 190,204 ----
      }
  #endif
  
+     if ((xwinhome = getenv("XWINHOME")) == NULL) {
+ 	strcpy(binpath, BINDIR);
+     }
+     else {
+ 	if (!strcmp(xwinhome, "/usr"))
+ 	    strcpy(binpath, "/usr/bin/X11");
+ 	else
+ 	    sprintf(binpath, "%s/bin", xwinhome);
+     }
      /* make xdm run in a non-setuid environment */
      setuid (geteuid());
  
***************
*** 185,191 ****
      /*
       * exec /usr/bin/X11/xdm -nodaemon -udpPort 0
       */
!     strcpy (cmdbuf, BINDIR);
      strcat (cmdbuf, "/xdm");
      args[0] = cmdbuf;
      args[1] = "-nodaemon";
--- 205,211 ----
      /*
       * exec /usr/bin/X11/xdm -nodaemon -udpPort 0
       */
!     strcpy (cmdbuf, binpath);
      strcat (cmdbuf, "/xdm");
      args[0] = cmdbuf;
      args[1] = "-nodaemon";
***************
*** 199,205 ****
      }
  
  #ifdef macII
!     strcpy (cmdbuf, BINDIR);
      strcat (cmdbuf, "/Xrepair");
      (void) exec_one_arg (cmdbuf, NULL);
      (void) exec_one_arg ("/usr/bin/screenrestore", NULL);
--- 219,225 ----
      }
  
  #ifdef macII
!     strcpy (cmdbuf, binpath);
      strcat (cmdbuf, "/Xrepair");
      (void) exec_one_arg (cmdbuf, NULL);
      (void) exec_one_arg ("/usr/bin/screenrestore", NULL);
***************
*** 206,212 ****
  #endif
  
  #ifdef sun
!     strcpy (cmdbuf, BINDIR);
      strcat (cmdbuf, "/kbd_mode");
      (void) exec_one_arg (cmdbuf, "-a");
  #endif
--- 226,232 ----
  #endif
  
  #ifdef sun
!     strcpy (cmdbuf, binpath);
      strcat (cmdbuf, "/kbd_mode");
      (void) exec_one_arg (cmdbuf, "-a");
  #endif
diff -c mit/clients/xfd/fontgrid.c:1.1.1.1 mit/clients/xfd/fontgrid.c:2.0
*** mit/clients/xfd/fontgrid.c:1.1.1.1	Sat Mar 12 00:43:53 1994
--- mit/clients/xfd/fontgrid.c	Sat Mar 12 00:43:53 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/xfd/fontgrid.c,v 2.0 1993/09/28 07:32:10 dawes Exp $
   * $XConsortium: fontgrid.c,v 1.25 91/07/18 14:59:57 rws Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 517,523 ****
       * compute the callback data
       */
      {
! 	int cw = fgw->fontgrid.cell_width, ch = fgw->fontgrid.cell_height;
  	unsigned n;
  
  	if (x > (fgw->fontgrid.cell_cols * cw)) {
--- 518,525 ----
       * compute the callback data
       */
      {
! 	int cw = fgw->fontgrid.cell_width  + fgw->fontgrid.grid_width;
! 	int ch = fgw->fontgrid.cell_height + fgw->fontgrid.grid_width;
  	unsigned n;
  
  	if (x > (fgw->fontgrid.cell_cols * cw)) {
diff -c mit/clients/xhost/xhost.c:1.1.1.1 mit/clients/xhost/xhost.c:2.0
*** mit/clients/xhost/xhost.c:1.1.1.1	Sat Mar 12 00:43:55 1994
--- mit/clients/xhost/xhost.c	Sat Mar 12 00:43:55 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xhost/xhost.c,v 2.0 1993/07/10 15:01:58 dawes Exp $ */
  /* $XConsortium: xhost.c,v 11.48 91/07/19 18:41:15 rws Exp $ */
   
  /*
***************
*** 18,23 ****
--- 19,34 ----
  
  */
  
+ 
+ /* Shouldn't need this anymore -- will be removed soon */
+ #if  0 && defined(SYSV) && defined(SYSV386) 
+ /*
+  * Force TCP connection.
+  */
+ #define MAJOR_HACK
+ #include <sys/utsname.h>
+ #endif
+ 
  /* sorry, streams support does not really work yet */
  #if defined(STREAMSCONN) && defined(SVR4)
  #undef STREAMSCONN
***************
*** 33,38 ****
--- 44,52 ----
  #ifdef DNETCONN
  #define NEEDSOCKETS
  #endif
+ #ifdef AMTCPCONN
+ #define	NEEDSOCKETS
+ #endif
  
  #include <X11/Xlib.h>
  #include <X11/Xos.h>
***************
*** 55,64 ****
  #include <interlan/netdb.h>
  #include <interlan/in.h>
  #else
  #include <sys/socket.h>
  #include <netdb.h>
  #include <netinet/in.h>
! #endif
  #endif /* NEEDSOCKETS */
  
  #ifdef notdef
--- 69,91 ----
  #include <interlan/netdb.h>
  #include <interlan/in.h>
  #else
+ #ifdef AMOEBA
+ #include <server/ip/types.h>
+ #include <server/ip/gen/socket.h>
+ #include <server/ip/gen/netdb.h>
+ #include <server/ip/gen/in.h>
+ #else
+ #ifdef _MINIX
+ #include <net/gen/in.h>
+ #include <net/gen/netdb.h>
+ #include <net/gen/socket.h>
+ #else
  #include <sys/socket.h>
  #include <netdb.h>
  #include <netinet/in.h>
! #endif /* _MINIX */
! #endif /* AMOEBA */
! #endif /* att */
  #endif /* NEEDSOCKETS */
  
  #ifdef notdef
***************
*** 65,71 ****
  #include <arpa/inet.h>
  	bogus definition of inet_makeaddr() in BSD 4.2 and Ultrix
  #else
! #ifndef hpux
  extern unsigned long inet_makeaddr();
  #endif
  #endif
--- 92,98 ----
  #include <arpa/inet.h>
  	bogus definition of inet_makeaddr() in BSD 4.2 and Ultrix
  #else
! #if !defined(hpux) && !defined(SVR4)
  extern unsigned long inet_makeaddr();
  #endif
  #endif
***************
*** 160,173 ****
--- 187,227 ----
  	struct dn_naddr *nlist, dnaddr, *dnaddrp, *dnet_addr();
  	char *cp;
  #endif
+ #ifdef MAJOR_HACK
+ 	char *getenv(), *disp_name, *p, buf[50];
+ 	struct utsname un;
+ #endif
   
  	ProgramName = argv[0];
  
+ #if defined (MAJOR_HACK)
+ #ifndef TCPCONN
+ 	fprintf(stderr, "%s: Not built for TCP, so we're useless\n", 
+ 		ProgramName);
+ 	exit(1);
+ #endif /* TCPCONN */
+ 	if ((disp_name = getenv("DISPLAY")) == NULL) {
+ 	    fprintf(stderr, "%s: $DISPLAY is not set\n", ProgramName);
+ 	    exit(1);
+ 	}
+ 	if ((disp_name[0] == ':') || (strncmp(disp_name, "unix:", 5) == 0)) {
+ 	    p = strchr(disp_name, ':');
+ 	    uname(&un);
+ 	    sprintf(buf, "%s%s", un.nodename, p);
+ 	    disp_name = buf;
+ 	}
+ 	if ((dpy = XOpenDisplay(disp_name)) == NULL) {
+ 	    fprintf(stderr, "%s:  unable to open display \"%s\"\n",
+ 		    ProgramName, disp_name);
+ 	    exit(1);
+ 	}
+ #else /* MAJOR_HACK */
  	if ((dpy = XOpenDisplay(NULL)) == NULL) {
  	    fprintf(stderr, "%s:  unable to open display \"%s\"\n",
  		    ProgramName, XDisplayName (NULL));
  	    exit(1);
  	}
+ #endif /* MAJOR_HACK */
  
  	XSetErrorHandler(local_xerror);
   
***************
*** 263,270 ****
    struct hostent *hp;
    XHostAddress ha;
  #ifdef NEEDSOCKETS
    static struct in_addr addr;	/* so we can point at it */
! #endif
    char *cp;
  #ifdef DNETCONN
    struct dn_naddr *dnaddrp;
--- 317,328 ----
    struct hostent *hp;
    XHostAddress ha;
  #ifdef NEEDSOCKETS
+ #if defined(AMOEBA) || defined(_MINIX)
+   struct { ipaddr_t s_addr; } addr;
+ #else
    static struct in_addr addr;	/* so we can point at it */
! #endif /* AMOEBA */
! #endif /* NEEDSOCKETS */
    char *cp;
  #ifdef DNETCONN
    struct dn_naddr *dnaddrp;
***************
*** 418,424 ****
  static char *get_hostname (ha)
      XHostAddress *ha;
  {
! #ifdef TCPCONN
    struct hostent *hp = NULL;
    char *inet_ntoa();
  #endif
--- 476,482 ----
  static char *get_hostname (ha)
      XHostAddress *ha;
  {
! #if defined(TCPCONN) || defined(AMTCPCONN)
    struct hostent *hp = NULL;
    char *inet_ntoa();
  #endif
***************
*** 427,433 ****
    static char nodeaddr[16];
  #endif /* DNETCONN */
  
! #ifdef TCPCONN
    if (ha->family == FamilyInternet) {
      /* gethostbyaddr can take a LONG time if the host does not exist.
         Assume that if it does not respond in NAMESERVER_TIMEOUT seconds
--- 485,491 ----
    static char nodeaddr[16];
  #endif /* DNETCONN */
  
! #if defined(TCPCONN) || defined(AMTCPCONN)
    if (ha->family == FamilyInternet) {
      /* gethostbyaddr can take a LONG time if the host does not exist.
         Assume that if it does not respond in NAMESERVER_TIMEOUT seconds
***************
*** 444,450 ****
--- 502,512 ----
      alarm(0);
      if (hp)
        return (hp->h_name);
+ #if !defined(AMOEBA) && !defined(_MINIX)
      else return (inet_ntoa(*((struct in_addr *)(ha->address))));
+ #else
+     else return (inet_ntoa(*((ipaddr_t *)(ha->address))));
+ #endif
    }
  #endif
    if (ha->family == FamilyNetname) {
diff -c mit/clients/xinit/Imakefile:1.1.1.1 mit/clients/xinit/Imakefile:1.3
*** mit/clients/xinit/Imakefile:1.1.1.1	Sat Mar 12 00:43:57 1994
--- mit/clients/xinit/Imakefile	Sat Mar 12 00:43:57 1994
***************
*** 1,5 ****
  XCOMM $XConsortium: Imakefile,v 1.22 91/07/29 21:02:36 gildea Exp $
!         DEFINES = ConnectionFlags $(SIGNAL_DEFINES) -DBINDIR=\"$(BINDIR)\"
          DEPLIBS = $(DEPXMULIB) $(DEPXLIB)
  LOCAL_LIBRARIES = $(XMULIB) $(XLIB)
            SRCS1 = xinit.c 
--- 1,11 ----
+ XCOMM $XFree86: mit/clients/xinit/Imakefile,v 1.3 1993/04/17 08:33:35 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.22 91/07/29 21:02:36 gildea Exp $
! 
! #ifdef XFree86Version
!         OS_DEFS = -DXFREE86
! #endif
!         DEFINES = ConnectionFlags $(SIGNAL_DEFINES) -DBINDIR=\"$(BINDIR)\" \
! 		  $(OS_DEFS)
          DEPLIBS = $(DEPXMULIB) $(DEPXLIB)
  LOCAL_LIBRARIES = $(XMULIB) $(XLIB)
            SRCS1 = xinit.c 
***************
*** 9,15 ****
  
  ComplexProgramTarget_1(xinit,$(LOCAL_LIBRARIES),NullParameter)
  
! MakeScriptFromCpp(startx, -DXINITDIR=$(XINITDIR))
  MakeScriptFromCpp(xinitrc, -DXINITDIR=$(XINITDIR))
  /* MakeScriptFromCpp(xserverrc, -DXINITDIR=$(XINITDIR)) */
  
--- 15,21 ----
  
  ComplexProgramTarget_1(xinit,$(LOCAL_LIBRARIES),NullParameter)
  
! MakeScriptFromCpp(startx, -DXINITDIR=$(XINITDIR) -DBINDIR=$(BINDIR))
  MakeScriptFromCpp(xinitrc, -DXINITDIR=$(XINITDIR))
  /* MakeScriptFromCpp(xserverrc, -DXINITDIR=$(XINITDIR)) */
  
diff -c mit/clients/xinit/startx.cpp:1.1.1.1 mit/clients/xinit/startx.cpp:2.1
*** mit/clients/xinit/startx.cpp:1.1.1.1	Sat Mar 12 00:43:57 1994
--- mit/clients/xinit/startx.cpp	Sat Mar 12 00:43:57 1994
***************
*** 1,5 ****
--- 1,6 ----
  XCOMM!/bin/sh
  
+ XCOMM $XFree86: mit/clients/xinit/startx.cpp,v 2.1 1994/02/10 21:21:19 dawes Exp $
  XCOMM $XConsortium: startx.cpp,v 1.4 91/08/22 11:41:29 rws Exp $
  XCOMM 
  XCOMM This is just a sample implementation of a slightly less primitive 
***************
*** 14,21 ****
  
  userclientrc=$HOME/.xinitrc
  userserverrc=$HOME/.xserverrc
! sysclientrc=XINITDIR/xinitrc
! sysserverrc=XINITDIR/xserverrc
  clientargs=""
  serverargs=""
  
--- 15,33 ----
  
  userclientrc=$HOME/.xinitrc
  userserverrc=$HOME/.xserverrc
! if [ x"$XWINHOME" != x ]; then
!     if [ x"$XWINHOME" = x/usr ]; then
!         BIN_DIR=/usr/bin/X11
!     else
!         BIN_DIR=$XWINHOME/bin
!     fi
!     XINIT_DIR=$XWINHOME/lib/X11/xinit
! else
!     BIN_DIR=BINDIR
!     XINIT_DIR=XINITDIR
! fi
! sysclientrc=$XINIT_DIR/xinitrc
! sysserverrc=$XINIT_DIR/xserverrc
  clientargs=""
  serverargs=""
  
***************
*** 34,39 ****
--- 46,52 ----
  fi
  
  whoseargs="client"
+ have_server=0
  while [ "x$1" != "x" ]; do
      case "$1" in
  	/''*|\.*)	if [ "$whoseargs" = "client" ]; then
***************
*** 40,51 ****
  		    clientargs="$1"
  		else
  		    serverargs="$1"
  		fi ;;
  	--)	whoseargs="server" ;;
  	*)	if [ "$whoseargs" = "client" ]; then
  		    clientargs="$clientargs $1"
  		else
! 		    serverargs="$serverargs $1"
  		fi ;;
      esac
      shift
--- 53,74 ----
  		    clientargs="$1"
  		else
  		    serverargs="$1"
+ 		    have_server=1
  		fi ;;
  	--)	whoseargs="server" ;;
  	*)	if [ "$whoseargs" = "client" ]; then
  		    clientargs="$clientargs $1"
  		else
! 		    if [ "$have_server" = 0 ]; then
! 			if [ -x $BIN_DIR/"$1" ]; then
! 			    serverargs=$BIN_DIR/"$1"
! 			    have_server=1
! 			else
! 			    serverargs="$serverargs $1"
! 			fi
! 		    else
! 		        serverargs="$serverargs $1"
! 		    fi
  		fi ;;
      esac
      shift
***************
*** 62,66 ****
--- 85,93 ----
  #endif
  
  #ifdef sun
+ kbd_mode -a
+ #endif
+ 
+ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__386BSD__)
  kbd_mode -a
  #endif
diff -c mit/clients/xinit/xinit.c:1.1.1.1 mit/clients/xinit/xinit.c:2.4
*** mit/clients/xinit/xinit.c:1.1.1.1	Sat Mar 12 00:43:58 1994
--- mit/clients/xinit/xinit.c	Sat Mar 12 00:43:58 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xinit/xinit.c,v 2.4 1994/03/01 11:59:58 dawes Exp $ */
  /* $XConsortium: xinit.c,v 11.54 91/12/23 17:26:08 gildea Exp $ */
  
  /* Copyright    Massachusetts Institute of Technology    1986	*/
***************
*** 39,51 ****
  #define SHELL "sh"
  #endif
  
! #ifdef macII
  #define vfork() fork()
! #endif /* macII */
! 
! #if defined(SYSV) && !defined(hpux)
! #define vfork() fork()
! #endif /* SYSV and not hpux */
  
  /* A/UX setpgid incorrectly removes the controlling terminal.
     Per Posix, only setsid should do that. */
--- 40,48 ----
  #define SHELL "sh"
  #endif
  
! #if (defined(SYSV) && !defined(hpux)) || defined(_MINIX) || defined(macII) || defined(__OSF__) || defined(SOLX86)
  #define vfork() fork()
! #endif
  
  /* A/UX setpgid incorrectly removes the controlling terminal.
     Per Posix, only setsid should do that. */
***************
*** 54,59 ****
--- 51,58 ----
  #endif
  
  char *bindir = BINDIR;
+ char binpath[256];
+ char *xwinhome = NULL;
  char *server_names[] = {
  #ifdef vax				/* Digital */
      "Xqvss       Digital monochrome display on Microvax or VAXstation",
***************
*** 81,86 ****
--- 80,94 ----
  #ifdef M4310				/* Tektronix Pegasus */
      "Xpeg        Tektronix Pegasus display on 431x series",
  #endif
+ #ifdef XFREE86
+     "XF86_SVGA   SVGA colour display on i386 PC",
+     "XF86_Mono   monochrome display on i386 PC",
+     "XF86_VGA16  16 colour VGA display on i386 PC",
+     "XF86_S3     S3 colour display on i386 PC",
+     "XF86_8514   IBM 8514/A colour display on i386 PC",
+     "XF86_Mach8  ATI Mach8 colour display on i386 PC",
+     "XF86_Mach32 ATI Mach32 colour display on i386 PC",
+ #endif
      NULL};
  
  #ifndef XINITRC
***************
*** 109,115 ****
  char *program;
  Display *xd;			/* server connection */
  #ifndef SYSV
! #if defined(SVR4) || defined(_POSIX_SOURCE)
  int status;
  #else
  union wait	status;
--- 117,123 ----
  char *program;
  Display *xd;			/* server connection */
  #ifndef SYSV
! #if defined(SVR4) || defined(_POSIX_SOURCE) || (BSD >= 199103)
  int status;
  #else
  union wait	status;
***************
*** 142,148 ****
  SIGVAL sigAlarm(sig)
  	int sig;
  {
! #ifdef SYSV
  	signal (sig, sigAlarm);
  #endif
  }
--- 150,156 ----
  SIGVAL sigAlarm(sig)
  	int sig;
  {
! #if defined(SYSV) || defined(SVR4) || defined(linux)
  	signal (sig, sigAlarm);
  #endif
  }
***************
*** 151,157 ****
  sigUsr1(sig)
  	int sig;
  {
! #ifdef SYSV
  	signal (sig, sigUsr1);
  #endif
  }
--- 159,165 ----
  sigUsr1(sig)
  	int sig;
  {
! #if defined(SYSV) || defined(SVR4) || defined(linux)
  	signal (sig, sigUsr1);
  #endif
  }
***************
*** 183,188 ****
--- 191,203 ----
  	program = *argv++;
  	argc--;
  
+ 	if ((xwinhome = getenv("XWINHOME")) != NULL) {
+ 	    if (!strcmp(xwinhome, "/usr"))
+ 		strcpy(binpath, "/usr/bin/X11");
+ 	    else
+ 		sprintf(binpath, "%s/bin", xwinhome);
+ 	    bindir = binpath;
+ 	}
  	/*
  	 * copy the client args.
  	 */
***************
*** 311,316 ****
--- 326,341 ----
  		pid = -1;
  		while (pid != clientpid && pid != serverpid)
  			pid = wait(NULL);
+ #ifdef linux
+ 		/*
+ 		 * the child has exited. why not do this and avoid noticing
+ 		 * this fact via some obscure error?
+ 		 */
+ 		if (pid == clientpid)
+ 			 clientpid = -1;
+ 		else if (pid == serverpid)
+ 			 serverpid = -1;
+ #endif
  	}
  	signal(SIGQUIT, SIG_IGN);
  	signal(SIGINT, SIG_IGN);
***************
*** 369,375 ****
  			break;
  		alarm(0);
  #else /* SYSV */
! #if defined(SVR4) || defined(_POSIX_SOURCE)
  		if ((pidfound = waitpid(serverpid, &status, WNOHANG)) == serverpid)
  			break;
  #else
--- 394,400 ----
  			break;
  		alarm(0);
  #else /* SYSV */
! #if defined(SVR4) || defined(_POSIX_SOURCE) || (BSD >= 199103)
  		if ((pidfound = waitpid(serverpid, &status, WNOHANG)) == serverpid)
  			break;
  #else
***************
*** 389,395 ****
  		if (++i > timeout)
  			break;
  	}
! 	if ( i > 0 ) fputc( '\n', stderr );     /* tidy up after message */
  	laststring = string;
  	return( serverpid != pidfound );
  }
--- 414,423 ----
  		if (++i > timeout)
  			break;
  	}
! #ifdef linux
! 	if (timeout)
! #endif
! 	  if ( i > 0 ) fputc( '\n', stderr );     /* tidy up after message */
  	laststring = string;
  	return( serverpid != pidfound );
  }
***************
*** 608,620 ****
  	exit(ERR_EXIT);
  }
  
  Error(fmt, x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)
  	char	*fmt;
  {
- 	extern char	*sys_errlist[];
- 
  	fprintf(stderr, "%s:  ", program);
  	if (errno > 0 && errno < sys_nerr)
  	  fprintf (stderr, "%s (errno %d):  ", sys_errlist[errno], errno);
  	fprintf(stderr, fmt, x0,x1,x2,x3,x4,x5,x6,x7,x8,x9);
  }
--- 636,656 ----
  	exit(ERR_EXIT);
  }
  
+ #ifndef X_NO_STRERROR
+ #include <string.h>
+ #else
+ extern char	*sys_errlist[];
+ #endif
+ 
  Error(fmt, x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)
  	char	*fmt;
  {
  	fprintf(stderr, "%s:  ", program);
+ #ifndef X_NO_STRERROR
+ 	fprintf (stderr, "%s (errno %d):  ", strerror(errno), errno);
+ #else
  	if (errno > 0 && errno < sys_nerr)
  	  fprintf (stderr, "%s (errno %d):  ", sys_errlist[errno], errno);
+ #endif
  	fprintf(stderr, fmt, x0,x1,x2,x3,x4,x5,x6,x7,x8,x9);
  }
diff -c mit/clients/xinit/xinitrc.cpp:1.1.1.1 mit/clients/xinit/xinitrc.cpp:1.3
*** mit/clients/xinit/xinitrc.cpp:1.1.1.1	Sat Mar 12 00:43:59 1994
--- mit/clients/xinit/xinitrc.cpp	Sat Mar 12 00:43:59 1994
***************
*** 1,10 ****
  XCOMM!/bin/sh
  XCOMM $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $
  
  userresources=$HOME/.Xresources
  usermodmap=$HOME/.Xmodmap
! sysresources=XINITDIR/.Xresources
! sysmodmap=XINITDIR/.Xmodmap
  
  XCOMM merge in defaults and keymaps
  
--- 1,16 ----
  XCOMM!/bin/sh
+ XCOMM $XFree86: mit/clients/xinit/xinitrc.cpp,v 1.3 1993/04/11 13:50:35 dawes Exp $
  XCOMM $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $
  
  userresources=$HOME/.Xresources
  usermodmap=$HOME/.Xmodmap
! if [ x"$XWINHOME" != x ]; then
!     XINIT_DIR=$XWINHOME/lib/X11/xinit
! else
!     XINIT_DIR=XINITDIR
! fi
! sysresources=$XINIT_DIR/.Xresources
! sysmodmap=$XINIT_DIR/.Xmodmap
  
  XCOMM merge in defaults and keymaps
  
diff -c mit/clients/xload/Imakefile:1.1.1.1 mit/clients/xload/Imakefile:1.4
*** mit/clients/xload/Imakefile:1.1.1.1	Sat Mar 12 00:44:01 1994
--- mit/clients/xload/Imakefile	Sat Mar 12 00:44:01 1994
***************
*** 1,6 ****
--- 1,10 ----
+ XCOMM $XFree86: mit/clients/xload/Imakefile,v 1.4 1993/05/05 13:43:44 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.26 91/07/17 00:46:30 gildea Exp $
          DEPLIBS = XawClientDepLibs
  LOCAL_LIBRARIES = XawClientLibs
+ #if i386Mach && !defined(i386Mach_BsdTree)
+   SYS_LIBRARIES = -lsys
+ #endif
  #if defined(SunArchitecture) && defined(i386Architecture)
    SYS_LIBRARIES = -lkvm
  #endif
***************
*** 13,18 ****
--- 17,25 ----
  #endif
  #ifdef SGIArchitecture
    SYS_LIBRARIES = -lmld
+ #endif
+ #ifdef OsfArchitecture
+   SYS_LIBRARIES = -lld
  #endif
             SRCS = xload.c get_load.c
             OBJS = xload.o get_load.o
diff -c mit/clients/xload/get_load.c:1.1.1.1 mit/clients/xload/get_load.c:2.5
*** mit/clients/xload/get_load.c:1.1.1.1	Sat Mar 12 00:44:02 1994
--- mit/clients/xload/get_load.c	Sat Mar 12 00:44:02 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * get_load - get system load
   *
+  * $XFree86: mit/clients/xload/get_load.c,v 2.5 1994/02/10 21:21:27 dawes Exp $
   * $XConsortium: get_load.c,v 1.26 91/07/25 14:20:25 rws Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 39,45 ****
--- 40,48 ----
  #ifndef macII
  #ifndef apollo
  #ifndef LOADSTUB
+ #if !defined(linux) && !defined(AMOEBA)
  #include <nlist.h>
+ #endif /* linux || AMOEBA */
  #endif /* LOADSTUB */
  #endif /* apollo */
  #endif /* macII */
***************
*** 314,319 ****
--- 317,413 ----
      *loadavg = (double)temp/FSCALE;
  }
  #else /* not KVM_ROUTINES */
+ #ifdef AMOEBA
+ #include <amoeba.h>
+ #include <cmdreg.h>
+ #include <stderr.h>
+ #include <ampolicy.h>
+ 
+ static capability pooldircap;
+ extern char *getenv();
+ 
+ void
+ InitLoadPoint()
+ {
+     register char *s;
+ 
+     if ((s = getenv("XLOAD_HOST")) != NULL) {
+ 	/* do an xload of a single host */
+ 	if (host_lookup(s, &pooldircap) != STD_OK)
+ 	    xload_error("cannot lookup run server", s);
+ 	if (dir_lookup(&pooldircap, "proc", &pooldircap) != STD_OK)
+ 	    xload_error("cannot lookup run server", s);
+     } else {
+ 	/* Else we do an xload of a pool.
+ 	 * Environment variable RUN_SERVER overrides the default one.
+ 	 */
+ 	if ((s = getenv("RUN_SERVER")) == NULL)
+ 	    s = DEF_RUNSVR_POOL;
+ 	if (name_lookup(s, &pooldircap) != STD_OK)
+ 	    xload_error("cannot lookup run server", s);
+     }
+ }
+ 
+ /* ARGSUSED */
+ void GetLoadPoint( w, closure, call_data )
+     Widget   w;              /* unused */
+     caddr_t  closure;        /* unused */
+     caddr_t  call_data;      /* pointer to (double) return value */
+ {
+     long ips, loadav, mfree;
+ 
+     if (pro_getload(&pooldircap, &ips, &loadav, &mfree) != STD_OK) {
+ 	/*
+ 	 * No run server. We don't want to crash, though:
+ 	 * it will probably come up again.
+ 	 */
+ 	InitLoadPoint();
+ 	loadav = 0;
+     }
+     *(double *)call_data = (double)loadav / 1024.0;
+ }
+ #else /* AMOEBA */
+ 
+ #ifdef linux
+ 
+ void InitLoadPoint()
+ {
+ 	return;
+ }
+ 
+ void GetLoadPoint( w, closure, call_data )
+      Widget	w;		/* unused */
+      caddr_t	closure;	/* unused */
+      caddr_t	call_data;	/* pointer to (double) return value */
+ {
+ 	static int fd = -1;
+ 	int n;
+ 	char buf[10];
+ 
+ 	if (fd < 0)
+ 	{
+ 		if (fd == -2 ||
+ 		    (fd = open("/proc/loadavg", O_RDONLY)) < 0)
+ 		{
+ 			fd = -2;
+ 			*(double *)call_data = 0.0;
+ 			return;
+ 		}
+ 	}
+ 	else
+ 		lseek(fd, 0, 0);
+ 
+ 	if ((n = read(fd, buf, sizeof(buf)-1)) > 0 &&
+ 	    sscanf(buf, "%lf", (double *)call_data) == 1)
+ 			return;
+ 
+ 	*(double *)call_data = 0.0;	/* temporary hiccup */
+ 
+ 	return;
+ }
+ 
+ #else /* linux */
+ 
  #ifdef LOADSTUB
  
  void InitLoadPoint()
***************
*** 381,404 ****
  #endif
  #endif /* MOTOROLA */
  
  /*
   * provide default for everyone else
   */
  #ifndef KERNEL_FILE
! #ifdef SVR4
! #define KERNEL_FILE "/stand/unix"
! #else
! #ifdef SYSV
! #define KERNEL_FILE "/unix"
! #else
! #define KERNEL_FILE "/vmunix"
! #endif /* SYSV */
! #endif /* SVR4 */
  #endif /* KERNEL_FILE */
  #endif /* KERNEL_FILE */
  
  
  #ifndef KERNEL_LOAD_VARIABLE
  #    ifdef alliant
  #        define KERNEL_LOAD_VARIABLE "_Loadavg"
  #    endif /* alliant */
--- 475,524 ----
  #endif
  #endif /* MOTOROLA */
  
+ #ifdef _MINIX
+ #define KERNEL_FILE "/sys/kernel"
+ #endif /* _MINIX */
+ 
  /*
   * provide default for everyone else
   */
  #ifndef KERNEL_FILE
! # ifdef SVR4
! #  ifdef SOLX86
! #    define KERNEL_FILE "/kernel/unix"
! #  else
! #    define KERNEL_FILE "/stand/unix"
! #  endif
! # else
! #  ifdef SYSV
! #   define KERNEL_FILE "/unix"
! #  else
! /* If a BSD system, check in <paths.h> */
! #   ifdef BSD
! #    include <paths.h>
! #    ifdef _PATH_UNIX
! #     define KERNEL_FILE _PATH_UNIX
! #    else
! #     ifdef _PATH_KERNEL
! #      define KERNEL_FILE _PATH_KERNEL
! #     else
! #      define KERNEL_FILE "/vmunix"
! #     endif
! #    endif
! #   else /* BSD */
! #    define KERNEL_FILE "/vmunix"
! #   endif /* BSD */
! #  endif /* SYSV */
! # endif /* SVR4 */
  #endif /* KERNEL_FILE */
  #endif /* KERNEL_FILE */
  
  
  #ifndef KERNEL_LOAD_VARIABLE
+ #    if (BSD >= 199103)
+ #        define KERNEL_LOAD_VARIABLE "_averunnable"
+ #    endif /* BSD >= 199103 */
+ 
  #    ifdef alliant
  #        define KERNEL_LOAD_VARIABLE "_Loadavg"
  #    endif /* alliant */
***************
*** 446,451 ****
--- 566,575 ----
  #        endif
  #    endif /* MOTOROLA */
  
+ #    ifdef _MINIX
+ #	 define KERNEL_LOAD_VARIABLE "_loadav"
+ #    endif _MINIX
+ 
  #endif /* KERNEL_LOAD_VARIABLE */
  
  /*
***************
*** 509,515 ****
  	nl[i].n_value = (int)nl[i].n_value - v.v_kvoffset;
      }
  #else /* not macII */
! #if (!defined(SVR4) || !defined(__STDC__)) && !defined(sgi) && !defined(MOTOROLA)
      extern void nlist();
  #endif
  
--- 633,639 ----
  	nl[i].n_value = (int)nl[i].n_value - v.v_kvoffset;
      }
  #else /* not macII */
! #if (!defined(SVR4) || !defined(__STDC__)) && !defined(sgi) && !defined(MOTOROLA) && !(BSD >= 199103) && !defined(_MINIX)
      extern void nlist();
  #endif
  
***************
*** 561,567 ****
  	(void) lseek(kmem, loadavg_seek, 0);
  #endif
  
! #if defined(sun) || defined (UTEK) || defined(sequent) || defined(alliant) || defined(SVR4) || defined(sgi) || defined(hcx)
  	{
  		long temp;
  		(void) read(kmem, (char *)&temp, sizeof(long));
--- 685,691 ----
  	(void) lseek(kmem, loadavg_seek, 0);
  #endif
  
! #if defined(sun) || defined (UTEK) || defined(sequent) || defined(alliant) || defined(SVR4) || defined(sgi) || defined(hcx) || (BSD >= 199103)
  	{
  		long temp;
  		(void) read(kmem, (char *)&temp, sizeof(long));
***************
*** 700,708 ****
  	}
  #      endif /* mips */
  #     else /* not sony NEWSOS4 */
  	(void) read(kmem, (char *)loadavg, sizeof(double));
! #        endif /* sony NEWOS4 */
! #      endif /* MOTOROLA else */
  #    endif /* AIXV3 else */
  #  endif /* umips else */
  # endif /* macII else */
--- 824,850 ----
  	}
  #      endif /* mips */
  #     else /* not sony NEWSOS4 */
+ #      ifdef _MINIX
+ 	{
+ /* Indices in the loadav array */
+ #define LDAV_CURR	0		/* run queue lenght at this moment */
+ #define LDAV_6		1		/* av. run q len over 64 ticks (~ 1s) */
+ #define LDAV_12 	2		/* av. run q len over 4096 ticks */
+ #define LDAV_16		3		/* av. run q len over 65536 ticks */
+ #define LDAV_TOT	4		/* cummulative run q lenght */
+ #define LDAV_NR		5		/* size of the loadav array */
+ #define LDAV_SCALE_SHFT	8		/* values are scaled by 256 */
+ 
+ 		unsigned long loadav[LDAV_NR];	/* load avarage array */
+ 		
+ 		(void) read(kmem, (char *)loadav, sizeof(loadav));
+ 		*loadavg = (double)loadav[LDAV_12]/0x1000;
+ 	}
+ #       else /* !_MINIX */
  	(void) read(kmem, (char *)loadavg, sizeof(double));
! #       endif /* _MINIX */
! #      endif /* sony NEWOS4 */
! #     endif /* MOTOROLA else */
  #    endif /* AIXV3 else */
  #  endif /* umips else */
  # endif /* macII else */
***************
*** 710,715 ****
--- 852,859 ----
  	return;
  }
  #endif /* LOADSTUB else */
+ #endif /* linux else */
+ #endif /* AMOEBA else */
  #endif /* KVM_ROUTINES else */
  #endif /* SYSV && SYSV386 else */
  
diff -c mit/clients/xload/xload.c:1.1.1.1 mit/clients/xload/xload.c:1.2
*** mit/clients/xload/xload.c:1.1.1.1	Sat Mar 12 00:44:04 1994
--- mit/clients/xload/xload.c	Sat Mar 12 00:44:04 1994
***************
*** 3,8 ****
--- 3,9 ----
   *
   * Copyright 1989 Massachusetts Institute of Technology
   *
+  * $XFree86: mit/clients/xload/xload.c,v 1.2 1993/03/20 06:08:01 dawes Exp $
   * $XConsortium: xload.c,v 1.36 91/05/24 16:57:46 converse Exp $
   */
  
***************
*** 190,196 ****
--- 191,219 ----
        	  XtGetValues(label_wid, args, ONE);
        	  
        	  if ( strcmp("label", label) == 0 ) {
+ #ifdef AMOEBA
+ 		char *s;
+ 		char *getenv();
+ 	 
+ 		host[255] = '\0';
+ 		if ((s = getenv("XLOAD_HOST")) != NULL) {
+ 		     strncpy(host, s, 255);
+ 		} else if ((s = getenv("RUN_SERVER")) != NULL) {
+ 		    /* specific runserver specified; use its name */
+ 		    strncpy(host, s, 255);
+ 	 
+ 		    {   /* if the last component is ".run", remove it */
+ 			char *slash = strrchr(host, '/');
+ 			if (slash != NULL && strcmp(slash + 1, ".run") == 0) {
+ 			    *slash = '\0';
+ 			}
+ 		    }
+ 		} else {
+ 	            (void) XmuGetHostname (host, 255);  /* "amoeba" */
+ 	        }
+ #else
  	    (void) XmuGetHostname (host, 255);
+ #endif
  	    XtSetArg (args[0], XtNlabel, host);
  	    XtSetValues (label_wid, args, ONE);
        	  }
diff -c mit/clients/xmag/Scale.c:1.1.1.1 mit/clients/xmag/Scale.c:2.0
*** mit/clients/xmag/Scale.c:1.1.1.1	Sat Mar 12 00:44:11 1994
--- mit/clients/xmag/Scale.c	Sat Mar 12 00:44:11 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/xmag/Scale.c,v 2.0 1993/08/01 05:51:55 dawes Exp $
   * $XConsortium: Scale.c,v 1.15 91/08/26 11:00:15 gildea Exp $
   *
   * Copyright 1989 Massachusetts Institute of Technology
***************
*** 40,47 ****
  #include <stdlib.h>
  #endif
  
! #if defined(ISC) && defined(SYSV) && defined(SYSV386) && __STDC__
! extern double atof(char *);
  #endif
  
  #define streq(a,b) (strcmp( (a), (b) ) == 0)
--- 41,52 ----
  #include <stdlib.h>
  #endif
  
! #if defined(ISC) && defined(__STDC__)
! #ifdef ISC30
! extern double atof(const char *);
! #else
! extern double atof();
! #endif
  #endif
  
  #define streq(a,b) (strcmp( (a), (b) ) == 0)
diff -c mit/clients/xmag/xmag.c:1.1.1.1 mit/clients/xmag/xmag.c:2.0
*** mit/clients/xmag/xmag.c:1.1.1.1	Sat Mar 12 00:44:11 1994
--- mit/clients/xmag/xmag.c	Sat Mar 12 00:44:12 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xmag/xmag.c,v 2.0 1993/12/10 14:30:40 dawes Exp $ */
  /* $XConsortium: xmag.c,v 1.22 91/09/12 17:24:04 rws Exp $ */
  /*
   * Copyright 1991 Massachusetts Institute of Technology
***************
*** 888,894 ****
  
  
  
! static Widget pane1, pane2, pane3, cclose, replace, new, select, paste, label;
  
  /*
   * PopupNewScale() -- Create and popup a new scale composite.
--- 889,895 ----
  
  
  
! static Widget pane1, pane2, pane3, cclose, replace, new, w_select, paste, label;
  
  /*
   * PopupNewScale() -- Create and popup a new scale composite.
***************
*** 917,925 ****
    new = XtCreateManagedWidget("new", commandWidgetClass, pane2,
  			      (Arg *) NULL, 0);
    XtAddCallback(new, XtNcallback, NewCB, (XtPointer)NULL);
!   select = XtCreateManagedWidget("select", commandWidgetClass, pane2,
  			      (Arg *) NULL, 0);
!   XtAddCallback(select, XtNcallback, SelectCB, (XtPointer)data);
    paste = XtCreateManagedWidget("paste", commandWidgetClass, pane2,
  			      (Arg *) NULL, 0);
    XtAddCallback(paste, XtNcallback, PasteCB, (XtPointer)data);
--- 918,926 ----
    new = XtCreateManagedWidget("new", commandWidgetClass, pane2,
  			      (Arg *) NULL, 0);
    XtAddCallback(new, XtNcallback, NewCB, (XtPointer)NULL);
!   w_select = XtCreateManagedWidget("select", commandWidgetClass, pane2,
  			      (Arg *) NULL, 0);
!   XtAddCallback(w_select, XtNcallback, SelectCB, (XtPointer)data);
    paste = XtCreateManagedWidget("paste", commandWidgetClass, pane2,
  			      (Arg *) NULL, 0);
    XtAddCallback(paste, XtNcallback, PasteCB, (XtPointer)data);
diff -c mit/clients/xman/ScrollByL.c:1.1.1.2 mit/clients/xman/ScrollByL.c:2.0
*** mit/clients/xman/ScrollByL.c:1.1.1.2	Sat Mar 12 00:44:15 1994
--- mit/clients/xman/ScrollByL.c	Sat Mar 12 00:44:15 1994
***************
*** 1,8 ****
  /*
   * xman - X window system manual page display program.
   *
   * $XConsortium: ScrollByL.c,v 1.27 91/07/26 18:30:47 dave Exp $
-  * $Header: ScrollByL.c,v 1.27 91/07/26 18:30:47 dave Exp $
   *
   * Copyright 1987, 1988 Massachusetts Institute of Technology
   *
--- 1,8 ----
  /*
   * xman - X window system manual page display program.
   *
+  * $XFree86: mit/clients/xman/ScrollByL.c,v 2.0 1993/12/23 13:22:03 dawes Exp $
   * $XConsortium: ScrollByL.c,v 1.27 91/07/26 18:30:47 dave Exp $
   *
   * Copyright 1987, 1988 Massachusetts Institute of Technology
   *
***************
*** 105,116 ****
    { "Page",   Page},
  };
  
! #define superclass		(&simpleClassRec)
  
  ScrollByLineClassRec scrollByLineClassRec = {
    {
  /* core_class fields      */
!     /* superclass         */    (WidgetClass) superclass,
      /* class_name         */    "ScrollByLine",
      /* widget_size        */    sizeof(ScrollByLineRec),
      /* class_initialize   */    NULL,
--- 105,116 ----
    { "Page",   Page},
  };
  
! #define SuperClass		simpleWidgetClass
  
  ScrollByLineClassRec scrollByLineClassRec = {
    {
  /* core_class fields      */
!     /* superclass         */    (WidgetClass) (&simpleClassRec),
      /* class_name         */    "ScrollByLine",
      /* widget_size        */    sizeof(ScrollByLineRec),
      /* class_initialize   */    NULL,
***************
*** 447,453 ****
  int old_y, new_y, height;
  {
    ScrollByLineWidget sblw = (ScrollByLineWidget) w;
!   int from_left = sblw->scroll.indent + sblw->scroll.offset;
    int y_clear;
  
    old_y *= sblw->scroll.font_height;
--- 447,453 ----
  int old_y, new_y, height;
  {
    ScrollByLineWidget sblw = (ScrollByLineWidget) w;
!   int from_left = sblw->scroll.indent + sblw->scroll.offset - 1;
    int y_clear;
  
    old_y *= sblw->scroll.font_height;
***************
*** 477,483 ****
  	    (unsigned int) w->core.width - from_left, (unsigned int) height,
  	    from_left, new_y);
  
!   height -= sblw->scroll.font_height/2;	/* clear 1/2 font of extra space,
  					   to make sure we don't lose or
  					   gain decenders. */
    if (old_y > new_y)
--- 477,483 ----
  	    (unsigned int) w->core.width - from_left, (unsigned int) height,
  	    from_left, new_y);
  
!   height -= sblw->scroll.font_height;	/* clear 1 font of extra space,
  					   to make sure we don't lose or
  					   gain decenders. */
    if (old_y > new_y)
***************
*** 685,691 ****
    CreateScrollbar(w);
    CreateGCs(w);
    Layout(w);
!   (*superclass->core_class.realize) (w, valueMask, attributes);
    XtRealizeWidget(sblw->scroll.bar); /* realize scrollbar. */
    XtMapWidget(sblw->scroll.bar); /* map scrollbar. */
  
--- 685,691 ----
    CreateScrollbar(w);
    CreateGCs(w);
    Layout(w);
!   (*SuperClass->core_class.realize) (w, valueMask, attributes);
    XtRealizeWidget(sblw->scroll.bar); /* realize scrollbar. */
    XtMapWidget(sblw->scroll.bar); /* map scrollbar. */
  
***************
*** 1071,1083 ****
  
      case BACKSPACE:		/* Backspacing for nroff bolding */
        if (c[-1] == c[1] && c[1] != BACKSPACE) {	/* overstriking one char */
! 	bufp--;		/* Zap 1st instance of char to bolden */
! 	if (bufp > buf) {
  	  x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf,
  			   WHICH(italicflag, FALSE));
  	  h_col += bufp - buf;
- 	  bufp = buf;
  	}
  	*bufp++ = c[1];
  	x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, BOLD);
  	h_col += bufp - buf;
--- 1071,1083 ----
  
      case BACKSPACE:		/* Backspacing for nroff bolding */
        if (c[-1] == c[1] && c[1] != BACKSPACE) {	/* overstriking one char */
! 	if (bufp>buf) {
! 	  bufp--;		/* Zap 1st instance of char to bolden */
  	  x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf,
  			   WHICH(italicflag, FALSE));
  	  h_col += bufp - buf;
  	}
+ 	bufp = buf;
  	*bufp++ = c[1];
  	x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, BOLD);
  	h_col += bufp - buf;
***************
*** 1086,1092 ****
  
  	/*
  	 *     Nroff bolding looks like:
! 	 *	 	     C\bC\bC\bCN...
  	 * c points to ----^      ^
  	 * it needs to point to --^
  	 */
--- 1086,1092 ----
  
  	/*
  	 *     Nroff bolding looks like:
! 	 *               C\bC\bC\bCN...
  	 * c points to ----^      ^
  	 * it needs to point to --^
  	 */
***************
*** 1100,1109 ****
  				/* If we run into a bullet, print out */
  				/* everything that's accumulated to this */
  				/* point, then the bullet, then resume. */
! 	  bufp--;
! 	  x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf,
! 			   WHICH(italicflag, FALSE));
! 	  h_col += bufp - buf;
  	  bufp = buf;
  	  *bufp = (char)183;
  	  x_loc = DumpText(w, x_loc, y_loc, buf, 1, SYMBOL);
--- 1100,1111 ----
  				/* If we run into a bullet, print out */
  				/* everything that's accumulated to this */
  				/* point, then the bullet, then resume. */
! 	  if (bufp>buf) {
! 	    bufp--;
! 	    x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf,
! 			     WHICH(italicflag, FALSE));
! 	    h_col += bufp - buf;
! 	  }
  	  bufp = buf;
  	  *bufp = (char)183;
  	  x_loc = DumpText(w, x_loc, y_loc, buf, 1, SYMBOL);
***************
*** 1111,1117 ****
  	  c++;
  	}
  	else {		/* 'real' backspace - back up output ptr */
! 	  bufp--;
  	}
        }
        break;
--- 1113,1120 ----
  	  c++;
  	}
  	else {		/* 'real' backspace - back up output ptr */
! 	  if (bufp>buf)
! 	    bufp--;
  	}
        }
        break;
***************
*** 1225,1228 ****
    return(1);
  }
  
! #undef superclass
--- 1228,1231 ----
    return(1);
  }
  
! #undef SuperClass
diff -c mit/clients/xman/defs.h:1.1.1.1 mit/clients/xman/defs.h:2.0
*** mit/clients/xman/defs.h:1.1.1.1	Sat Mar 12 00:44:15 1994
--- mit/clients/xman/defs.h	Sat Mar 12 00:44:15 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xman - X window system manual page display program.
   *
+  * $XFree86: mit/clients/xman/defs.h,v 2.0 1993/10/18 12:04:43 dawes Exp $
   * $XConsortium: defs.h,v 1.24 91/02/13 16:08:07 converse Exp $
   *
   * Copyright 1987, 1988 Massachusetts Institute of Technology
***************
*** 81,87 ****
  
  #define NO_SECTION_DEFAULTS ("no default sections")
  
! #define TBL "tbl"
  
  #define DEFAULT_WIDTH 500	/* The default width of xman. */
  #define SECTALLOC  8		/* The number of entries allocated
--- 82,92 ----
  
  #define NO_SECTION_DEFAULTS ("no default sections")
  
! #if !defined(linux)
! # define TBL "tbl"
! #else
! # define TBL "gtbl"
! #endif
  
  #define DEFAULT_WIDTH 500	/* The default width of xman. */
  #define SECTALLOC  8		/* The number of entries allocated
diff -c mit/clients/xman/main.c:1.1.1.2 mit/clients/xman/main.c:1.3
*** mit/clients/xman/main.c:1.1.1.2	Sat Mar 12 00:44:16 1994
--- mit/clients/xman/main.c	Sat Mar 12 00:44:16 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xman - X window system manual page display program.
   *
+  * $XFree86: mit/clients/xman/main.c,v 1.3 1993/04/11 13:24:27 dawes Exp $
   * $XConsortium: main.c,v 1.21 91/09/03 18:16:55 dave Exp $
   *
   * Copyright 1987, 1988 Massachusetts Institute of Technology
***************
*** 29,34 ****
--- 30,36 ----
  #endif
  
  static void ArgError();
+ static void AdjustDefResources();
  
  #define Offset(field) (XtOffsetOf(Xman_Resources , field))
  
***************
*** 137,142 ****
--- 139,146 ----
  
    manglobals_context = XStringToContext(MANNAME);
  
+   AdjustDefResources();
+ 
    XtGetApplicationResources( initial_widget, (caddr_t) &resources, 
  			    my_resources, XtNumber(my_resources),
  			    NULL, (Cardinal) 0);
***************
*** 239,243 ****
--- 243,275 ----
    while ( *syntax != NULL ) {
      printf("%-30s - %s\n", syntax[0], syntax[1]);
      syntax += 2;
+   }
+ }
+ 
+ /*	Function Name: AdjustDefResources
+  *	Description: Changes default resources which contain paths when
+  *		XWINHOME is set
+  *	Arguments: none
+  *	Returns: nothing
+  */
+ 
+ static void
+ AdjustDefResources()
+ {
+   char	*xwinhome = NULL;
+   int	i;
+ 
+   if (!(xwinhome = getenv("XWINHOME")))
+     return;
+ 
+   for (i = 0; i < sizeof(my_resources)/sizeof(XtResource); i++) {
+     if (!strcmp(my_resources[i].resource_name, "helpFile")) {
+       if (!(my_resources[i].default_addr =
+ 		malloc(strlen(xwinhome) + sizeof("/lib/X11/xman.help")))) {
+         fprintf(stderr, "malloc failure\n");
+         exit(1);
+       }
+       sprintf(my_resources[i].default_addr, "%s/lib/X11/xman.help", xwinhome);
+     }
    }
  }
diff -c mit/clients/xman/man.c:1.1.1.1 mit/clients/xman/man.c:2.0
*** mit/clients/xman/man.c:1.1.1.1	Sat Mar 12 00:44:17 1994
--- mit/clients/xman/man.c	Sat Mar 12 00:44:17 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xman - X Window System manual page display program.
   *
+  * $XFree86: mit/clients/xman/man.c,v 2.0 1993/07/28 11:52:54 dawes Exp $
   * $XConsortium: man.c,v 1.29 91/07/30 22:03:20 rws Exp $
   *
   * Copyright 1987, 1988 Massachusetts Institute of Technology
***************
*** 47,52 ****
--- 48,57 ----
  static void AddToCurrentSection();
  static void ReadCurrentSection();
  
+ #ifdef MANCONF
+ Bool ReadManConfig();
+ #endif
+ 
  #define SECT_ERROR -1
  
  /*	Function Name: Man
***************
*** 69,79 ****
  
    ptr = getenv("MANPATH");
    if (ptr == NULL || streq(ptr , "") ) {
!     strcpy(manpath, SYSMANPATH);
  #ifdef LOCALMANPATH
!     strcat(manpath, ":");
!     strcat(manpath, LOCALMANPATH);
  #endif
    } else {
      strcpy(manpath, ptr);
    }
--- 74,89 ----
  
    ptr = getenv("MANPATH");
    if (ptr == NULL || streq(ptr , "") ) {
! #ifdef MANCONF
!     if (!ReadManConfig(manpath))
! #endif
!     {
!       strcpy(manpath, SYSMANPATH);
  #ifdef LOCALMANPATH
!       strcat(manpath, ":");
!       strcat(manpath, LOCALMANPATH);
  #endif
+     }
    } else {
      strcpy(manpath, ptr);
    }
***************
*** 112,118 ****
        else {
  	if ( ++sect >= num_alloced ) {
  	  num_alloced += SECTALLOC;
! 	  manual = (Manual *) realloc ( (char *) manual,
  				        (sizeof(Manual) * num_alloced));
  	  if (manual == NULL) 
  	    PrintError("Could not allocate memory for manual sections.");
--- 122,128 ----
        else {
  	if ( ++sect >= num_alloced ) {
  	  num_alloced += SECTALLOC;
! 	  manual = (Manual *) XtRealloc ( (char *) manual,
  				        (sizeof(Manual) * num_alloced));
  	  if (manual == NULL) 
  	    PrintError("Could not allocate memory for manual sections.");
***************
*** 141,147 ****
   * realloc manual to be minimum space necessary.
   */
  
!   manual = (Manual *) realloc( (char *) manual, (sizeof(Manual) * sect));
    if (manual == NULL) 
      PrintError("Could not allocate memory for manual sections.");
  
--- 151,157 ----
   * realloc manual to be minimum space necessary.
   */
  
!   manual = (Manual *) XtRealloc( (char *) manual, (sizeof(Manual) * sect));
    if (manual == NULL) 
      PrintError("Could not allocate memory for manual sections.");
  
***************
*** 368,374 ****
--- 378,388 ----
   */
  
    if ( (ptr = rindex(path, '.')) != NULL) 
+ #if !defined(SCO) && !defined(ISC)
      if (streq(ptr + 1, COMPRESSION_EXTENSION)) 
+ #else
+     if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL)
+ #endif
        *ptr = '\0';
    
    nentries = local_manual->nentries;
***************
*** 397,403 ****
--- 411,421 ----
   */
  
      if ( (ptr = rindex(full_name, '.')) != NULL) 
+ #if !defined(SCO) && !defined(ISC)
        if (streq(ptr + 1, COMPRESSION_EXTENSION)) 
+ #else
+       if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL)
+ #endif
  	*ptr = '\0';
      local_manual->entries[nentries] = StrAlloc(full_name);
      local_manual->entries_less_paths[nentries] = 
***************
*** 896,898 ****
--- 914,958 ----
  }
  
  #endif /* DEBUG */
+ 
+ #ifdef MANCONF
+ 
+ /*	Function Name: ReadManConfig
+  *	Description: Reads man.conf file used by BSD 4.4
+  *      Argument: manpath - char array to return path in.
+  *	Returns: TRUE if read was successful.
+  */
+ 
+ Bool
+ ReadManConfig(manpath)
+ 
+ char	manpath[];
+ 
+ {
+   FILE	*fp;
+   char	line[BUFSIZ];
+   char	*path;
+   Bool  firstpath = TRUE;
+ 
+   if (!(fp = fopen(MANCONF, "r")))
+     return(FALSE);
+ 
+   while (fgets(line, sizeof(line), fp)) {
+     path = strtok(line, " \t\n");
+     if (!path || *path == '#' || strcmp(path, "_default"))
+       continue;
+     while (path = strtok((char *)NULL, " \t\n")) {
+       if (firstpath) {
+         strcpy(manpath, path);
+         firstpath = FALSE;
+       }
+       else {
+         strcat(manpath, ":");
+         strcat(manpath, path);
+       }
+     }
+   }
+   fclose(fp);
+   return(!firstpath);
+ }
+ #endif /* MANCONF */
diff -c mit/clients/xman/misc.c:1.1.1.2 mit/clients/xman/misc.c:2.1
*** mit/clients/xman/misc.c:1.1.1.2	Sat Mar 12 00:44:18 1994
--- mit/clients/xman/misc.c	Sat Mar 12 00:44:18 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xman - X window system manual page display program.
   *
+  * $XFree86: mit/clients/xman/misc.c,v 2.1 1994/02/10 21:21:40 dawes Exp $
   * $XConsortium: misc.c,v 1.29 91/09/03 18:21:49 dave Exp $
   *
   * Copyright 1987, 1988 Massachusetts Institute of Technology
***************
*** 21,27 ****
--- 22,30 ----
  
  #include "globals.h"
  #include "vendor.h"
+ #if 0
  #include <X11/Xos.h> 		/* sys/types.h and unistd.h included in here */
+ #endif
  #include <sys/stat.h>
  #include <errno.h>
  #include <X11/Xaw/Dialog.h>
***************
*** 31,36 ****
--- 34,48 ----
  static Boolean UncompressNamed(), UncompressUnformatted();
  extern int errno;		/* error codes. */
  
+ #if defined(ISC) || defined(SCO)
+ static char *uncompress_format = NULL;
+ static char *uncompress_formats[] =
+ 	{  UNCOMPRESS_FORMAT_1,
+ 	   UNCOMPRESS_FORMAT_2,
+ 	   UNCOMPRESS_FORMAT_3
+ 	};
+ #endif
+ 
  /*	Function Name: PopupWarning
   *	Description: This function pops upa warning message.
   *	Arguments: string - the specific warning string.
***************
*** 182,187 ****
--- 194,202 ----
    char filename[BUFSIZ];
    char * entry = manual[section_num].entries[entry_num];
    int len_cat = strlen(CAT);
+ #if defined(ISC) || defined(SCO)
+   int i;
+ #endif
  
    temp = CreateManpageName(entry);
    sprintf(man_globals->manpage_title, "The current manual page is: %s.", temp);
***************
*** 201,210 ****
--- 216,239 ----
   * Then for compressed files in an uncompressed directory.
   */
  
+ #if !defined(ISC) && !defined(SCO)
    sprintf(filename, "%s/%s%s/%s.%s", path, CAT, 
  	  section + len_cat, page, COMPRESSION_EXTENSION);
+ #else
+   for(i = 0; i < strlen(COMPRESSION_EXTENSIONS); i++) {
+       sprintf(filename, "%s/%s%s/%s.%c", path, CAT,
+ 	      section + len_cat, page, COMPRESSION_EXTENSIONS[i]);
+       uncompress_format = uncompress_formats[i];
+ #ifdef DEBUG
+       printf("Trying .%c ...\n", COMPRESSION_EXTENSIONS[i]);
+ #endif
+ #endif
    if ( (file = Uncompress(man_globals, filename)) != NULL) 
      return(file);
+ 
+ #if defined(ISC) || defined(SCO)
+   }
+ #endif
  
  /*
   * And lastly files in a compressed directory.
diff -c mit/clients/xman/search.c:1.1.1.1 mit/clients/xman/search.c:1.3
*** mit/clients/xman/search.c:1.1.1.1	Sat Mar 12 00:44:19 1994
--- mit/clients/xman/search.c	Sat Mar 12 00:44:19 1994
***************
*** 1,6 ****
--- 1,7 ----
  /*
   * xman - X window system manual page display program.
   *
+  * $XFree86: mit/clients/xman/search.c,v 1.3 1993/03/27 08:42:44 dawes Exp $
   * $XConsortium: search.c,v 1.20 91/07/21 21:28:09 rws Exp $
   *
   * Copyright 1987, 1988 Massachusetts Institute of Technology
***************
*** 29,34 ****
--- 30,39 ----
  FILE * DoManualSearch();
  static int BEntrySearch();
  
+ #ifdef MANCONF
+ Bool ReadManConfig();
+ #endif
+ 
  /*	Function Name: MakeSearchWidget
   *	Description: This Function Creates the Search Widget.
   *	Arguments: man_globals - the pseudo globas for this manpage.
***************
*** 172,182 ****
  
    manpath=getenv("MANPATH");
    if (manpath == NULL || streq(manpath,"") ) {
!     strcpy(path,SYSMANPATH);
  #ifdef LOCALMANPATH
!     strcat(path,":");
!     strcat(path,LOCALMANPATH);
  #endif
    } else {
      strcpy(path,manpath);
    }
--- 177,192 ----
  
    manpath=getenv("MANPATH");
    if (manpath == NULL || streq(manpath,"") ) {
! #ifdef MANCONF
!     if (!ReadManConfig(path))
! #endif
!     {
!       strcpy(path,SYSMANPATH);
  #ifdef LOCALMANPATH
!       strcat(path,":");
!       strcat(path,LOCALMANPATH);
  #endif
+     }
    } else {
      strcpy(path,manpath);
    }
diff -c mit/clients/xman/vendor.c:1.1.1.1 mit/clients/xman/vendor.c:2.1
*** mit/clients/xman/vendor.c:1.1.1.1	Sat Mar 12 00:44:19 1994
--- mit/clients/xman/vendor.c	Sat Mar 12 00:44:19 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xman/vendor.c,v 2.1 1993/09/24 17:06:13 dawes Exp $ */
  
  /* Vendor-specific data structures and operations */
  
***************
*** 9,15 ****
      char *	suffix;
  } SectionNameRec;
  
! #ifdef SYSV
  
  static SectionNameRec SectionNames[] = {
      {"(1) User Commands",		"1"},
--- 10,16 ----
      char *	suffix;
  } SectionNameRec;
  
! #if defined(SYSV) || defined(SVR4)
  
  static SectionNameRec SectionNames[] = {
      {"(1) User Commands",		"1"},
***************
*** 24,29 ****
--- 25,60 ----
      {"(l) Local",			"l"},
      {"(n) New",				"n"},
      {"(o) Old",				"o"}
+ #ifdef SCO
+ 	,
+ 	{ "(ADM) System Administration", "ADM" },
+ 	{ "(ADMN) Network Administration", "ADMN" },
+ 	{ "(ADMP) Protocol Administration", "ADMP" },
+ 	{ "(C) Commands", "C" },
+ 	{ "(CMD) DOS Commands", "CMD" },
+ 	{ "(CP) Programming Commands", "CP" },
+ 	{ "(DOS) DOS Subroutines and Libraries", "DOS" },
+ 	{ "(F) File Formats", "F" },
+ 	{ "(HW) Hardware Dependant", "HW" },
+ 	{ "(K) Kernel Subroutines", "K" },
+ 	{ "(LOCAL) Local utilities for your system", "LOCAL" },
+ 	{ "(M) Miscellaneous", "M" },
+ 	{ "(NADM) NFS Administration", "NADM" },
+ 	{ "(NC) Network Commands", "NC" },
+ 	{ "(NF) Network File Formats", "NF" },
+ 	{ "(NS) Network Subroutines", "NS" },
+ 	{ "(NSL) Network Services", "NSL" },
+ 	{ "(S) Subroutines and Libraries", "S" },
+ 	{ "(SCO) Product Engineering Toolkit", "SCO" },
+ 	{ "(SFF) Socket File Formats", "SFF" },
+ 	{ "(STR) Streams", "STR" },
+ 	{ "(TC) Transport Layer Commands", "TC" },
+ 	{ "(X) X Man pages", "X" },
+ 	{ "(XNX) Xenix Subroutines, Commands and Libs", "XNX" },
+ 	{ "(XS) X11 Subroutines and Libraries", "XS" },
+ 	{ "(Xm) Motif Commands and Subroutines", "Xm" },
+ 	{ "(Xt) X Intrinsics", "Xt" }
+ #endif
  };
  
  #else
diff -c mit/clients/xman/vendor.h:1.1.1.1 mit/clients/xman/vendor.h:2.2
*** mit/clients/xman/vendor.h:1.1.1.1	Sat Mar 12 00:44:20 1994
--- mit/clients/xman/vendor.h	Sat Mar 12 00:44:20 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/xman/vendor.h,v 2.2 1994/02/10 21:21:43 dawes Exp $
   * $XConsortium: vendor.h,v 1.7 91/08/20 14:27:57 gildea Exp $
   *
   * Copyright 1991 Massachusetts Institute of Technology
***************
*** 16,21 ****
--- 17,24 ----
  
  /* Vendor-specific definitions */
  
+ #include <X11/Xos.h>
+ 
  #define SUFFIX "suffix"
  #define FOLD "fold"
  #define FOLDSUFFIX "foldsuffix"
***************
*** 35,44 ****
  #  define SEARCHDIR  MAN
  #endif
  
! #if ( defined(sgi) || defined(SYSV386) )
  # define SEARCHOTHER CAT
  #endif
  
  /*
   * The default manual page directory.
   *
--- 38,51 ----
  #  define SEARCHDIR  MAN
  #endif
  
! #if ( defined(sgi) || defined(SYSV386) || (BSD >= 199103) || defined(linux) )
  # define SEARCHOTHER CAT
  #endif
  
+ #if (BSD >= 199103)
+ # define MANCONF "/etc/man.conf"
+ #endif
+ 
  /*
   * The default manual page directory.
   *
***************
*** 50,62 ****
  #ifdef macII
  #  define SYSMANPATH "/usr/catman/u_man:/usr/catman/a_man"
  #endif /* macII */
! #ifdef SVR4
  #  define SYSMANPATH "/usr/share/man"
! #endif /* SVR4 */
  #ifdef hcx
  #  define SYSMANPATH "/usr/catman/local_man:/usr/catman/u_man:/usr/catman/a_man:/usr/catman/p_man:/usr/catman/ada_man"
  #endif /* hcx */
! #if defined(SYSV) && defined(SYSV386)
  #  define SYSMANPATH "/usr/catman/u_man:/usr/catman/p_man"
  #endif /* SYSV386 */
  #ifdef sgi
--- 57,69 ----
  #ifdef macII
  #  define SYSMANPATH "/usr/catman/u_man:/usr/catman/a_man"
  #endif /* macII */
! #if defined(SVR4) || (BSD >= 199103)
  #  define SYSMANPATH "/usr/share/man"
! #endif /* SVR4 || (BSD >= 199103) */
  #ifdef hcx
  #  define SYSMANPATH "/usr/catman/local_man:/usr/catman/u_man:/usr/catman/a_man:/usr/catman/p_man:/usr/catman/ada_man"
  #endif /* hcx */
! #if defined(SYSV) && defined(SYSV386) && !defined(SCO)
  #  define SYSMANPATH "/usr/catman/u_man:/usr/catman/p_man"
  #endif /* SYSV386 */
  #ifdef sgi
***************
*** 73,79 ****
   * Compression Definitions.
   */
  
! #if defined( macII ) || defined( hcx ) || (defined(SYSV) && defined(SYSV386)) || defined(sgi)
  #  define COMPRESSION_EXTENSION   "z"
  #  define UNCOMPRESS_FORMAT       "pcat %s > %s"
  #  define NO_COMPRESS		/* mac can't handle using pack as a filter and
--- 80,86 ----
   * Compression Definitions.
   */
  
! #if defined( macII ) || defined( hcx ) || (defined(SYSV) && defined(SYSV386) && !defined(ISC) && !defined(SCO)) || defined(sgi)
  #  define COMPRESSION_EXTENSION   "z"
  #  define UNCOMPRESS_FORMAT       "pcat %s > %s"
  #  define NO_COMPRESS		/* mac can't handle using pack as a filter and
***************
*** 84,92 ****
  #    define UNCOMPRESS_FORMAT     "ccat < %s > %s"
  #    define COMPRESS              "compact"
  #  else
! #    define COMPRESSION_EXTENSION "Z"
! #    define UNCOMPRESS_FORMAT     "zcat < %s > %s"
! #    define COMPRESS              "compress"
  #  endif /* UTEK */
  #endif /* macII, hcx, SYSV386, sgi */
  
--- 91,113 ----
  #    define UNCOMPRESS_FORMAT     "ccat < %s > %s"
  #    define COMPRESS              "compact"
  #  else
! #    if defined (ISC) || defined(SCO)
! #      define COMPRESSION_EXTENSION   "Z"	/* dummy */
! #      ifndef SCO
! #        define COMPRESSION_EXTENSIONS  "zZF"	/* pack, compress, freeze */
! #      else
! #        define COMPRESSION_EXTENSIONS  "zZ"	/* pack, compress */
! #      endif
! #      define UNCOMPRESS_FORMAT       uncompress_format
! #      define UNCOMPRESS_FORMAT_1     "pcat %s > %s"
! #      define UNCOMPRESS_FORMAT_2     "zcat < %s > %s"
! #      define UNCOMPRESS_FORMAT_3     "fcat < %s > %s"
! #      define NO_COMPRESS
! #    else
! #      define COMPRESSION_EXTENSION "Z"
! #      define UNCOMPRESS_FORMAT     "zcat < %s > %s"
! #      define COMPRESS              "compress"
! #    endif /* ISC */
  #  endif /* UTEK */
  #endif /* macII, hcx, SYSV386, sgi */
  
***************
*** 109,115 ****
  #if defined( ultrix )
  #  define FORMAT "| nroff -man"             /* The format command. */
  #else
! #  define FORMAT "| neqn | nroff -man"      /* The format command. */
  #endif
  
  /*
--- 130,147 ----
  #if defined( ultrix )
  #  define FORMAT "| nroff -man"             /* The format command. */
  #else
! #  if (BSD >= 199103)
! #    define FORMAT "| eqn | tbl | nroff -man"
! #  else
! #    ifdef linux
! #      define linux_GROFF		/* undef this to use nroff instead */
! #    endif /* linux */
! #    ifdef linux_GROFF
! #      define FORMAT "| geqn | gtbl | groff -Tascii -man"
! #    else
! #      define FORMAT "| neqn | nroff -man"      /* The format command. */
! #    endif /* linux_GROFF */
! #  endif
  #endif
  
  /*
***************
*** 123,129 ****
   * The Apple, Cray,, SYSV386, and HCX folks put the preformatted pages in the
   * "man" directories.
   */
! #  define CAT MAN
  #else
  #  define CAT "cat"
  #endif
--- 155,165 ----
   * The Apple, Cray,, SYSV386, and HCX folks put the preformatted pages in the
   * "man" directories.
   */
! #  ifdef SCO
! #    define CAT "cat."
! #  else
! #    define CAT MAN
! #  endif
  #else
  #  define CAT "cat"
  #endif
diff -c mit/clients/xmh/command.c:1.1.1.1 mit/clients/xmh/command.c:2.0
*** mit/clients/xmh/command.c:1.1.1.1	Sat Mar 12 00:44:23 1994
--- mit/clients/xmh/command.c	Sat Mar 12 00:44:23 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xmh/command.c,v 2.0 1993/12/18 11:41:23 dawes Exp $ */
  /* $XConsortium: command.c,v 2.44 91/07/16 20:33:52 converse Exp $ */
  
  /*
***************
*** 40,59 ****
  #ifdef _IBMR2
  #include <sys/select.h>
  #endif
  #endif
  
  /* number of user input events to queue before malloc */
  #define TYPEAHEADSIZE 20
  
! #ifdef macII
  #define vfork() fork()
  #endif /* macII */
  
- #if defined(SYSV) && !defined(hpux)
- #define vfork() fork()
- #endif /* SYSV and not hpux */
- 
- 
  #ifndef FD_SET
  #define NFDBITS         (8*sizeof(fd_set))
  #define FD_SETSIZE      NFDBITS
--- 41,62 ----
  #ifdef _IBMR2
  #include <sys/select.h>
  #endif
+ #ifdef ESIX
+ #include <lan/net_types.h>
  #endif
+ #endif
+ 
+ #ifndef X_NO_STRERROR
+ #include <string.h>
+ #endif
  
  /* number of user input events to queue before malloc */
  #define TYPEAHEADSIZE 20
  
! #if defined(macII) || (defined(SYSV) && !defined(hpux)) || defined(__OSF__)
  #define vfork() fork()
  #endif /* macII */
  
  #ifndef FD_SET
  #define NFDBITS         (8*sizeof(fd_set))
  #define FD_SETSIZE      NFDBITS
***************
*** 86,96 ****
  static void SystemError(text)
      char* text;
  {
      extern int sys_nerr;
      extern char* sys_errlist[];
      char msg[BUFSIZ];
!     sprintf( msg, "%s; errno = %d %s", text, errno, 
! 	     (errno < sys_nerr) ? sys_errlist[errno] : NULL );
      XtWarning( msg );
  }
  
--- 89,107 ----
  static void SystemError(text)
      char* text;
  {
+ #ifdef X_NO_STRERROR
      extern int sys_nerr;
      extern char* sys_errlist[];
+ #endif
+     char *s;
      char msg[BUFSIZ];
! 
! #ifdef X_NO_STRERROR
!     s = (errno < sys_nerr) ? sys_errlist[errno] : "";
! #else
!     s = strerror(errno);
! #endif
!     sprintf( msg, "%s; errno = %d %s", text, errno, s);
      XtWarning( msg );
  }
  
***************
*** 256,263 ****
  		readfds = fds;
                  if (childdone) break;
  DEBUG("blocking.\n")
! 		(void) select(num_fds, (int *) &readfds,
! 			  (int *) NULL, (int *) NULL, (struct timeval *) NULL);
  DEBUG1("unblocked; child%s done.\n", childdone ? "" : " not")
  		if (childdone) break;
  		if (!FD_ISSET(ConnectionNumber(theDisplay), &readfds))
--- 267,275 ----
  		readfds = fds;
                  if (childdone) break;
  DEBUG("blocking.\n")
! 		(void) select(num_fds, (fd_set *) &readfds,
! 			      (fd_set *) NULL, (fd_set *) NULL,
! 			      (struct timeval *) NULL);
  DEBUG1("unblocked; child%s done.\n", childdone ? "" : " not")
  		if (childdone) break;
  		if (!FD_ISSET(ConnectionNumber(theDisplay), &readfds))
diff -c mit/clients/xmh/miscfuncs.c:1.1.1.1 mit/clients/xmh/miscfuncs.c:1.3
*** mit/clients/xmh/miscfuncs.c:1.1.1.1	Sat Mar 12 00:44:24 1994
--- mit/clients/xmh/miscfuncs.c	Sat Mar 12 00:44:24 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xmh/miscfuncs.c,v 1.3 1993/03/27 08:51:42 dawes Exp $ */
  /* $XConsortium: miscfuncs.c,v 1.6 91/07/13 17:52:59 gildea Exp $ */
  
  #include <X11/Xos.h>
***************
*** 32,40 ****
--- 33,46 ----
   * real ftruncate doesn't.
   */
  
+ #ifndef __TYPES__
  #include <sys/types.h>
+ #define __TYPES__
+ #endif
  #include <sys/stat.h>
+ /*
  #include <fcntl.h>
+ */
  #include <stdio.h>
  
  #define CHUNKSIZE 1024
diff -c mit/clients/xmh/xmh.man:1.1.1.1 mit/clients/xmh/xmh.man:1.3
*** mit/clients/xmh/xmh.man:1.1.1.1	Sat Mar 12 00:44:25 1994
--- mit/clients/xmh/xmh.man	Sat Mar 12 00:44:25 1994
***************
*** 1,3 ****
--- 1,4 ----
+ .\" $XFree86: mit/clients/xmh/xmh.man,v 1.3 1993/03/27 08:51:47 dawes Exp $
  .\" $XConsortium: xmh.man,v 1.28 91/08/01 01:20:41 converse Exp $
  .TH XMH 1 "Release 5" "X Version 11"
  .SH NAME
***************
*** 314,320 ****
  View the last selected message.  If no messages are highlighted, view the
  current message.  If current message is already being viewed, view the
  first unmarked message before the current message.
! The corresponding action is \fBXmhViewPrevious()\fP.
  .PP
  .TP 18
  .B Delete
--- 315,321 ----
  View the last selected message.  If no messages are highlighted, view the
  current message.  If current message is already being viewed, view the
  first unmarked message before the current message.
! The corresponding action is \fBXmhViewPreviousMessage()\fP.
  .PP
  .TP 18
  .B Delete
diff -c mit/clients/xpr/Imakefile:1.1.1.1 mit/clients/xpr/Imakefile:2.0
*** mit/clients/xpr/Imakefile:1.1.1.1	Sat Mar 12 00:44:28 1994
--- mit/clients/xpr/Imakefile	Sat Mar 12 00:44:28 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/clients/xpr/Imakefile,v 2.0 1993/10/06 14:52:38 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.9 91/07/17 00:46:26 gildea Exp $
          DEPLIBS = $(DEPXMULIB) $(DEPXLIB)
  LOCAL_LIBRARIES = $(XMULIB) $(XLIB)
***************
*** 7,11 ****
             OBJS = xpr.o x2pmp.o x2jet.o
  
  ComplexProgramTarget(xpr)
! InstallScript(xdpr,$(BINDIR))
  InstallManPage(xdpr,$(MANDIR))
--- 8,16 ----
             OBJS = xpr.o x2pmp.o x2jet.o
  
  ComplexProgramTarget(xpr)
! 
! all:: xdpr
! 
! MakeScriptFromCpp(xdpr, -DBINDIR=$(BINDIR))
! InstallNamedProg(xdpr,xdpr,$(BINDIR))
  InstallManPage(xdpr,$(MANDIR))
diff -c /dev/null mit/clients/xpr/xdpr.cpp:2.0
*** /dev/null	Sat Mar 12 00:44:28 1994
--- mit/clients/xpr/xdpr.cpp	Sat Mar 12 00:44:28 1994
***************
*** 0 ****
--- 1,177 ----
+ XCOMM! /bin/sh
+ XCOMM Copyright 1985,1988 Massacusetts Institute of Technology.
+ XCOMM $XFree86: mit/clients/xpr/xdpr.cpp,v 2.0 1993/10/06 14:52:41 dawes Exp $
+ XCOMM $XConsortium: xdpr.script,v 1.9 91/06/30 19:20:16 rws Exp $
+ XCOMM origin: William Kucharski, Solbourne Computer, Inc. 3/24/90
+ XCOMM         translated from csh script xdpr.script "paul 4/12/88"
+ 
+ XCOMM initialize variables
+ 
+ display="$DISPLAY"
+ header=
+ bsdlprv=
+ lprv=
+ out=
+ svlprv=
+ trailer=
+ xprv=
+ xwdv=
+ 
+ usage="Usage: xdpr [filename] [-out filename ] \
+ [-display host:display] [[-Pprinter] | [-dprinter]] [-device devtype] \
+ [{-root | -id <id> | -name <name>}] [-nobdrs] [-xy] \
+ [-scale scale] [-height inches] [-width inches] [-left inches] \
+ [-top inches] [-split n] [-header string] [-trailer string] \
+ [-landscape] [-portrait] [-rv] [-compact] [-noff] [-frame] \
+ [-plane number] [-gray number] [-psfig] [-density dpi] \
+ [-cutoff level] [-noposition] [-gamma correction] [-render algorithm] \
+ [-slide] [-add value] [-help]"
+ 
+ XCOMM Guess if we are BSD or System V
+ 
+ if [ -x /usr/ucb/lpr -o -x /usr/bin/lpr -o -x /bin/lpr -o -x /usr/bsd/lpr ]
+ then
+ 	LP=lpr
+ 	BSD=1
+ elif [ -x /usr/bin/lp -o -x /bin/lp ]
+ then
+ 	LP=lp
+ 	BSD=0
+ else
+ 	LP=lpr
+ 	BSD=1
+ fi
+ 
+ if [ x"$XWINHOME" != x ]; then
+ 	if [ x"$XWINHOME" = x/usr ]; then
+ 		BIN_DIR=/usr/bin/X11
+ 	else
+ 		BIN_DIR=$XWINHOME/bin
+ 	fi
+ else
+ 	BIN_DIR=BINDIR
+ fi
+ 
+ XCOMM parse arguments...
+ 
+ while [ $1 ]; do
+ 	case "$1" in
+ 
+ XCOMM ...arguments interpreted by xdpr itself...
+ 
+ 	-help)
+ 		echo $usage;
+ 		exit 0;;
+ 
+ XCOMM ...arguments to xwd...
+ 
+ 	-nobdrs|-root|-xy|-frame)
+ 		xwdv="$xwdv $1";;
+ 	-display)
+ 		display=$2
+ 		xwdv="$xwdv $1 $2";
+ 		shift;;
+ 	-id|-name)
+ 		xwdv="$xwdv $1 $2";
+ 		shift;;
+ 	-out|-add)
+ 		out=true
+ 		xwdv="$xwdv $1 $2";
+ 		shift;;
+ 
+ XCOMM ...arguments to xpr...
+ 
+ 	-scale|-height|-width|-left|-top|-split|-device)
+ 		xprv="$xprv $1 $2";
+ 		shift;;
+ 	-plane|-gray|-density|-cutoff|-gamma|-render)
+ 		xprv="$xprv $1 $2";
+ 		shift;;
+ 	-header)
+ 		shift;
+ 		header="$1";;
+ 	-trailer)
+ 		shift;
+ 		trailer="$1";;
+ 	-landscape|-portrait|-rv|-compact|-noff|-psfig|-noposition|-slide)
+ 		xprv="$xprv $1";;
+ 
+ XCOMM ...arguments to lp[r]...
+ 
+ 	-P*|-#?*|-C?*|-J?*|-h|-m)
+ 		bsdlprv="$lprv $1";;
+ 
+ 	-d*|-H*|-q*|-n*|-o*|-w)
+ 		svlprv="$svlprv $1";;
+ 
+ XCOMM ...disallow other arguments; print usage message
+ 
+ 	-*)
+ 		echo "xdpr: Unknown option $1";
+ 		echo $usage;
+ 		exit 1;;
+ 
+ XCOMM ...input filename...
+ 
+ 	*)
+ 		if [ ! "$infile" ]; then
+ 			infile=true
+ 			xprv="$xprv $1"
+ 		else
+ 			echo "xdpr: Invalid argument "$1""
+ 			echo $usage			
+ 			exit 1
+ 		fi
+ 	esac
+ 	shift
+ done
+ 
+ XCOMM quit if there is no DISPLAY specified
+ 
+ if [ ! "$display" ]; then
+ 	echo "xdpr: DISPLAY variable must be set or a display specified."
+ 	exit
+ fi
+ 
+ XCOMM Command lines:
+ 
+ XCOMM Set up lp[r] options...
+ 
+ if [ $BSD -eq 0 ]
+ then
+ 	lprv=$svlprv
+ else
+ 	lprv=$bsdlprv
+ fi
+ 
+ XCOMM disallow concurrent input and  -out arguments
+ if [ "$out" -a "$infile" ]; then
+ 	echo "xdpr: -out <filename> cannot be used if an input file is also specified."
+ 	exit 0
+ fi
+ 
+ XCOMM dump only
+ if [ "$out" ]; then
+ 	if [ "$xprv" -o "$lprv" ]; then
+ 		echo "xdpr: The following arguments will be ignored:"
+ 		echo $xprv $lprv
+ 	fi
+ 	$BIN_DIR/xwd $xwdv
+ 	exit 0
+ fi
+ 
+ XCOMM print only 
+ if [ "$infile" ]; then
+ 	if [ "$xwdv" ]; then
+ 		echo "xdpr: The following arguments will be ignored:"
+ 		echo $xwdv
+ 	fi
+ 	$BIN_DIR/xpr -header "$header" -trailer "$trailer" $xprv | $LP $lprv
+ 	exit 0
+ fi
+ 
+ XCOMM dump & print (default)
+ $BIN_DIR/xwd $xwdv | $BIN_DIR/xpr -header "$header" -trailer "$trailer" $xprv | $LP $lprv
+ exit 0	
+ 
+ XCOMM EOF
diff -c mit/clients/xpr/xdpr.script:1.1.1.1 mit/clients/xpr/xdpr.script:removed
*** mit/clients/xpr/xdpr.script:1.1.1.1	Sat Mar 12 00:44:29 1994
--- mit/clients/xpr/xdpr.script	Sat Mar 12 00:44:29 1994
***************
*** 1,166 ****
- #! /bin/sh
- # Copyright 1985,1988 Massacusetts Institute of Technology.
- # $XConsortium: xdpr.script,v 1.9 91/06/30 19:20:16 rws Exp $
- # origin: William Kucharski, Solbourne Computer, Inc. 3/24/90
- #         translated from csh script xdpr.script "paul 4/12/88"
- 
- # initialize variables
- 
- display="$DISPLAY"
- header=
- bsdlprv=
- lprv=
- out=
- svlprv=
- trailer=
- xprv=
- xwdv=
- 
- usage="Usage: xdpr [filename] [-out filename ] \
- [-display host:display] [[-Pprinter] | [-dprinter]] [-device devtype] \
- [{-root | -id <id> | -name <name>}] [-nobdrs] [-xy] \
- [-scale scale] [-height inches] [-width inches] [-left inches] \
- [-top inches] [-split n] [-header string] [-trailer string] \
- [-landscape] [-portrait] [-rv] [-compact] [-noff] [-frame] \
- [-plane number] [-gray number] [-psfig] [-density dpi] \
- [-cutoff level] [-noposition] [-gamma correction] [-render algorithm] \
- [-slide] [-add value] [-help]"
- 
- # Guess if we are BSD or System V
- 
- if [ -x /usr/ucb/lpr -o -x /usr/bin/lpr -o -x /bin/lpr -o -x /usr/bsd/lpr ]
- then
- 	LP=lpr
- 	BSD=1
- elif [ -x /usr/bin/lp -o -x /bin/lp ]
- then
- 	LP=lp
- 	BSD=0
- else
- 	LP=lpr
- 	BSD=1
- fi
- 
- # parse arguments...
- 
- while [ $1 ]; do
- 	case "$1" in
- 
- # ...arguments interpreted by xdpr itself...
- 
- 	-help)
- 		echo $usage;
- 		exit 0;;
- 
- # ...arguments to xwd...
- 
- 	-nobdrs|-root|-xy|-frame)
- 		xwdv="$xwdv $1";;
- 	-display)
- 		display=$2
- 		xwdv="$xwdv $1 $2";
- 		shift;;
- 	-id|-name)
- 		xwdv="$xwdv $1 $2";
- 		shift;;
- 	-out|-add)
- 		out=true
- 		xwdv="$xwdv $1 $2";
- 		shift;;
- 
- # ...arguments to xpr...
- 
- 	-scale|-height|-width|-left|-top|-split|-device)
- 		xprv="$xprv $1 $2";
- 		shift;;
- 	-plane|-gray|-density|-cutoff|-gamma|-render)
- 		xprv="$xprv $1 $2";
- 		shift;;
- 	-header)
- 		shift;
- 		header="$1";;
- 	-trailer)
- 		shift;
- 		trailer="$1";;
- 	-landscape|-portrait|-rv|-compact|-noff|-psfig|-noposition|-slide)
- 		xprv="$xprv $1";;
- 
- # ...arguments to lp[r]...
- 
- 	-P*|-#?*|-C?*|-J?*|-h|-m)
- 		bsdlprv="$lprv $1";;
- 
- 	-d*|-H*|-q*|-n*|-o*|-w)
- 		svlprv="$svlprv $1";;
- 
- # ...disallow other arguments; print usage message
- 
- 	-*)
- 		echo "xdpr: Unknown option $1";
- 		echo $usage;
- 		exit 1;;
- 
- # ...input filename...
- 
- 	*)
- 		if [ ! "$infile" ]; then
- 			infile=true
- 			xprv="$xprv $1"
- 		else
- 			echo "xdpr: Invalid argument "$1""
- 			echo $usage			
- 			exit 1
- 		fi
- 	esac
- 	shift
- done
- 
- # quit if there is no DISPLAY specified
- 
- if [ ! "$display" ]; then
- 	echo "xdpr: DISPLAY variable must be set or a display specified."
- 	exit
- fi
- 
- # Command lines:
- 
- # Set up lp[r] options...
- 
- if [ $BSD -eq 0 ]
- then
- 	lprv=$svlprv
- else
- 	lprv=$bsdlprv
- fi
- 
- # disallow concurrent input and  -out arguments
- if [ "$out" -a "$infile" ]; then
- 	echo "xdpr: -out <filename> cannot be used if an input file is also specified."
- 	exit 0
- fi
- 
- # dump only
- if [ "$out" ]; then
- 	if [ "$xprv" -o "$lprv" ]; then
- 		echo "xdpr: The following arguments will be ignored:"
- 		echo $xprv $lprv
- 	fi
- 	/usr/bin/X11/xwd $xwdv
- 	exit 0
- fi
- 
- # print only 
- if [ "$infile" ]; then
- 	if [ "$xwdv" ]; then
- 		echo "xdpr: The following arguments will be ignored:"
- 		echo $xwdv
- 	fi
- 	/usr/bin/X11/xpr -header "$header" -trailer "$trailer" $xprv | $LP $lprv
- 	exit 0
- fi
- 
- # dump & print (default)
- /usr/bin/X11/xwd $xwdv | /usr/bin/X11/xpr -header "$header" -trailer "$trailer" $xprv | $LP $lprv
- exit 0	
- 
- # EOF
--- 0 ----
diff -c mit/clients/xrdb/Imakefile:1.1.1.1 mit/clients/xrdb/Imakefile:1.2
*** mit/clients/xrdb/Imakefile:1.1.1.1	Sat Mar 12 00:44:31 1994
--- mit/clients/xrdb/Imakefile	Sat Mar 12 00:44:31 1994
***************
*** 1,5 ****
--- 1,14 ----
+ XCOMM $XFree86: mit/clients/xrdb/Imakefile,v 1.2 1993/03/20 06:08:34 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.7 91/07/17 00:46:42 gildea Exp $
+ #if CrossCompiling
+ #if Amoeba
+         DEFINES = -DCPP="\"/public/module/ack/lib/front/cpp\""
+ #else
+ 	DEFINES = -DCPP="\"/lib/cpp\""
+ #endif
+ #else /* !CrossCompiling */
          DEFINES = -DCPP="\"$(CPP)\""
+ #endif /* !CrossCompiling */
          DEPLIBS = $(DEPXMULIB) $(DEPXLIB)
  LOCAL_LIBRARIES = $(XMULIB) $(XLIB)
  
diff -c mit/clients/xterm/Imakefile:1.1.1.4 mit/clients/xterm/Imakefile:2.2
*** mit/clients/xterm/Imakefile:1.1.1.4	Sat Mar 12 00:44:36 1994
--- mit/clients/xterm/Imakefile	Sat Mar 12 00:44:36 1994
***************
*** 1,3 ****
--- 1,4 ----
+ XCOMM $XFree86: mit/clients/xterm/Imakefile,v 2.2 1993/11/13 05:13:21 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.56 92/03/11 17:35:22 gildea Exp $
  XCOMM
  XCOMM                         Attention xterm porters
***************
*** 20,39 ****
           PTYLIB = -lpucc
  #endif
  
   OSMAJORVERSION = OSMajorVersion
   OSMINORVERSION = OSMinorVersion
  
!    MAIN_DEFINES = -DUTMP $(TTYGROUPDEF) $(PUCCPTYDDEF) \
  		  -DOSMAJORVERSION=$(OSMAJORVERSION) \
  		  -DOSMINORVERSION=$(OSMINORVERSION)
!    MISC_DEFINES = /* -DALLOWLOGFILEEXEC */
  
            SRCS1 = button.c charproc.c cursor.c data.c input.c \
  		  main.c menu.c misc.c screen.c scrollbar.c tabs.c \
! 		  TekPrsTbl.c Tekproc.c util.c VTPrsTbl.c
            OBJS1 = main.o input.o charproc.o cursor.o util.o tabs.o \
  		  screen.o scrollbar.o button.o Tekproc.o misc.o \
! 		  VTPrsTbl.o TekPrsTbl.o data.o menu.o
            SRCS2 = resize.c
            OBJS2 = resize.o
             SRCS = $(SRCS1) $(SRCS2)
--- 21,51 ----
           PTYLIB = -lpucc
  #endif
  
+ #ifdef XtermLogFlags
+   XTERMLOGFLAGS = XtermLogFlags
+ #endif
+ 
   OSMAJORVERSION = OSMajorVersion
   OSMINORVERSION = OSMinorVersion
  
! #ifndef Amoeba
!         UTMPDEF = -DUTMP
! #else
!        EXTRASRC = ttysvr.c
!        EXTRAOBJ = ttysvr.o
! #endif
!    MAIN_DEFINES = $(UTMPDEF) $(TTYGROUPDEF) $(PUCCPTYDDEF) \
  		  -DOSMAJORVERSION=$(OSMAJORVERSION) \
  		  -DOSMINORVERSION=$(OSMINORVERSION)
!    MISC_DEFINES = 
!         DEFINES = $(XTERMLOGFLAGS)
  
            SRCS1 = button.c charproc.c cursor.c data.c input.c \
  		  main.c menu.c misc.c screen.c scrollbar.c tabs.c \
! 		  TekPrsTbl.c Tekproc.c util.c VTPrsTbl.c $(EXTRASRC)
            OBJS1 = main.o input.o charproc.o cursor.o util.o tabs.o \
  		  screen.o scrollbar.o button.o Tekproc.o misc.o \
! 		  VTPrsTbl.o TekPrsTbl.o data.o menu.o $(EXTRAOBJ)
            SRCS2 = resize.c
            OBJS2 = resize.o
             SRCS = $(SRCS1) $(SRCS2)
***************
*** 59,67 ****
  
  AllTarget($(PROGRAMS))
  
! SpecialObjectRule(main.o,NullParameter,$(MAIN_DEFINES))
! SpecialObjectRule(misc.o,NullParameter,$(MISC_DEFINES))
! SpecialObjectRule(charproc.o,NullParameter,$(MISC_DEFINES))
  
  #if InstallXtermSetUID
  SetUIDProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),XawClientLibs,$(TERMCAPLIB) $(PTYLIB))
--- 71,79 ----
  
  AllTarget($(PROGRAMS))
  
! SpecialObjectRule(main.o,main.c,$(MAIN_DEFINES))
! SpecialObjectRule(misc.o,misc.c,$(MISC_DEFINES))
! SpecialObjectRule(charproc.o,charproc.c,$(MISC_DEFINES))
  
  #if InstallXtermSetUID
  SetUIDProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),XawClientLibs,$(TERMCAPLIB) $(PTYLIB))
diff -c mit/clients/xterm/Tekproc.c:1.1.1.2 mit/clients/xterm/Tekproc.c:2.1
*** mit/clients/xterm/Tekproc.c:1.1.1.2	Sat Mar 12 00:44:39 1994
--- mit/clients/xterm/Tekproc.c	Sat Mar 12 00:44:39 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/xterm/Tekproc.c,v 2.1 1993/11/13 04:22:55 dawes Exp $
   * $XConsortium: Tekproc.c,v 1.112 93/02/25 17:17:40 gildea Exp $
   *
   * Warning, there be crufty dragons here.
***************
*** 46,51 ****
--- 47,56 ----
  #include <stdio.h>
  #include <errno.h>
  #include <setjmp.h>
+ #ifdef _MINIX
+ #include <time.h>
+ #include <assert.h>
+ #endif /* _MINIX */
  #include <signal.h>
  
  /*
***************
*** 637,644 ****
--- 642,652 ----
  
  static int rcnt;
  static char *rptr;
+ #ifndef _MINIX
  static int Tselect_mask;
+ #endif
  
+ #ifndef _MINIX
  static int Tinput()
  {
  	register TScreen *screen = &term->screen;
***************
*** 673,684 ****
--- 681,705 ----
  			(void) select (max_plus1, &Tselect_mask, (int *) NULL,
  				       (int *) NULL, &crocktimeout);
  #endif
+ #ifndef AMOEBA
  			if(Tselect_mask & pty_mask) {
+ #else
+ 			/* XXX resolve polling since it wastes CPU cycles */
+ 			if ((Tbcnt = cb_full(screen->tty_outq)) > 0) {
+ #endif /* AMOEBA */
  #ifdef ALLOWLOGGING
  				if(screen->logging)
  					FlushLog(screen);
  #endif
+ #ifndef AMOEBA
  				Tbcnt = read(screen->respond, (char *)(Tbptr = Tbuffer), BUF_SIZE);
+ #else
+ 				Tbptr = Tbuffer;
+ 				if ((Tbcnt = cb_gets(screen->tty_outq, Tbptr, Tbcnt, BUF_SIZE)) == 0) {
+ 					errno = EIO;
+ 					Tbcnt = -1;
+ 				}
+ #endif /* AMOEBA */
  				if(Tbcnt < 0) {
  					if(errno == EIO)
  						Cleanup (0);
***************
*** 704,716 ****
  				TCursorToggle(TOGGLE);
  				Ttoggled = FALSE;
  			}
  			if(QLength(screen->display))
  				Tselect_mask = X_mask;
  			else {
  				XFlush(screen->display);
  				Tselect_mask = Select_mask;
! 				if((i = select(max_plus1, &Tselect_mask,
! 					(int *)NULL, (int *)NULL,
  					(struct timeval *)NULL)) < 0){
  					if (errno != EINTR)
  						SysError(ERROR_TSELECT);
--- 725,739 ----
  				TCursorToggle(TOGGLE);
  				Ttoggled = FALSE;
  			}
+ #ifndef AMOEBA
  			if(QLength(screen->display))
  				Tselect_mask = X_mask;
  			else {
  				XFlush(screen->display);
  				Tselect_mask = Select_mask;
! 				if((i = select(max_plus1,
! 					(fd_set *)&Tselect_mask,
! 					(fd_set *)NULL, (fd_set *)NULL,
  					(struct timeval *)NULL)) < 0){
  					if (errno != EINTR)
  						SysError(ERROR_TSELECT);
***************
*** 722,727 ****
--- 745,768 ----
  				if(Tbcnt > 0)
  					goto again;
  			}
+ #else
+ 			XFlush(screen->display);
+ 			i = _XAmSelect(ConnectionNumber(screen->display), 1);
+ 			/* if there are X events already in our queue,
+ 			   it counts as being readable */
+ 			if (QLength(screen->display) || i > 0) {
+ 				xevents();
+ 				continue;
+ 			} else if (i < 0) {
+ 				extern int exiting;
+ 				if (errno != EINTR && !exiting)
+ 					SysError(ERROR_SELECT);
+ 			}
+ 			if (Tbcnt > 0)
+ 				goto again;
+ 			if (cb_full(screen->tty_outq) <= 0)
+ 				SleepMainThread();
+ #endif /* AMOEBA */
  		}
  		Tbcnt--;
  		if (!Ttoggled && curstate == Talptable) {
***************
*** 744,749 ****
--- 785,975 ----
  	tek->count++;
  	return(*tek->ptr++ = *Tbptr++);
  }
+ #else /* _MINIX */
+ static int Tinput()
+ {
+ 	register TScreen *screen = &term->screen;
+ 	register int i, x_fd;
+ 	register TekLink *tek;
+ 	asio_fd_set_t asio_bits;
+ 	fwait_t fw;
+ 
+ 	if(Tpushback > Tpushb)
+ 		return(*--Tpushback);
+ 	if(TekRefresh) {
+ 		if(rcnt-- > 0)
+ 			return(*rptr++);
+ 		if(tek = TekRefresh->next) {
+ 			TekRefresh = tek;
+ 			rptr = tek->data;
+ 			rcnt = tek->count - 1;
+ 			TekSetFontSize(tek->fontsize);
+ 			return(*rptr++);
+ 		}
+ 		TekRefresh = (TekLink *)0;
+ 		longjmp(Tekjump, 1);
+ 	}
+ again:
+ 	if(Tbcnt-- <= 0) 
+ 	{
+ 		if(nplot > 0)	/* flush line Tbuffer */
+ 			TekFlush();
+ 		for( ; ; )
+ 		{
+ 			if (!read_inprogress)
+ 			{
+ 				if (screen->logging)
+ 					FlushLog(screen);
+ 				Tbcnt = read(screen->respond, 
+ 					(char *)(Tbptr = Tbuffer), BUF_SIZE);
+ 				if (Tbcnt < 0) 
+ 				{
+ 					if (errno == EIO)
+ 						Cleanup (0);
+ 					else if (errno == EINPROGRESS)
+ 						read_inprogress= True;
+ 					else
+ 						Panic(
+ 				"Tinput: read returned unexpected error (%d)\n",
+ 							errno);
+ 				}
+ 				else if (Tbcnt == 0)
+ 					Cleanup(0);/* Minix returns 0 on eof */
+ 				else 
+ 				{
+ 					/* read from pty was successful */
+ 					break;
+ 				}
+ 			}
+ 			if (Ttoggled && curstate == Talptable)
+ 			{
+ 				TCursorToggle(TOGGLE);
+ 				Ttoggled = FALSE;
+ 			}
+ 
+ 			XFlush(screen->display); 
+ 					/* always flush writes before waiting */
+ 
+ 			ASIO_FD_ZERO(&asio_bits);
+ 			x_fd= MNX_XConnectionNumber(screen->display);
+ 			if (x_fd == -1 || QLength(screen->display))
+ 			{
+ 				/* More events to process */
+ 				xevents();
+ 				continue;
+ 			}
+ 			ASIO_FD_SET(x_fd, ASIO_READ, &asio_bits);
+ 			if (v_inprogress)
+ 			{
+ 				/* Write in progress */
+ 				ASIO_FD_SET(v_fd, ASIO_WRITE, &asio_bits);
+ 			}
+ 			if (read_inprogress)
+ 			{
+ 				/* Read in progress */
+ 				ASIO_FD_SET(screen->respond, ASIO_READ, 
+ 								&asio_bits);
+ 			}
+ 			fw.fw_flags= 0;
+ 			fw.fw_bits= asio_bits.afds_bits;
+ 			fw.fw_maxfd= ASIO_FD_SETSIZE;
+ 
+ 			do
+ 			{
+ 				i= fwait(&fw);
+ 				if (i == -1)
+ 					break;
+ 				if (fw.fw_fd == v_fd && 
+ 						fw.fw_operation == ASIO_WRITE)
+ 				{
+ 					assert(v_inprogress);
+ 					v_inprogress= False;
+ 					if (fw.fw_result > 0)
+ 						v_prim.v_bufbeg += fw.fw_result;
+ 					else
+ 						fprintf(stderr, 
+ 							"Write failed: %s\n", 
+ 							fw.fw_result == 0 ? 
+ 							"eof" :
+ 							strerror(fw.fw_errno));
+ 					v_write(v_fd, NULL, 0);
+ 				}
+ 				else if (fw.fw_fd == x_fd && 
+ 						fw.fw_operation == ASIO_READ)
+ 			
+ 				{
+ 					XReplyReadStatus(screen->display, 
+ 						fw.fw_result, fw.fw_errno);
+ 					xevents();
+ 				}
+ 				else if (fw.fw_fd == screen->respond && 
+ 						fw.fw_operation == ASIO_READ)
+ 				{
+ 					read_inprogress= False;
+ 					Tbcnt= fw.fw_result;
+ 					if (Tbcnt < 0) 
+ 					{
+ 						errno= fw.fw_errno;
+ 						if (errno == EIO)
+ 							Cleanup (0);
+ 						else
+ 							Panic(
+ 			      "input: read returned unexpected error (%d)\n",
+ 								errno);
+ 					}
+ 					else if (Tbcnt == 0)
+ 						Panic(
+ 					"input: read returned zero\n", 0);
+ 					else 
+ 					{
+ 						/* read from pty was 
+ 						   successful */
+ 					}
+ 				}
+ 			else
+ 				Panic(
+ 				"fwait returned strange, fd/op combination", 0);
+ 			}
+ 			while(fw.fw_flags & FWF_MORE);
+ 
+ 			if (i == -1 && errno != EINTR && errno != EAGAIN)
+ 				SysError(ERROR_SELECT);
+ 			if (Tbcnt > 0)
+ 				break;
+ 		}
+ 		Tbcnt--;
+ 		if (!Ttoggled && curstate == Talptable)
+ 		{
+ 			TCursorToggle(TOGGLE);
+ 			Ttoggled = TRUE;
+ 		}
+ 	}
+ 	if (!screen->output_eight_bits) 
+ 	{
+ 		register int bc = Tbcnt;
+ 		register Char *b = Tbptr;
+ 
+ 		for (; bc > 0; bc--, b++) {
+ 			*b &= (Char) 0x7f;
+ 		}
+ 	}
+ 	tek = TekRecord;
+ 	if(tek->count >= TEK_LINK_BLOCK_SIZE
+ 		|| tek->fontsize != screen->cur.fontsize)
+ 	{
+ 		if((TekRecord = tek->next = (TekLink *)malloc(sizeof(TekLink)))
+ 			== (TekLink *)0)
+ 			Panic("Tinput: malloc error (%d)\n", errno);
+ 		tek = tek->next;
+ 		tek->next = (TekLink *)0;
+ 		tek->fontsize = screen->cur.fontsize;
+ 		tek->count = 0;
+ 		tek->ptr = tek->data;
+ 	}
+ 	tek->count++;
+ 	return(*tek->ptr++ = *Tbptr++);
+ }
+ #endif /* _MINIX */
  
  /* this should become the Tek Widget's Resize proc */
  static void TekConfigure(w)
diff -c mit/clients/xterm/XTerm.ad:1.1.1.1 mit/clients/xterm/XTerm.ad:1.5
*** mit/clients/xterm/XTerm.ad:1.1.1.1	Sat Mar 12 00:44:42 1994
--- mit/clients/xterm/XTerm.ad	Sat Mar 12 00:44:42 1994
***************
*** 1,3 ****
--- 1,4 ----
+ ! $XFree86: mit/clients/xterm/XTerm.ad,v 1.5 1993/03/27 08:52:51 dawes Exp $
  *SimpleMenu*BackingStore: NotUseful
  *SimpleMenu*menuLabel.font: -adobe-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-*
  *SimpleMenu*menuLabel.vertSpace: 	100
***************
*** 76,78 ****
--- 77,88 ----
  *tek4014*font3: 6x13
  *tek4014*fontSmall: 6x10
  
+ ! default colours for color_xterm
+ *VT100*color0: black
+ *VT100*color1: red
+ *VT100*color2: green
+ *VT100*color3: yellow
+ *VT100*color4: blue
+ *VT100*color5: magenta
+ *VT100*color6: cyan
+ *VT100*color7: white
diff -c mit/clients/xterm/charproc.c:1.1.1.3 mit/clients/xterm/charproc.c:2.0
*** mit/clients/xterm/charproc.c:1.1.1.3	Sat Mar 12 00:44:44 1994
--- mit/clients/xterm/charproc.c	Sat Mar 12 00:44:44 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * $XFree86: mit/clients/xterm/charproc.c,v 2.0 1993/11/13 04:22:59 dawes Exp $
   * $XConsortium: charproc.c,v 1.176.1.1 93/11/03 17:24:20 gildea Exp $
   */
  
***************
*** 46,51 ****
--- 47,55 ----
  #include <errno.h>
  #include <setjmp.h>
  #include <ctype.h>
+ #ifdef _MINIX
+ #include <assert.h>
+ #endif /* _MINIX */
  
  /*
   * Check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
***************
*** 1101,1115 ****
--- 1105,1126 ----
  }
  
  
+ #ifndef _MINIX
  static char *v_buffer;		/* pointer to physical buffer */
  static char *v_bufstr = NULL;	/* beginning of area to write */
  static char *v_bufptr;		/* end of area to write */
  static char *v_bufend;		/* end of physical buffer */
  #define	ptymask()	(v_bufptr > v_bufstr ? pty_mask : 0)
+ #else /* _MINIX */
+ struct v_buf v_prim= { NULL }, v_sec= { NULL };
+ int v_inprogress= False;
+ int v_fd;
+ #endif /* _MINIX */
  
  /* Write data to the pty as typed by the user, pasted with the mouse,
     or generated by us in response to a query ESC sequence. */
  
+ #ifndef _MINIX
  v_write(f, d, len)
      int f;
      char *d;
***************
*** 1131,1138 ****
--- 1142,1154 ----
  	fprintf(stderr, "\n");
  #endif
  
+ #ifndef AMOEBA
  	if ((1 << f) != pty_mask)
  		return(write(f, d, len));
+ #else
+ 	if (term->screen.respond != f)
+ 		return(write(f, d, len));
+ #endif
  
  	/*
  	 * Append to the block we already have.
***************
*** 1203,1211 ****
--- 1219,1234 ----
  #define MAX_PTY_WRITE 128	/* 1/2 POSIX minimum MAX_INPUT */
  
  	if (v_bufptr > v_bufstr) {
+ #ifndef AMOEBA
  	    riten = write(f, v_bufstr, v_bufptr - v_bufstr <= MAX_PTY_WRITE ?
  			  	       v_bufptr - v_bufstr : MAX_PTY_WRITE);
  	    if (riten < 0) {
+ #else
+ 	    riten = v_bufptr - v_bufstr <= MAX_PTY_WRITE ?
+ 		v_bufptr - v_bufstr : MAX_PTY_WRITE;
+ 	    if (cb_puts(term->screen.tty_inq, v_bufstr, riten) != 0) {
+ #endif /* AMOEBA */
+ 
  #ifdef DEBUG
  		perror("write");
  #endif
***************
*** 1246,1256 ****
--- 1269,1361 ----
  	}
  	return(c);
  }
+ #else /* _MINIX */
+ v_write(f, d, len)
+     int f;
+     char *d;
+     int len;
+ {
+ 	struct v_buf tmp_buf;
+ 	char *buf;
+ 	int r;
+ 
+ 	if (len != 0)
+ 	{
+ 		/* Let's try to append some data to v_sec. */
+ 		if (v_sec.v_buffer == NULL)
+ 		{
+ 			v_sec.v_buffer= XtMalloc(len);
+ 			v_sec.v_bufbeg= v_sec.v_bufend= 0;
+ 			v_sec.v_bufsiz= len;
+ 		}
+ 		else if (v_sec.v_bufsiz - v_sec.v_bufend < len)
+ 		{
+ 			buf= realloc(v_sec.v_buffer, v_sec.v_bufend + len);
+ 			if (buf)
+ 			{
+ 				v_sec.v_buffer= buf;
+ 				v_sec.v_bufsiz = v_sec.v_bufend + len;
+ 			}
+ 			else
+ 			{
+ 				len = v_sec.v_bufsiz - v_sec.v_bufend;
+ 			}
+ 		}
+ 		if (len)
+ 		{
+ 			memcpy(v_sec.v_buffer + v_sec.v_bufend, d, len);
+ 			v_sec.v_bufend += len;
+ 		}
+ 	}
+ 	if (v_inprogress)
+ 		return;
+ 
+ 	/* Let's move v_sec to v_prim */
+ 	tmp_buf= v_prim;
+ 	v_prim= v_sec;
+ 	v_sec= tmp_buf;
+ 	if (v_sec.v_buffer)
+ 	{
+ 		assert(v_sec.v_bufbeg == v_sec.v_bufend);
+ 		v_sec.v_bufbeg= v_sec.v_bufend= 0;
+ 		if (v_sec.v_bufsiz > 1024)
+ 		{
+ 			XtFree(v_sec.v_buffer);
+ 			v_sec.v_buffer= NULL;
+ 		}
+ 	}
+ 	while (v_prim.v_bufbeg < v_prim.v_bufend)
+ 	{
+ 		r= write(f, v_prim.v_buffer + v_prim.v_bufbeg, 
+ 			v_prim.v_bufend - v_prim.v_bufbeg);
+ 		if (r > 0)
+ 		{
+ 			v_prim.v_bufbeg += r;
+ 			continue;
+ 		}
+ 		if (r == -1 && errno == EINPROGRESS)
+ 		{
+ 			v_inprogress= True;
+ 			v_fd= f;
+ 			return;
+ 		}
+ 		fprintf(stderr, "Write failed: %s\n", r == 0 ? "eof" :
+ 							strerror(errno));
+ 		return;
+ 	}
+ 	assert(v_prim.v_bufbeg == v_prim.v_bufend);
+ }
+ #endif /* _MINIX */
  
+ #ifndef _MINIX
  static int select_mask;
  static int write_mask;
+ #else
+ int read_inprogress= False;
+ #endif
  static int pty_read_bytes;
  
+ #ifndef _MINIX
  in_put()
  {
      register TScreen *screen = &term->screen;
***************
*** 1258,1269 ****
--- 1363,1386 ----
      static struct timeval select_timeout;
  
      for( ; ; ) {
+ #ifndef AMOEBA
  	if (select_mask & pty_mask && eventMode == NORMAL) {
+ #else
+ 	if ((bcnt = cb_full(screen->tty_outq)) > 0 && eventMode == NORMAL) {
+ #endif /* AMOEBA */
  #ifdef ALLOWLOGGING
  	    if (screen->logging)
  		FlushLog(screen);
  #endif
+ #ifndef AMOEBA
  	    bcnt = read(screen->respond, (char *)(bptr = buffer), BUF_SIZE);
+ #else
+ 	    bptr = buffer;
+ 	    if ((bcnt = cb_gets(screen->tty_outq, bptr, bcnt, BUF_SIZE)) == 0) {
+ 		errno = EIO;
+ 		bcnt = -1;
+ 	    }
+ #endif /* AMOEBA */
  	    if (bcnt < 0) {
  		if (errno == EIO)
  		    Cleanup (0);
***************
*** 1313,1318 ****
--- 1430,1436 ----
  
  	XFlush(screen->display); /* always flush writes before waiting */
  
+ #ifndef AMOEBA
  	/* Update the masks and, unless X events are already in the queue,
  	   wait for I/O to be possible. */
  	select_mask = Select_mask;
***************
*** 1319,1326 ****
  	write_mask = ptymask();
  	select_timeout.tv_sec = 0;
  	select_timeout.tv_usec = 0;
! 	i = select(max_plus1, &select_mask, &write_mask, (int *)NULL,
! 		   QLength(screen->display) ? &select_timeout
  		   : (struct timeval *) NULL);
  	if (i < 0) {
  	    if (errno != EINTR)
--- 1437,1444 ----
  	write_mask = ptymask();
  	select_timeout.tv_sec = 0;
  	select_timeout.tv_usec = 0;
! 	i = select(max_plus1, (fd_set *)&select_mask, (fd_set *)&write_mask,
! 		   (fd_set *)NULL, QLength(screen->display) ? &select_timeout
  		   : (struct timeval *) NULL);
  	if (i < 0) {
  	    if (errno != EINTR)
***************
*** 1338,1348 ****
--- 1456,1636 ----
  	if (QLength(screen->display) || (select_mask & X_mask)) {
  	    xevents();
  	}
+ #else
+ 	i = _XAmSelect(ConnectionNumber(screen->display), 1);
+ 	/* if there are X events already in our queue,
+ 	   it counts as being readable */
+ 	if (QLength(screen->display) || i > 0) {
+ #ifdef DEBUG
+ 	    if (debug) printf("Xterm: before xevents\n");
+ #endif
+ 	    xevents();
+ 	    continue;
+ 	} else if (i < 0) {
+ 	    extern int exiting;
+ 	    if (errno != EINTR && !exiting)
+ 		SysError(ERROR_SELECT);
+     }
+ 	if (cb_full(screen->tty_outq) <= 0)
+ 	    SleepMainThread();
+ #endif /* AMOEBA */
+ 
+     }
+     bcnt--;
+     return(*bptr++);
+ }
+ #else /* _MINIX */
+ in_put()
+ {
+     register TScreen *screen = &term->screen;
+     register int i, x_fd;
+     asio_fd_set_t asio_bits;
+     fwait_t fw;
+ 
+     for( ; ; ) {
+ 	if (!read_inprogress && pty_read_bytes < 4096 && eventMode == NORMAL) {
+ 	    if (screen->logging)
+ 		FlushLog(screen);
+ 	    bcnt = read(screen->respond, (char *)(bptr = buffer), BUF_SIZE);
+ 	    if (bcnt < 0) {
+ 		if (errno == EIO)
+ 		    Cleanup (0);
+ 		else if (errno == EINPROGRESS)
+ 			read_inprogress= True;
+ 		else
+ 		    Panic(
+ 			  "input: read returned unexpected error (%d)\n",
+ 			  errno);
+ 	    } else if (bcnt == 0)
+ 		Cleanup(0);	/* Minix returns 0 on eof */
+ 	    else {
+ 		/* read from pty was successful */
+ 		if ( screen->scrollWidget && screen->scrollttyoutput &&
+ 		     screen->topline < 0)
+ 		    WindowScroll(screen, 0);  /* Scroll to bottom */
+ 
+ 		/* stop speed reading at some point to look for X stuff */
+ 		/* (4096 is just a random large number.) */
+ 		pty_read_bytes += bcnt;
+ 		break;
+ 	    }
+ 	}
+ 	/* update the screen */
+ 	if (screen->scroll_amt)
+ 	    FlushScroll(screen);
+ 	if (screen->cursor_set && (screen->cursor_col != screen->cur_col
+ 				   || screen->cursor_row != screen->cur_row)) {
+ 	    if (screen->cursor_state)
+ 		HideCursor();
+ 	    ShowCursor();
+ 	} else if (screen->cursor_set != screen->cursor_state) {
+ 	    if (screen->cursor_set)
+ 		ShowCursor();
+ 	    else
+ 		HideCursor();
+ 	}
+ 
+ 	XFlush(screen->display); /* always flush writes before waiting */
+ 
+ 	ASIO_FD_ZERO(&asio_bits);
+ 	x_fd= MNX_XConnectionNumber(screen->display);
+ 	if (x_fd == -1 || QLength(screen->display))
+ 	{
+ 		/* More events to process */
+ 		xevents();
+ 		continue;
+ 	}
+ 	ASIO_FD_SET(x_fd, ASIO_READ, &asio_bits);
+ 	if (v_inprogress)
+ 	{
+ 		/* Write in progress */
+ 		ASIO_FD_SET(v_fd, ASIO_WRITE, &asio_bits);
+ 	}
+ 	if (read_inprogress)
+ 	{
+ 		/* Read in progress */
+ 		ASIO_FD_SET(screen->respond, ASIO_READ, &asio_bits);
+ 	}
+ 	fw.fw_flags= 0;
+ 	if (pty_read_bytes >= 4096)
+ 		fw.fw_flags |= FWF_NONBLOCK;
+ 	fw.fw_bits= asio_bits.afds_bits;
+ 	fw.fw_maxfd= ASIO_FD_SETSIZE;
+ 
+ 	do
+ 	{
+ 		i= fwait(&fw);
+ 		if (i == -1)
+ 			break;
+ 		if (fw.fw_fd == v_fd && fw.fw_operation == ASIO_WRITE)
+ 		{
+ 			assert(v_inprogress);
+ 			v_inprogress= False;
+ 			if (fw.fw_result > 0)
+ 				v_prim.v_bufbeg += fw.fw_result;
+ 			else
+ 				fprintf(stderr, "Write failed: %s\n", 
+ 						    fw.fw_result == 0 ? "eof" :
+ 							strerror(fw.fw_errno));
+ 			v_write(v_fd, NULL, 0);
+ 		}
+ 		else if (fw.fw_fd == x_fd && fw.fw_operation == ASIO_READ)
+ 		{
+ 			XReplyReadStatus(screen->display, fw.fw_result, 
+ 								fw.fw_errno);
+ 			xevents();
+ 		}
+ 		else if (fw.fw_fd == screen->respond && 
+ 						fw.fw_operation == ASIO_READ)
+ 		{
+ 		    read_inprogress= False;
+ 		    bcnt= fw.fw_result;
+ 		    if (bcnt < 0) {
+ 			errno= fw.fw_errno;
+ 			if (errno == EIO)
+ 			    Cleanup (0);
+ 			else
+ 			    Panic(
+ 			      "input: read returned unexpected error (%d)\n",
+ 				  errno);
+ 		    } else if (bcnt == 0)
+ 			Panic("input: read returned zero\n", 0);
+ 		    else {
+ 			/* read from pty was successful */
+ 			if ( screen->scrollWidget && screen->scrollttyoutput &&
+ 			     screen->topline < 0)
+ 			    WindowScroll(screen, 0);  /* Scroll to bottom */
+ 
+ 			/* stop speed reading at some point to look for X */
+ 			/* stuff, (4096 is just a random large number.) */
+ 			pty_read_bytes += bcnt;
+ 		    }
+ 		}
+ 		else
+ 			Panic("fwait returned strange, fd/op combination", 0);
+ 	}
+ 	while(fw.fw_flags & FWF_MORE);
+ 
+ 	pty_read_bytes = 0;
  
+ 	if (i == -1 && errno != EINTR && errno != EAGAIN)
+ 		SysError(ERROR_SELECT);
+ 	if (bcnt > 0)
+ 		break;
+     }
+     if (!screen->output_eight_bits) 
+     {
+ 	register int bc = bcnt;
+ 	register Char *b = bptr;
+ 
+ 	for (; bc > 0; bc--, b++) {
+ 	    *b &= (Char) 0x7f;
+ 	}
      }
      bcnt--;
      return(*bptr++);
  }
+ #endif /* _MINIX */
  
  /*
   * process a string of characters according to the character set indicated
***************
*** 1937,1942 ****
--- 2225,2233 ----
  	register i = 1;
  	extern XtermWidget term;
  
+ #ifdef AMOEBA
+ 	if (ttypreprocess(c)) return;
+ #endif
  	if((buf[0] = c) == '\r' && (term->flags & LINEFEED)) {
  		buf[1] = '\n';
  		i++;
diff -c mit/clients/xterm/data.h:1.1.1.2 mit/clients/xterm/data.h:2.0
*** mit/clients/xterm/data.h:1.1.1.2	Sat Mar 12 00:44:46 1994
--- mit/clients/xterm/data.h	Sat Mar 12 00:44:46 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * 	$XFree86: mit/clients/xterm/data.h,v 2.0 1993/11/13 04:23:04 dawes Exp $
   *	$XConsortium: data.h,v 1.10 93/02/25 17:21:28 gildea Exp $
   */
  /*
***************
*** 42,53 ****
--- 43,58 ----
  extern char *ttydev;
  extern char *xterm_name;
  extern Char buffer[];
+ #ifndef _MINIX
  extern int Select_mask;
+ #endif
  extern int T_lastx;
  extern int T_lasty;
  extern int Tbcnt;
  extern int Ttoggled;
+ #ifndef _MINIX
  extern int X_mask;
+ #endif
  extern int am_slave;
  extern int bcnt;
  #ifdef DEBUG
***************
*** 54,61 ****
--- 59,80 ----
  extern int debug;
  #endif	/* DEBUG */
  extern int errno;
+ #ifndef _MINIX
  extern int max_plus1;
  extern int pty_mask;
+ #endif
+ #if _MINIX
+ extern int read_inprogress;
+ extern struct v_buf
+ {
+ 	char *v_buffer;		/* pointer to physical buffer */
+ 	int v_bufbeg;		/* Index of the first data byte in the buffer */
+ 	int v_bufend;		/* Index of the last byte in the buffer + 1 */
+ 	int v_bufsiz;		/* Size of the buffer */
+ } v_prim;
+ extern int v_inprogress;
+ extern int v_fd;
+ #endif
  extern int switchfb[];
  
  extern int waitingForTrackInfo;
diff -c mit/clients/xterm/error.h:1.1.1.2 mit/clients/xterm/error.h:2.2
*** mit/clients/xterm/error.h:1.1.1.2	Sat Mar 12 00:44:46 1994
--- mit/clients/xterm/error.h	Sat Mar 12 00:44:46 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  *	$XFree86: mit/clients/xterm/error.h,v 2.2 1993/11/13 04:23:06 dawes Exp $
   *	$XConsortium: error.h,v 1.9 93/02/25 17:21:29 gildea Exp $
   */
  
diff -c mit/clients/xterm/input.c:1.1.1.1 mit/clients/xterm/input.c:2.1
*** mit/clients/xterm/input.c:1.1.1.1	Sat Mar 12 00:44:47 1994
--- mit/clients/xterm/input.c	Sat Mar 12 00:44:47 1994
***************
*** 128,134 ****
--- 128,138 ----
  			unparseputc(kypd_num[keysym-XK_KP_Space], pty);
  		key = TRUE;
          } else if (IsCursorKey(keysym) &&
+ #if 1
+         	keysym < XK_Prior && keysym != XK_Home) {
+ #else
          	keysym != XK_Prior && keysym != XK_Next) {
+ #endif
         		if (keyboard->flags & CURSOR_APL) {
  			reply.a_type = SS3;
  			unparseseq(&reply, pty);
***************
*** 140,146 ****
--- 144,155 ----
  		}
  		key = TRUE;
  	 } else if (IsFunctionKey(keysym) || IsMiscFunctionKey(keysym) ||
+ #if 1
+ 		keysym == XK_Home ||
+ 		(keysym >= XK_Prior && keysym < XK_Select) ||
+ #else
  	 	keysym == XK_Prior || keysym == XK_Next ||
+ #endif
  	 	keysym == DXK_Remove) {
  		reply.a_type = CSI;
  		reply.a_nparam = 1;
***************
*** 230,235 ****
--- 239,249 ----
  		case XK_Select:	return(4);
  		case XK_Prior:	return(5);
  		case XK_Next:	return(6);
+ #if 1
+ 		case XK_Home:   return(7);
+ 		case XK_End:    return(8);
+ 		case XK_Begin:  return(9);
+ #endif
  		default:	return(-1);
  	}
  }
diff -c mit/clients/xterm/main.c:1.1.1.4 mit/clients/xterm/main.c:2.4
*** mit/clients/xterm/main.c:1.1.1.4	Sat Mar 12 00:44:48 1994
--- mit/clients/xterm/main.c	Sat Mar 12 00:44:49 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xterm/main.c,v 2.4 1994/03/01 12:00:31 dawes Exp $ */
  #ifndef lint
  static char *rid="$XConsortium: main.c,v 1.200.1.1 93/11/02 17:14:14 gildea Exp $";
  #endif /* lint */
***************
*** 13,18 ****
--- 14,25 ----
   * ideally to create a generic tty widget with several different parsing
   * widgets so that you can plug 'em together any way you want.  Don't
   * hold your breath, though....
+  *
+ #ifdef AMOEBA
+  * And if you thought that the code was incomprehensible before the Amoeba
+  * modifications, DON'T even bother to look at it now. The whole thing has
+  * become much more complex (with an Amoeba tty server, multiple threads, etc.)
+ #endif
   */
  
  /***********************************************************
***************
*** 56,61 ****
--- 63,91 ----
  #include <pwd.h>
  #include <ctype.h>
  
+ #ifdef linux
+ #define USE_SYSV_TERMIO
+ #define	USE_SYSV_PGRP
+ #define USE_SYSV_UTMP
+ #define USE_SYSV_SIGNALS
+ #endif
+ 
+ #ifdef AMOEBA
+ #include <amoeba.h>
+ #include <cmdreg.h>
+ #include <stderr.h>
+ #include <limits.h>
+ #include <caplist.h>
+ 
+ #define USE_TERMIOS
+ #define USE_POSIX_WAIT
+ #define NILCAP ((capability *)NULL)
+ #endif
+ 
+ #ifdef _MINIX
+ #define USE_TERMIOS
+ #endif
+ 
  #ifdef att
  #define ATT
  #endif
***************
*** 80,86 ****
  #define USE_HANDSHAKE
  #endif
  
! #if defined(SYSV) && !defined(SVR4)
  /* older SYSV systems cannot ignore SIGHUP.
     Shell hangs, or you get extra shells, or something like that */
  #define USE_SYSV_SIGHUP
--- 110,116 ----
  #define USE_HANDSHAKE
  #endif
  
! #if defined(SYSV) && !defined(SVR4) && !defined(ISC22) && !defined(ISC30)
  /* older SYSV systems cannot ignore SIGHUP.
     Shell hangs, or you get extra shells, or something like that */
  #define USE_SYSV_SIGHUP
***************
*** 104,109 ****
--- 134,142 ----
  #else /* USE_TERMIOS */
  #ifdef SYSV
  #include <sys/termio.h>
+ #ifdef SCO /* broken TIOCSWINSZ ioctl so disable it */
+ #undef TIOCSWINSZ
+ #endif
  #endif /* SYSV */
  #endif /* USE_TERMIOS else */
  
***************
*** 111,116 ****
--- 144,151 ----
  #undef TIOCSLTC				/* defined, but not useable */
  #endif
  
+ #define USE_TERMCAP_ENVVARS	/* every one uses this except SYSV maybe */
+ 
  #ifdef SYSV
  #ifdef USE_USG_PTYS			/* AT&T SYSV has no ptyio.h */
  #include <sys/stream.h>			/* get typedef used in ptem.h */
***************
*** 122,127 ****
--- 157,165 ----
  #define USE_SYSV_SIGNALS
  #define	USE_SYSV_PGRP
  #define USE_SYSV_ENVVARS		/* COLUMNS/LINES vs. TERMCAP */
+ #ifndef SCO
+ #undef USE_TERMCAP_ENVVARS	/* SCO wants both TERMCAP and TERMINFO env */
+ #endif
  /*
   * now get system-specific includes
   */
***************
*** 135,140 ****
--- 173,179 ----
  #define HAS_BSD_GROUPS
  #include <sys/ttychars.h>
  #undef USE_SYSV_ENVVARS
+ #define USE_TERMCAP_ENVVARS
  #undef FIOCLEX
  #undef FIONCLEX
  #define setpgrp2 setpgrp
***************
*** 150,155 ****
--- 189,195 ----
  #endif /* sgi */
  #endif /* SYSV */
  
+ #ifndef _POSIX_SOURCE
  #ifndef SYSV				/* BSD systems */
  #include <sgtty.h>
  #include <sys/resource.h>
***************
*** 156,161 ****
--- 196,202 ----
  #define HAS_UTMP_UT_HOST
  #define HAS_BSD_GROUPS
  #endif	/* !SYSV */
+ #endif /* !_POSIX_SOURCE */
  
  #ifdef _POSIX_SOURCE
  #define USE_POSIX_WAIT
***************
*** 164,169 ****
--- 205,216 ----
  #define USE_POSIX_WAIT
  #endif
  
+ #if (BSD >= 199103)
+ #define USE_POSIX_WAIT
+ #define LASTLOG
+ #define WTMP
+ #endif
+ 
  #include <stdio.h>
  #include <errno.h>
  #include <setjmp.h>
***************
*** 176,186 ****
--- 223,243 ----
  #define ttyslot() 1
  #endif /* apollo */
  
+ #ifdef UTMP
  #include <utmp.h>
+ #endif
  #ifdef LASTLOG
+ #if !(BSD >= 199103)
  #include <lastlog.h>
  #endif
+ #endif
+ #ifndef _POSIX_SOURCE
  #include <sys/param.h>	/* for NOFILE */
+ #endif
+ 
+ #ifdef _MINIX
+ #define HAS_UTMP_UT_HOST	1
+ #endif /* _MINIX */
  
  #ifdef  PUCC_PTYD
  #include <local/openpty.h>
***************
*** 192,203 ****
--- 249,271 ----
  #endif
  
  #ifndef UTMP_FILENAME
+ #ifdef _PATH_UTMP
+ #define UTMP_FILENAME _PATH_UTMP
+ #else
  #define UTMP_FILENAME "/etc/utmp"
  #endif
+ #endif
  #ifndef LASTLOG_FILENAME
+ #ifdef _PATH_LASTLOG
+ #define LASTLOG_FILENAME _PATH_LASTLOG
+ #else
  #define LASTLOG_FILENAME "/usr/adm/lastlog"  /* only on BSD systems */
  #endif
+ #endif
  #ifndef WTMP_FILENAME
+ #ifdef _PATH_WTMP
+ #define WTMP_FILENAME _PATH_WTMP
+ #else
  #if defined(SYSV)
  #define WTMP_FILENAME "/etc/wtmp"
  #else
***************
*** 204,209 ****
--- 272,278 ----
  #define WTMP_FILENAME "/usr/adm/wtmp"
  #endif
  #endif
+ #endif
  
  #include <signal.h>
  
***************
*** 232,238 ****
  #include <unistd.h>
  #else
  extern long lseek();
! #ifdef USG
  extern unsigned sleep();
  #else
  extern void sleep();
--- 301,307 ----
  #include <unistd.h>
  #else
  extern long lseek();
! #if defined(USG) || defined(SCO324)
  extern unsigned sleep();
  #else
  extern void sleep();
***************
*** 357,366 ****
--- 426,437 ----
  extern struct utmp *getutent();
  extern struct utmp *getutid();
  extern struct utmp *getutline();
+ #ifndef SCO324
  extern void pututline();
  extern void setutent();
  extern void endutent();
  extern void utmpname();
+ #endif /* !SCO324 */
  #endif /* !SVR4 */
  
  #ifndef SYSV386			/* could remove paragraph unconditionally? */
***************
*** 398,404 ****
  static int inhibit;
  static char passedPty[2];	/* name if pty if slave */
  
! #ifdef TIOCCONS
  static int Console;
  #include <X11/Xmu/SysUtil.h>	/* XmuGetHostname */
  #define MIT_CONSOLE_LEN	12
--- 469,479 ----
  static int inhibit;
  static char passedPty[2];	/* name if pty if slave */
  
! #if defined(TIOCCONS) || defined(SOLX86)
! #ifdef SOLX86
! static int SolX86cons;
! #include <sys/strredir.h>
! #endif /* ! SOLX86 */
  static int Console;
  #include <X11/Xmu/SysUtil.h>	/* XmuGetHostname */
  #define MIT_CONSOLE_LEN	12
***************
*** 407,412 ****
--- 482,491 ----
  static Atom mit_console;
  #endif	/* TIOCCONS */
  
+ #ifdef AMOEBA
+ char *TTYName = NULL;
+ #endif
+ 
  #ifndef USE_SYSV_UTMP
  static int tslot;
  #endif	/* USE_SYSV_UTMP */
***************
*** 604,615 ****
  { "#geom",                 "icon window geometry" },
  { "-T string",             "title name for window" },
  { "-n string",             "icon name for window" },
! #ifdef TIOCCONS
  { "-C",                    "intercept console messages" },
  #else
  { "-C",                    "intercept console messages (not supported)" },
  #endif
  { "-Sxxd",                 "slave mode on \"ttyxx\", file descriptor \"d\"" },
  { NULL, NULL }};
  
  static char *message[] = {
--- 683,698 ----
  { "#geom",                 "icon window geometry" },
  { "-T string",             "title name for window" },
  { "-n string",             "icon name for window" },
! #ifndef AMOEBA
! #if defined(TIOCCONS) || defined(SOLX86)
  { "-C",                    "intercept console messages" },
  #else
  { "-C",                    "intercept console messages (not supported)" },
  #endif
  { "-Sxxd",                 "slave mode on \"ttyxx\", file descriptor \"d\"" },
+ #else /* AMOEBA */
+ { "-Ppath",		   "publish tty capability as \"path\""},
+ #endif /* AMOEBA */
  { NULL, NULL }};
  
  static char *message[] = {
***************
*** 669,675 ****
      exit (0);
  }
  
! #ifdef TIOCCONS
  /* ARGSUSED */
  static Boolean
  ConvertConsoleSelection(w, selection, target, type, value, length, format)
--- 752,758 ----
      exit (0);
  }
  
! #if defined(TIOCCONS) || defined(SOLX86)
  /* ARGSUSED */
  static Boolean
  ConvertConsoleSelection(w, selection, target, type, value, length, format)
***************
*** 756,761 ****
--- 839,845 ----
  
  	ProgramName = argv[0];
  
+ #ifndef AMOEBA
  	ttydev = (char *) malloc (strlen (TTYDEV) + 1);
  	ptydev = (char *) malloc (strlen (PTYDEV) + 1);
  	if (!ttydev || !ptydev) {
***************
*** 813,826 ****
  #endif /* TIOCLSET */
  #else  /* else !macII */
  	d_tio.c_iflag = ICRNL|IXON;
! 	d_tio.c_oflag = OPOST|ONLCR|TAB3;
  #ifdef BAUD_0
      	d_tio.c_cflag = CS8|CREAD|PARENB|HUPCL;
  #else	/* !BAUD_0 */
      	d_tio.c_cflag = B9600|CS8|CREAD|PARENB|HUPCL;
  #endif	/* !BAUD_0 */
      	d_tio.c_lflag = ISIG|ICANON|ECHO|ECHOE|ECHOK;
  	d_tio.c_line = 0;
  	d_tio.c_cc[VINTR] = 0x7f;		/* DEL  */
  	d_tio.c_cc[VQUIT] = '\\' & 0x3f;	/* '^\'	*/
  	d_tio.c_cc[VERASE] = '#';		/* '#'	*/
--- 897,934 ----
  #endif /* TIOCLSET */
  #else  /* else !macII */
  	d_tio.c_iflag = ICRNL|IXON;
! 	d_tio.c_oflag = OPOST;
! #ifdef ONLCR
! 	d_tio.c_oflag |= ONLCR;
! #endif /* ONLCR */
! #ifdef TAB3
! 	d_tio.c_oflag |= TAB3;
! #endif /* TAB3 */
! #ifdef XTABS
! 	d_tio.c_oflag |= XTABS;
! #endif /* XTABS */
! #ifdef _POSIX_SOURCE
! 	cfsetispeed(&d_tio, B9600);
! 	cfsetospeed(&d_tio, B9600);
! #else /* !_POSIX_SOURCE */
  #ifdef BAUD_0
      	d_tio.c_cflag = CS8|CREAD|PARENB|HUPCL;
  #else	/* !BAUD_0 */
      	d_tio.c_cflag = B9600|CS8|CREAD|PARENB|HUPCL;
  #endif	/* !BAUD_0 */
+ #endif
      	d_tio.c_lflag = ISIG|ICANON|ECHO|ECHOE|ECHOK;
+ #ifndef _POSIX_SOURCE	/* What is the appropriate define? */
  	d_tio.c_line = 0;
+ #endif /* _POSIX_SOURCE */
+ #ifdef linux
+ 	d_tio.c_cc[VINTR] = 'C' & 0x3f;		/* '^C'  */
+ 	d_tio.c_cc[VQUIT] = '\\' & 0x3f;	/* '^\'	*/
+ 	d_tio.c_cc[VERASE] = 0x7f;		/* DEL	*/
+ 	d_tio.c_cc[VKILL] = 'U' & 0x3f;		/* '^U'	*/
+     	d_tio.c_cc[VEOF] = 'D' & 0x3f;		/* '^D'	*/
+ 	d_tio.c_cc[VEOL] = '@' & 0x3f;		/* '^@'	*/
+ #else
  	d_tio.c_cc[VINTR] = 0x7f;		/* DEL  */
  	d_tio.c_cc[VQUIT] = '\\' & 0x3f;	/* '^\'	*/
  	d_tio.c_cc[VERASE] = '#';		/* '#'	*/
***************
*** 827,832 ****
--- 935,941 ----
  	d_tio.c_cc[VKILL] = '@';		/* '@'	*/
      	d_tio.c_cc[VEOF] = 'D' & 0x3f;		/* '^D'	*/
  	d_tio.c_cc[VEOL] = '@' & 0x3f;		/* '^@'	*/
+ #endif
  #ifdef VSWTCH
  	d_tio.c_cc[VSWTCH] = '@' & 0x3f;	/* '^@'	*/
  #endif	/* VSWTCH */
***************
*** 859,869 ****
--- 968,986 ----
          d_ltc.t_lnextc = '\377';
  #endif	/* TIOCSLTC */
  #ifdef USE_TERMIOS
+ #ifdef linux
+ 	d_tio.c_cc[VSUSP] = 'Z' & 0x3f;
+ #else
  	d_tio.c_cc[VSUSP] = '\000';
+ #endif
+ #ifdef VDSUSP
  	d_tio.c_cc[VDSUSP] = '\000';
+ #endif /* VDSUSP */
  	d_tio.c_cc[VREPRINT] = '\377';
  	d_tio.c_cc[VDISCARD] = '\377';
+ #ifdef VWERASE
  	d_tio.c_cc[VWERASE] = '\377';
+ #endif /* VWERASE */
  	d_tio.c_cc[VLNEXT] = '\377';
  #endif
  #ifdef TIOCLSET
***************
*** 871,876 ****
--- 988,994 ----
  #endif	/* TIOCLSET */
  #endif  /* macII */
  #endif	/* USE_SYSV_TERMIO */
+ #endif  /* AMOEBA */
  
  	/* Init the Toolkit. */
  	toplevel = XtAppInitialize (&app_con, "XTerm", 
***************
*** 934,941 ****
  	     case 'h':
  		Help ();
  		/* NOTREACHED */
  	     case 'C':
! #ifdef TIOCCONS
  		{
  		    struct stat sbuf;
  
--- 1052,1060 ----
  	     case 'h':
  		Help ();
  		/* NOTREACHED */
+ #ifndef AMOEBA
  	     case 'C':
! #if defined(TIOCCONS) || defined(SOLX86)
  		{
  		    struct stat sbuf;
  
***************
*** 956,961 ****
--- 1075,1085 ----
  			   &am_slave) != 3)
  		    Syntax(*argv);
  		continue;
+ #else	/* AMOEBA */
+ 	     case 'P':
+ 		TTYName = *argv + 2;
+ 		continue;
+ #endif	/* AMOEBA */
  #ifdef DEBUG
  	     case 'D':
  		debug = TRUE;
***************
*** 1049,1054 ****
--- 1173,1179 ----
  	if(screen->TekEmu && !TekInit())
  		exit(ERROR_INIT);
  
+ #ifndef AMOEBA
  #ifdef DEBUG
      {
  	/* Set up stderr properly.  Opening this log file cannot be
***************
*** 1060,1066 ****
  		i = open ("xterm.debug.log", O_WRONLY | O_TRUNC, 0666);
  	}
  	if(i >= 0) {
! #if defined(USE_SYSV_TERMIO) && !defined(SVR4)
  		/* SYSV has another pointer which should be part of the
  		** FILE structure but is actually a seperate array.
  		*/
--- 1185,1194 ----
  		i = open ("xterm.debug.log", O_WRONLY | O_TRUNC, 0666);
  	}
  	if(i >= 0) {
! #ifdef _MINIX
! 		stderr->_fd = i;
! #else /* !_MINIX */
! #if defined(USE_SYSV_TERMIO) && !defined(SVR4) && !defined(linux)
  		/* SYSV has another pointer which should be part of the
  		** FILE structure but is actually a seperate array.
  		*/
***************
*** 1070,1077 ****
--- 1198,1210 ----
  		stderr->_file = i;
  		_bufend(stderr) = old_bufend;
  #else	/* USE_SYSV_TERMIO */
+ #ifdef linux
+ 		setfileno(stderr, i);
+ #else
  		stderr->_file = i;
+ #endif
  #endif	/* USE_SYSV_TERMIO */
+ #endif /* _MINIX */
  
  		/* mark this file as close on exec */
  		(void) fcntl(i, F_SETFD, 1);
***************
*** 1078,1083 ****
--- 1211,1217 ----
  	}
      }
  #endif	/* DEBUG */
+ #endif /* AMOEBA */
  
  	/* open a terminal for client */
  	get_terminal ();
***************
*** 1087,1092 ****
--- 1221,1227 ----
  
  	/* Realize procs have now been executed */
  
+ #ifndef AMOEBA
  	Xsocket = ConnectionNumber(screen->display);
  	pty = screen->respond;
  
***************
*** 1099,1104 ****
--- 1234,1240 ----
  				      XtWindow (XtParent (term)));
  	    write (pty, buf, strlen (buf));
  	}
+ #endif /* AMOEBA */
  
  #ifdef ALLOWLOGGING
  	if (term->misc.log_on) {
***************
*** 1125,1130 ****
--- 1261,1273 ----
  		SysError(ERROR_TIOCSETP);
  	}
  #endif
+ #ifndef AMOEBA
+ #ifdef _MINIX
+ 	mode= fcntl(pty, F_GETFD);
+ 	mode |= FD_ASYNCHIO;
+ 	if (fcntl(pty, F_SETFD, mode) == -1)
+ 		Error();
+ #else /* !_MINIX */
  #ifdef USE_SYSV_TERMIO
  	if (0 > (mode = fcntl(pty, F_GETFL, 0)))
  		Error();
***************
*** 1139,1149 ****
--- 1282,1296 ----
  	mode = 1;
  	if (ioctl (pty, FIONBIO, (char *)&mode) == -1) SysError (ERROR_FIONBIO);
  #endif	/* USE_SYSV_TERMIO */
+ #endif /* _MINIX */
  	
+ #ifndef _MINIX
  	pty_mask = 1 << pty;
  	X_mask = 1 << Xsocket;
  	Select_mask = pty_mask | X_mask;
  	max_plus1 = (pty < Xsocket) ? (1 + Xsocket) : (1 + pty);
+ #endif /* _MINIX */
+ #endif	/* AMOEBA */
  
  #ifdef DEBUG
  	if (debug) printf ("debugging on\n");
***************
*** 1167,1172 ****
--- 1314,1320 ----
  	return(cp ? cp + 1 : name);
  }
  
+ #ifndef AMOEBA
  /* This function opens up a pty master and stuffs its value into pty.
   * If it finds one, it returns a value of 0.  If it does not find one,
   * it returns a value of !0.  This routine is designed to be re-entrant,
***************
*** 1177,1183 ****
  get_pty (pty)
      int *pty;
  {
! #if defined(SYSV) && defined(SYSV386)
          /*
  	  The order of this code is *important*.  On SYSV/386 we want to open
  	  a /dev/ttyp? first if at all possible.  If none are available, then
--- 1325,1331 ----
  get_pty (pty)
      int *pty;
  {
! #if defined(SYSV) && defined(SYSV386) && !defined(SVR4)
          /*
  	  The order of this code is *important*.  On SYSV/386 we want to open
  	  a /dev/ttyp? first if at all possible.  If none are available, then
***************
*** 1329,1334 ****
--- 1477,1483 ----
       */
      return 1;
  }
+ #endif /* AMOEBA */
  
  get_terminal ()
  /* 
***************
*** 1465,1470 ****
--- 1614,1620 ----
  #endif /* USE_HANDSHAKE else !USE_HANDSHAKE */
  
  
+ #ifndef AMOEBA
  spawn ()
  /* 
   *  Inits pty and tty and forks a login process.
***************
*** 1539,1544 ****
--- 1689,1699 ----
  	screen->uid = getuid();
  	screen->gid = getgid();
  
+ #ifdef linux
+ 	memset(termcap, 0, sizeof(termcap));
+ 	memset(newtc, 0, sizeof(newtc));
+ #endif
+ 
  #ifdef SIGTTOU
  	/* so that TIOCSWINSZ || TIOCSIZE doesn't block */
  	signal(SIGTTOU,SIG_IGN);
***************
*** 1676,1682 ****
  				       False);
  	if (!screen->TekEmu)
  	    VTInit();		/* realize now so know window size for tty driver */
! #ifdef TIOCCONS
  	if (Console) {
  	    /*
  	     * Inform any running xconsole program
--- 1831,1837 ----
  				       False);
  	if (!screen->TekEmu)
  	    VTInit();		/* realize now so know window size for tty driver */
! #if defined(TIOCCONS) || defined(SOLX86)
  	if (Console) {
  	    /*
  	     * Inform any running xconsole program
***************
*** 1856,1863 ****
  		/* Now is the time to set up our process group and
  		 * open up the pty slave.
  		 */
! #ifdef	USE_SYSV_PGRP
! #if defined(CRAY) && (OSMAJORVERSION > 5)
  		(void) setsid();
  #else
  		(void) setpgrp();
--- 2011,2018 ----
  		/* Now is the time to set up our process group and
  		 * open up the pty slave.
  		 */
! #if defined(USE_SYSV_PGRP) || defined(_POSIX_SOURCE)
! #if defined(CRAY) && (OSMAJORVERSION > 5) || defined(_POSIX_SOURCE)
  		(void) setsid();
  #else
  		(void) setpgrp();
***************
*** 1875,1881 ****
  			    /* make /dev/tty work */
  			    ioctl(tty, TCSETCTTY, 0);
  #endif
! #ifdef	USE_SYSV_PGRP
  				/* We need to make sure that we are acutally
  				 * the process group leader for the pty.  If
  				 * we are, then we should now be able to open
--- 2030,2036 ----
  			    /* make /dev/tty work */
  			    ioctl(tty, TCSETCTTY, 0);
  #endif
! #if	defined(USE_SYSV_PGRP) || defined(_POSIX_SOURCE)
  				/* We need to make sure that we are acutally
  				 * the process group leader for the pty.  If
  				 * we are, then we should now be able to open
***************
*** 1981,1986 ****
--- 2136,2165 ----
  		    tio.c_iflag &= ~(INLCR|IGNCR);
  		    tio.c_iflag |= ICRNL;
  		    /* ouput: cr->cr, nl is not return, no delays, ln->cr/nl */
+ #ifndef OCRNL
+ #define OCRNL	0
+ #endif
+ #ifndef ONLRET
+ #define ONLRET	0
+ #endif
+ #ifndef NLDLY
+ #define NLDLY	0
+ #endif
+ #ifndef CRDLY
+ #define	CRDLY	0
+ #endif
+ #ifndef TABDLY
+ #define	TABDLY	0
+ #endif
+ #ifndef BSDLY
+ #define	BSDLY	0
+ #endif
+ #ifndef	VTDLY
+ #define	VTDLY	0
+ #endif
+ #ifndef	FFDLY
+ #define	FFDLY	0
+ #endif
  		    tio.c_oflag &=
  		     ~(OCRNL|ONLRET|NLDLY|CRDLY|TABDLY|BSDLY|VTDLY|FFDLY);
  		    tio.c_oflag |= ONLCR;
***************
*** 1987,1992 ****
--- 2166,2175 ----
  #ifdef OPOST
  		    tio.c_oflag |= OPOST;
  #endif /* OPOST */		    
+ #if _POSIX_SOURCE
+ 		    cfsetispeed(&tio, B9600);
+ 		    cfsetospeed(&tio, B9600);
+ #else /* !_POSIX_SOURCE */
  #ifdef BAUD_0
  		    /* baud rate is 0 (don't care) */
  		    tio.c_cflag &= ~(CBAUD);
***************
*** 1995,2000 ****
--- 2178,2184 ----
  		    tio.c_cflag &= ~(CBAUD);
  		    tio.c_cflag |= B9600;
  #endif	/* !BAUD_0 */
+ #endif /* _POSIX_SOURCE */
  		    /* enable signals, canonical processing (erase, kill, etc),
  		    ** echo
  		    */
***************
*** 2091,2097 ****
  			    HsSysError (cp_pipe[1], ERROR_TIOCKSETC);
  #endif /* sony */
  #endif	/* !USE_SYSV_TERMIO */
! #ifdef TIOCCONS
  		    if (Console) {
  			int on = 1;
  			if (ioctl (tty, TIOCCONS, (char *)&on) == -1)
--- 2275,2282 ----
  			    HsSysError (cp_pipe[1], ERROR_TIOCKSETC);
  #endif /* sony */
  #endif	/* !USE_SYSV_TERMIO */
! #if defined(TIOCCONS) || defined(SOLX86)
! #ifndef SOLX86
  		    if (Console) {
  			int on = 1;
  			if (ioctl (tty, TIOCCONS, (char *)&on) == -1)
***************
*** 2098,2103 ****
--- 2283,2297 ----
  			    fprintf(stderr, "%s: cannot open console\n",
  				    xterm_name);
  		    }
+ #else
+ 		    if (Console) {
+ 			int on = 1;
+ 			SolX86cons = open("/dev/console", O_RDONLY);
+ 			if( ioctl(SolX86cons, SRIOCSREDIR, tty) == -1)
+ 				fprintf(stderr, "%s: cannot open console\n", 
+ 					xterm_name);
+ 		    }
+ #endif /* SOLX86 */
  #endif	/* TIOCCONS */
  		}
  
***************
*** 2129,2137 ****
  #ifdef UTMP
  		envsize += 2;   /* HOME, SHELL */
  #endif /* UTMP */
- #else /* USE_SYSV_ENVVARS */
- 		envsize += 1;	/* TERMCAP */
  #endif /* USE_SYSV_ENVVARS */
  		envnew = (char **) calloc ((unsigned) i + envsize, sizeof(char *));
  		bcopy((char *)environ, (char *)envnew, i * sizeof(char *));
  		environ = envnew;
--- 2323,2332 ----
  #ifdef UTMP
  		envsize += 2;   /* HOME, SHELL */
  #endif /* UTMP */
  #endif /* USE_SYSV_ENVVARS */
+ #ifdef USE_TERMCAP_ENVVARS
+ 		envsize += 1;	/* TERMCAP */
+ #endif /* USE_TERMCAP_ENVVARS */
  		envnew = (char **) calloc ((unsigned) i + envsize, sizeof(char *));
  		bcopy((char *)environ, (char *)envnew, i * sizeof(char *));
  		environ = envnew;
***************
*** 2179,2191 ****
  #endif /* CRAY */
  		}
  
! #ifndef	USE_SYSV_PGRP
  #ifdef TIOCSCTTY
  		setsid();
  		ioctl(0, TIOCSCTTY, 0);
  #endif
  		ioctl(0, TIOCSPGRP, (char *)&pgrp);
  		setpgrp(0,0);
  		close(open(ttydev, O_WRONLY, 0));
  		setpgrp (0, pgrp);
  #endif /* !USE_SYSV_PGRP */
--- 2374,2388 ----
  #endif /* CRAY */
  		}
  
! #if	!defined(USE_SYSV_PGRP) && !defined(_POSIX_SOURCE)
  #ifdef TIOCSCTTY
  		setsid();
  		ioctl(0, TIOCSCTTY, 0);
  #endif
+ #ifdef TIOCSPGRP
  		ioctl(0, TIOCSPGRP, (char *)&pgrp);
  		setpgrp(0,0);
+ #endif
  		close(open(ttydev, O_WRONLY, 0));
  		setpgrp (0, pgrp);
  #endif /* !USE_SYSV_PGRP */
***************
*** 2222,2228 ****
--- 2419,2427 ----
  
  		/* set up the new entry */
  		utmp.ut_type = USER_PROCESS;
+ #ifndef linux
  		utmp.ut_exit.e_exit = 2;
+ #endif
  		(void) strncpy(utmp.ut_user,
  			       (pw && pw->pw_name) ? pw->pw_name : "????",
  			       sizeof(utmp.ut_user));
***************
*** 2276,2281 ****
--- 2475,2484 ----
  					       sizeof(utmp.ut_line));
  				(void) strncpy(utmp.ut_name, pw->pw_name,
  					       sizeof(utmp.ut_name));
+ #ifdef _MINIX
+ 				utmp.ut_pid = getpid();
+ 				utmp.ut_type = USER_PROCESS;
+ #endif /* _MINIX */
  #ifdef HAS_UTMP_UT_HOST
  				(void) strncpy(utmp.ut_host, 
  					       XDisplayString (screen->display),
***************
*** 2401,2407 ****
  			Setenv("SHELL=", pw->pw_shell);
  		}
  #endif /* UTMP */
! #else /* USE_SYSV_ENVVAR */
  		if(!screen->TekEmu) {
  		    strcpy (termcap, newtc);
  		    resize (screen, TermName, termcap, newtc);
--- 2604,2611 ----
  			Setenv("SHELL=", pw->pw_shell);
  		}
  #endif /* UTMP */
! #endif /* USE_SYSV_ENVVARS */
! #ifdef USE_TERMCAP_ENVVARS
  		if(!screen->TekEmu) {
  		    strcpy (termcap, newtc);
  		    resize (screen, TermName, termcap, newtc);
***************
*** 2614,2619 ****
--- 2818,3186 ----
  
  	return;
  }							/* end spawn */
+ #else /* AMOEBA else */
+ /* manifest constants */
+ #define	TTY_NTHREADS		2
+ #define	TTY_INQSIZE		2000
+ #define	TTY_OUTQSIZE		1000
+ #define	TTY_THREAD_STACKSIZE	4096
+ 
+ #define	XWATCHDOG_THREAD_SIZE	4096
+ 
+ /* acceptable defaults */
+ #define	DEF_HOME		"/home"
+ #define	DEF_SHELL		"/bin/sh"
+ #define	DEF_PATH		"/bin:/usr/bin:/public/util"
+ 
+ extern capability ttycap;
+ extern char **environ;
+ extern struct caplist *capv;
+ 
+ /*
+  * Set capability.
+  * I made this a function since it cannot be a macro.
+  */
+ void
+ setcap(capvec, n, name, cap)
+     struct caplist *capvec;
+     int n;
+     char *name;
+     capability *cap;
+ {
+     capvec[n].cl_name = name;
+     capvec[n].cl_cap = cap;
+ }
+ 
+ /*
+  * Find process descriptor for specified program,
+  * necessarily running down the user's PATH.
+  */
+ errstat
+ find_program(program, programcap)
+     char *program;
+     capability *programcap;
+ {
+     errstat err;
+ 
+     if ((err = name_lookup(program, programcap)) != STD_OK) {
+ 	char *path, *name;
+ 	char programpath[1024];
+ 
+ 	if ((path = getenv("PATH")) == NULL)
+      	    path = DEF_PATH;
+ 	if ((name = strrchr(program, '/')) != NULL)
+     	    name++;
+ 	else
+     	    name = program;
+ 
+ 	do {
+ 	    register char *p = programpath;
+ 	    register char *n = name;
+ 	    char *c1 = path;
+ 
+ 	    while (*path && *path != ':')
+ 		*p++ = *path++;
+ 	    if (path != c1) *p++ = '/';
+ 	    if (*path) path++;
+ 	    while (*n) *p++ = *n++;
+ 	    *p = '\0';
+ 	    if ((err = name_lookup(programpath, programcap)) == STD_OK)
+ 		break;
+ 	} while (*path);
+     }
+     return err;
+ }
+ 
+ /* Semaphore on which the main thread blocks until it can do something
+  * useful (which is made known by a call to WakeupMainThread()).
+  */
+ static semaphore main_sema;
+ 
+ void
+ InitMainThread()
+ {
+     sema_init(&main_sema, 0);
+ }
+ 
+ void
+ WakeupMainThread()
+ {
+     sema_up(&main_sema);
+ }
+ 
+ /*
+  * Spawn off tty threads and fork the login process.
+  */
+ spawn()
+ {
+     register TScreen *screen = &term->screen;
+     char *TermName = NULL;
+     char termcap[1024];
+     char newtc[1024];
+     char **envnew;		/* new environment */
+     int envsize;		/* elements in new environment */
+     char *ptr;
+     int i, n, ncap;
+     errstat err;
+     struct caplist *cl;
+     char buf[64], numbuf[12];
+     struct caplist *capvnew;
+     int ttythread();
+     int xwatchdogthread();
+ 
+     screen->pid = 2;		/* at least > 1 */
+     screen->uid = getuid();
+     screen->gid = getgid();
+     screen->respond = OPEN_MAX + 1;
+     screen->tty_inq = cb_alloc(TTY_INQSIZE);
+     screen->tty_outq = cb_alloc(TTY_OUTQSIZE);
+ 
+     InitMainThread();
+     if (!thread_newthread(xwatchdogthread, XWATCHDOG_THREAD_SIZE, 0, 0)) {
+ 	fprintf(stderr, "%s:  unable to start tty thread.\n", ProgramName);
+ 	Exit(1);
+     }
+ 
+     /*
+      * Start tty threads. Ordinarily two should suffice, one for standard
+      * input and one for standard (error) output.
+      */
+     ttyinit(TTYName);
+     for (i = 0; i < TTY_NTHREADS; i++) {
+ 	if (!thread_newthread(ttythread, TTY_THREAD_STACKSIZE, 0, 0)) {
+ 	    fprintf(stderr, "%s:  unable to start tty thread.\n", ProgramName);
+ 	    Exit(1);
+ 	}
+     }
+ 
+     /* avoid double MapWindow requests */
+     XtSetMappedWhenManaged( screen->TekEmu ? XtParent(tekWidget) :
+ 					XtParent(term), False );
+     wm_delete_window = XInternAtom(XtDisplay(toplevel), "WM_DELETE_WINDOW",
+ 					False);
+ 
+     /* realize now so know window size for tty driver */
+     if (!screen->TekEmu) VTInit();
+ 
+     if (screen->TekEmu) {
+ 	envnew = tekterm;
+ 	ptr = newtc;
+     } else {
+ 	envnew = vtterm;
+ 	ptr = termcap;
+     }
+ 
+     TermName = NULL;
+     if (resource.term_name) {
+ 	if (tgetent (ptr, resource.term_name) == 1) {
+ 	    TermName = resource.term_name;
+ 	    if (!screen->TekEmu)
+ 		resize (screen, TermName, termcap, newtc);
+ 	} else {
+ 	    fprintf (stderr, "%s:  invalid termcap entry \"%s\".\n",
+ 		ProgramName, resource.term_name);
+ 	}
+     }
+ 
+     if (!TermName) {
+ 	while (*envnew != NULL) {
+ 	    if(tgetent(ptr, *envnew) == 1) {
+ 		TermName = *envnew;
+ 		if(!screen->TekEmu)
+ 		    resize(screen, TermName, termcap, newtc);
+ 		    break;
+ 	    }
+ 	    envnew++;
+ 	}
+ 	if (TermName == NULL) {
+ 	    fprintf (stderr, "%s:  unable to find usable termcap entry.\n",
+ 		ProgramName);
+ 	    Exit (1);
+ 	}
+     }
+ 
+     /*
+      * Setup new capability environment. The whole point of the game is
+      * to redirect the shell's stdin/stdout/stderr and tty to our own
+      * tty server instead of the initial one.
+      */
+     for (ncap = 4, cl = capv; cl->cl_name != (char *)NULL; cl++)
+ 	if (strcmp("STDIN", cl->cl_name) && strcmp("STDOUT", cl->cl_name)
+ 	  && strcmp("STDERR", cl->cl_name) && strcmp("TTY", cl->cl_name))
+ 	    ncap++;
+ 
+     capvnew = (struct caplist *)
+ 	calloc((unsigned) ncap + 1, sizeof(struct caplist));
+     setcap(capvnew, 0, "STDIN", &ttycap);
+     setcap(capvnew, 1, "STDOUT", &ttycap);
+     setcap(capvnew, 2, "STDERR", &ttycap);
+     setcap(capvnew, 3, "TTY", &ttycap);
+     for (n = 4, cl = capv; cl->cl_name != (char *) NULL; cl++) {
+ 	if (strcmp("STDIN", cl->cl_name)
+ 	  && strcmp("STDOUT", cl->cl_name)
+ 	  && strcmp("STDERR", cl->cl_name)
+ 	  && strcmp("TTY", cl->cl_name))
+ 	    setcap(capvnew, n++, cl->cl_name, cl->cl_cap);
+     }
+     setcap(capvnew, ncap, (char *)NULL, (capability *)NULL);
+     if (n != ncap) {
+ 	fprintf(stderr, "%s: bad capability set.\n", ProgramName);
+ 	Exit(1);
+     }
+ 
+     /*
+      * Setup environment variables. We add some extra ones to denote
+      * window id, terminal type, display name, termcap entry, and some
+      * standard one (which are required by every shell) HOME and SHELL.
+      * Note that the two shell variables COLUMNS and LINES are not needed
+      * under Amoeba since the tty server provides an RPC to query the
+      * window sizes.
+      */
+     /* copy the environment before Setenving */
+     for (i = 0 ; environ[i] != NULL ; i++)
+ 	;
+ 
+     /* compute number of Setenv() calls below */
+     envsize = 1;	/* (NULL terminating entry) */
+     envsize += 3;	/* TERM, WINDOWID, DISPLAY */
+     envsize += 2;	/* HOME, SHELL */
+     envsize += 1;	/* TERMCAP */
+     envnew = (char **) calloc ((unsigned) i + envsize, sizeof(char *));
+     bcopy((char *)environ, (char *)envnew, i * sizeof(char *));
+     environ = envnew;
+     Setenv ("TERM=", TermName);
+     if(!TermName) *newtc = 0;
+ 
+     sprintf (buf, "%lu", screen->TekEmu ?
+ 	((unsigned long) XtWindow (XtParent(tekWidget))) :
+ 	((unsigned long) XtWindow (XtParent(term))));
+     Setenv ("WINDOWID=", buf);
+ 
+     /* put the display into the environment of the shell*/
+     Setenv ("DISPLAY=", XDisplayString (screen->display));
+ 
+     /* always provide a HOME and SHELL definition */
+     if (!getenv("HOME")) Setenv("HOME=", DEF_HOME);
+     if (!getenv("SHELL")) Setenv("SHELL=", DEF_SHELL);
+ 
+     if(!screen->TekEmu) {
+ 	strcpy (termcap, newtc);
+ 	resize (screen, TermName, termcap, newtc);
+     }
+     if (term->misc.titeInhibit) {
+ 	remove_termcap_entry (newtc, ":ti=");
+ 	remove_termcap_entry (newtc, ":te=");
+     }
+     /* work around broken termcap entries */
+     if (resource.useInsertMode) {
+ 	remove_termcap_entry (newtc, ":ic=");
+ 	/* don't get duplicates */
+ 	remove_termcap_entry (newtc, ":im=");
+ 	remove_termcap_entry (newtc, ":ei=");
+ 	remove_termcap_entry (newtc, ":mi");
+ 	strcat (newtc, ":im=\\E[4h:ei=\\E[4l:mi:");
+     }
+     Setenv ("TERMCAP=", newtc);
+ 
+     /*
+      * Execute specified program or shell. Use find_program to
+      * simulate the same behaviour as the original execvp.
+      */
+     if (command_to_exec) {
+ 	capability programcap;
+ 
+ 	if (find_program(*command_to_exec, &programcap) != STD_OK) {
+ 	    fprintf(stderr, "%s: Could not find %s!\n",
+ 		xterm_name, *command_to_exec);
+ 	    exit(ERROR_EXEC);
+ 	}
+ 
+ 	err = exec_file(&programcap, NILCAP, &ttycap, 0,
+ 	    command_to_exec, envnew, capvnew, &screen->proccap);
+ 	if (err != STD_OK) {
+ 	    fprintf(stderr, "%s: Could not exec %s!\n",
+ 		xterm_name, *command_to_exec);
+ 	    exit(ERROR_EXEC);
+ 	}
+     } else {
+ 	char *shell, *shname, *shname_minus;
+ 	capability shellcap;
+ 	char *argvec[2];
+ 
+ 	if ((shell = getenv("SHELL")) == NULL)
+     	    shell = DEF_SHELL; /* "cannot happen" */
+ 	if ((shname = strrchr(shell, '/')) != NULL)
+     	    shname++;
+ 	else
+     	    shname = shell;
+ 
+ 	shname_minus = malloc(strlen(shname) + 2);
+ 	(void) strcpy(shname_minus, "-");
+ 	(void) strcat(shname_minus, shname);
+ 
+ 	argvec[0] = term->misc.login_shell ? shname_minus : shname;
+ 	argvec[1] = NULL;
+     
+ 	if (find_program(shell, &shellcap) != STD_OK) {
+ 	    fprintf(stderr, "%s: Could not find %s!\n", xterm_name, shell);
+ 	    exit(ERROR_EXEC);
+ 	}
+ 
+ 	err = exec_file(&shellcap, NILCAP, &ttycap, 0, argvec,
+ 	    envnew, capvnew, &screen->proccap);
+ 	if (err != STD_OK) {
+ 	    fprintf(stderr, "%s: Could not exec %s!\n", xterm_name, shell);
+ 	    exit(ERROR_EXEC);
+ 	}
+ 
+ 	free(shname_minus);
+     }
+     free(capvnew);
+ 
+     signal(SIGINT, SIG_IGN);
+     signal(SIGQUIT, SIG_IGN);
+     signal(SIGTERM, SIG_IGN);
+     signal(SIGPIPE, Exit);
+ }
+ 
+ extern char *SysErrorMsg();
+ 
+ /*
+  * X watch-dog thread. This thread unblocks the main
+  * thread when there's an X event.
+  */
+ xwatchdogthread()
+ {
+     register TScreen *screen = &term->screen;
+ 
+     for (;;) {
+ 	int n = _XAmSelect(ConnectionNumber(screen->display), 10);
+ 	if (n < 0 && errno != EINTR) {
+ 	    fprintf(stderr, "%s: X watch dog: Xselect failed: %s\n",
+ 		ProgramName, SysErrorMsg(errno));
+ 	    Cleanup(1);
+ 	} else if (n > 0)
+ 	    WakeupMainThread();
+ 	threadswitch();
+     }
+ }
+ 
+ void
+ SleepMainThread()
+ {
+     int remaining;
+ 
+     /* Wait for at least one event */
+     sema_down(&main_sema);
+ 
+     /* Since the main thread will continue handling all outstanding events
+      * shortly, we can ignore the remaining wakeups that were done.
+      */
+     if ((remaining = sema_level(&main_sema)) > 1) {
+ 	sema_mdown(&main_sema, remaining);
+     }
+ }
+ #endif /* AMOEBA */
  
  SIGNAL_T
  Exit(n)
***************
*** 2687,2698 ****
--- 3254,3273 ----
  	}
  #endif	/* USE_SYSV_UTMP */
  #endif	/* UTMP */
+ #ifndef AMOEBA
          close(pty); /* close explicitly to avoid race with slave side */
+ #endif
+ 
  #ifdef ALLOWLOGGING
  	if(screen->logging)
  		CloseLog(screen);
  #endif
  
+ #ifdef SOLX86
+ 	if(Console) close(SolX86cons);
+ #endif
+ 
+ #ifndef AMOEBA
  	if (!am_slave) {
  		/* restore ownership of tty and pty */
  		chown (ttydev, 0, 0);
***************
*** 2707,2712 ****
--- 3282,3290 ----
  #endif /* !sgi */
  	}
  	exit(n);
+ #else /* AMOEBA */
+ 	exitprocess(n);
+ #endif /* AMOEBA */
  	SIGNAL_RETURN;
  }
  
***************
*** 2716,2722 ****
  char *TermName;
  register char *oldtc, *newtc;
  {
! #ifndef USE_SYSV_ENVVARS
  	register char *ptr1, *ptr2;
  	register int i;
  	register int li_first = 0;
--- 3294,3300 ----
  char *TermName;
  register char *oldtc, *newtc;
  {
! #ifdef USE_TERMCAP_ENVVARS
  	register char *ptr1, *ptr2;
  	register int i;
  	register int li_first = 0;
***************
*** 2750,2756 ****
  	 screen->max_row + 1);
  	ptr2 = index (ptr2, ':');
  	strcat (newtc, ptr2);
! #endif /* USE_SYSV_ENVVARS */
  }
  
  /*
--- 3328,3334 ----
  	 screen->max_row + 1);
  	ptr2 = index (ptr2, ':');
  	strcat (newtc, ptr2);
! #endif /* USE_TERMCAP_ENVVARS */
  }
  
  /*
***************
*** 2822,2830 ****
--- 3400,3412 ----
   	strcat(buf, ": ");
   	strcat(buf, SysErrorMsg (oerrno));
   	strcat(buf, "\n");	
+ #ifdef AMOEBA
  	f = open("/dev/console",O_WRONLY);
  	write(f, buf, strlen(buf));
  	close(f);
+ #else
+ 	fputs(buf, stderr);
+ #endif
  #ifdef TIOCNOTTY
  	if ((f = open("/dev/tty", 2)) >= 0) {
  		ioctl(f, TIOCNOTTY, (char *)NULL);
***************
*** 2898,2906 ****
--- 3480,3490 ----
  }
  
  
+ #ifndef _MINIX
  int GetBytesAvailable (fd)
      int fd;
  {
+ #ifndef AMOEBA
  #ifdef FIONREAD
      static long arg;
      ioctl (fd, FIONREAD, (char *) &arg);
***************
*** 2912,2918 ****
--- 3496,3525 ----
      pollfds[0].events = POLLIN;
      return poll (pollfds, 1, 0);
  #endif
+ #else
+     /*
+      * Since this routine is only used to poll X connections
+      * we can use an internal Xlib routine (oh what ugly).
+      */
+     register TScreen *screen = &term->screen;
+     int count;
+ 
+     if (ConnectionNumber(screen->display) != fd) {
+ 	Panic("Cannot get bytes available");
+ 	return -1;
+     }
+     return _XBytesReadable(fd, &count) < 0 ? -1 : count;
+ #endif /* AMOEBA */
+ }
+ #else /* _MINIX */
+ int GetBytesAvailable (fd)
+     int fd;
+ {
+ 	return 0;
+ 	/* Let XPending do the checking */
+ 	/* return 1; */
  }
+ #endif /* _MINIX */
  
  /* Utility function to try to hide system differences from
     everybody who used to call killpg() */
***************
*** 2922,2927 ****
--- 3529,3541 ----
      int pid;
      int sig;
  {
+ #ifdef AMOEBA
+     if (pid != 2) {
+ 	fprintf(stderr, "%s:  unexpected process id %d.\n", ProgramName, pid);
+ 	abort();
+     }
+     ttysendsig(sig);
+ #else
  #ifndef X_NOT_POSIX
      return kill (-pid, sig);
  #else
***************
*** 2930,2934 ****
  #else
      return killpg (pid, sig);
  #endif
! #endif
  }
--- 3544,3549 ----
  #else
      return killpg (pid, sig);
  #endif
! #endif /* X_NOT_POSIX */
! #endif /* AMOEBA */
  }
diff -c mit/clients/xterm/menu.c:1.1.1.3 mit/clients/xterm/menu.c:2.0
*** mit/clients/xterm/menu.c:1.1.1.3	Sat Mar 12 00:44:51 1994
--- mit/clients/xterm/menu.c	Sat Mar 12 00:44:52 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/clients/xterm/menu.c,v 2.0 1993/11/13 04:23:11 dawes Exp $ */
  /* $XConsortium: menu.c,v 1.62 93/02/25 17:21:30 gildea Exp $ */
  /*
  Copyright 1989 Massachusetts Institute of Technology
***************
*** 163,173 ****
  #ifdef ALLOWLOGGING
  	    update_logging();
  #endif
! #ifndef SIGTSTP
  	    set_sensitivity (screen->mainMenu,
  			     mainMenuEntries[mainMenu_suspend].widget, FALSE);
  #endif
! #ifndef SIGCONT
  	    set_sensitivity (screen->mainMenu, 
  			     mainMenuEntries[mainMenu_continue].widget, FALSE);
  #endif
--- 164,174 ----
  #ifdef ALLOWLOGGING
  	    update_logging();
  #endif
! #if !defined(SIGTSTP) || defined(AMOEBA)
  	    set_sensitivity (screen->mainMenu,
  			     mainMenuEntries[mainMenu_suspend].widget, FALSE);
  #endif
! #if !defined(SIGCONT) || defined(AMOEBA)
  	    set_sensitivity (screen->mainMenu, 
  			     mainMenuEntries[mainMenu_continue].widget, FALSE);
  #endif
***************
*** 400,406 ****
      Widget gw;
      caddr_t closure, data;
  {
! #ifdef SIGTSTP
      handle_send_signal (gw, SIGTSTP);
  #endif
  }
--- 401,407 ----
      Widget gw;
      caddr_t closure, data;
  {
! #if defined(SIGTSTP) && !defined(AMOEBA)
      handle_send_signal (gw, SIGTSTP);
  #endif
  }
***************
*** 410,416 ****
      Widget gw;
      caddr_t closure, data;
  {
! #ifdef SIGCONT
      handle_send_signal (gw, SIGCONT);
  #endif
  }
--- 411,417 ----
      Widget gw;
      caddr_t closure, data;
  {
! #if defined(SIGCONT) && !defined(AMOEBA)
      handle_send_signal (gw, SIGCONT);
  #endif
  }
diff -c mit/clients/xterm/misc.c:1.1.1.3 mit/clients/xterm/misc.c:2.3
*** mit/clients/xterm/misc.c:1.1.1.3	Sat Mar 12 00:44:53 1994
--- mit/clients/xterm/misc.c	Sat Mar 12 00:44:53 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  *	$XFree86: mit/clients/xterm/misc.c,v 2.3 1993/11/13 04:23:16 dawes Exp $
   *	$XConsortium: misc.c,v 1.95.1.1 93/11/04 08:56:48 gildea Exp $
   */
  
***************
*** 516,525 ****
  StartLog(screen)
  register TScreen *screen;
  {
  	register char *cp;
  	register int i;
  	static char *log_default;
! #ifdef ALLOWLOGFILEEXEC
  	void logpipe();
  #ifdef SYSV
  	/* SYSV has another pointer which should be part of the
--- 517,531 ----
  StartLog(screen)
  register TScreen *screen;
  {
+ #ifndef ALLOWLOGGING
+ 	Bell();
+ 	Bell();
+ 	return;
+ #else
  	register char *cp;
  	register int i;
  	static char *log_default;
! #if defined(ALLOWLOGFILEEXEC)
  	void logpipe();
  #ifdef SYSV
  	/* SYSV has another pointer which should be part of the
***************
*** 617,622 ****
--- 623,629 ----
  	screen->logstart = screen->TekEmu ? Tbptr : bptr;
  	screen->logging = TRUE;
  	update_logging();
+ #endif /* ALLOWLOGGING */
  }
  
  CloseLog(screen)
***************
*** 642,655 ****
  	screen->logstart = screen->TekEmu ? Tbuffer : buffer;
  }
  
! #ifdef ALLOWLOGFILEEXEC
  void logpipe()
  {
  	register TScreen *screen = &term->screen;
  
! #ifdef SYSV
  	(void) signal(SIGPIPE, SIG_IGN);
! #endif	/* SYSV */
  	if(screen->logging)
  		CloseLog(screen);
  }
--- 649,662 ----
  	screen->logstart = screen->TekEmu ? Tbuffer : buffer;
  }
  
! #if defined(ALLOWLOGFILEEXEC)
  void logpipe()
  {
  	register TScreen *screen = &term->screen;
  
! #if defined(SYSV) || defined (SVR4) || defined(linux)
  	(void) signal(SIGPIPE, SIG_IGN);
! #endif	/* SYSV || SVR4 || linux */
  	if(screen->logging)
  		CloseLog(screen);
  }
***************
*** 768,777 ****
--- 775,788 ----
  char *SysErrorMsg (n)
      int n;
  {
+ #ifndef X_NO_STRERROR
+     return strerror(n);
+ #else
      extern char *sys_errlist[];
      extern int sys_nerr;
  
      return ((n >= 0 && n < sys_nerr) ? sys_errlist[n] : "unknown error");
+ #endif /* !X_NO_STRERROR */
  }
  
  
***************
*** 808,813 ****
--- 819,830 ----
  	if (screen->pid > 1) {
  	    (void) kill_process_group (screen->pid, SIGHUP);
  	}
+ #ifdef AMOEBA
+ 	if (!NULLPORT(&screen->proccap.cap_port))
+ 	    (void) pro_stun(&screen->proccap, -1L);
+ 	cb_close(screen->tty_outq);
+ 	cb_close(screen->tty_inq);
+ #endif
  	Exit (code);
  }
  
diff -c mit/clients/xterm/ptyx.h:1.1.1.2 mit/clients/xterm/ptyx.h:2.0
*** mit/clients/xterm/ptyx.h:1.1.1.2	Sat Mar 12 00:44:54 1994
--- mit/clients/xterm/ptyx.h	Sat Mar 12 00:44:54 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  *	$XFree86: mit/clients/xterm/ptyx.h,v 2.0 1993/11/13 04:23:18 dawes Exp $
   *	$XConsortium: ptyx.h,v 1.60.1.1 93/11/03 17:29:39 gildea Exp $
   */
  
***************
*** 33,38 ****
--- 34,53 ----
  #include <X11/Xfuncs.h>
  #include <X11/Xosdefs.h>
  
+ #ifdef AMOEBA
+ /*
+  * Bad planning.
+  * We should haved sticked to the _t convention
+  */
+ #define event __event
+ #define interval __interval
+ #include <amoeba.h>
+ #include <semaphore.h>
+ #include <circbuf.h>
+ #undef event
+ #undef interval
+ #endif
+ 
  /* Extra Xlib definitions */
  #define AllButtonsUp(detail, ignore)  (\
  		((ignore) == Button1) ? \
***************
*** 54,63 ****
--- 69,80 ----
  #ifdef SYSV
  #ifdef X_NOT_POSIX
  #ifndef CRAY
+ #ifndef SCO324
  #define	dup2(fd1,fd2)	((fd1 == fd2) ? fd1 : \
  				(close(fd2), fcntl(fd1, F_DUPFD, fd2)))
  #endif
  #endif
+ #endif
  #endif /* SYSV */
  
  /*
***************
*** 196,201 ****
--- 213,223 ----
  	Display		*display;	/* X display for screen		*/
  	int		respond;	/* socket for responses
  					   (position report, etc.)	*/
+ #ifdef AMOEBA
+ 	capability	proccap;	/* process capability		*/
+ 	struct circbuf	*tty_inq;	/* tty server input queue	*/
+ 	struct circbuf	*tty_outq;	/* tty server output queue	*/
+ #endif
  	long		pid;		/* pid of process on far side   */
  	int		uid;		/* user id of actual person	*/
  	int		gid;		/* group id of actual person	*/
diff -c mit/clients/xterm/resize.c:1.1.1.1 mit/clients/xterm/resize.c:2.0
*** mit/clients/xterm/resize.c:1.1.1.1	Sat Mar 12 00:44:54 1994
--- mit/clients/xterm/resize.c	Sat Mar 12 00:44:54 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  *	$XFree86: mit/clients/xterm/resize.c,v 2.0 1993/07/28 11:53:20 dawes Exp $
   *	$XConsortium: resize.c,v 1.27 91/07/23 11:11:19 rws Exp $
   */
  
***************
*** 54,73 ****
--- 55,103 ----
  #undef SYSV				/* pretend to be bsd */
  #endif /* macII */
  
+ #ifdef linux
+ #define USE_SYSV_TERMIO
+ #endif /* linux */
+ 
  #ifdef SYSV
  #define USE_SYSV_TERMIO
  #define USE_SYSV_UTMP
+ #define USE_TERMINFO
+ #ifdef SCO
+ #define USE_TERMCAP	/* allows resizing even with SCO broken TIOCSWINSZ */
+ #endif
  #else /* else not SYSV */
  #define USE_TERMCAP
+ #undef  USE_TERMINFO
  #endif /* SYSV */
  
+ #ifdef _MINIX
+ #define USE_POSIX_TERMIOS
+ #endif
+ 
  #include <sys/ioctl.h>
  #ifdef USE_SYSV_TERMIO
+ #ifdef linux
+ #include <termio.h>
+ #define USG /* no setitimer */
+ #else
  #include <sys/termio.h>
+ #ifdef SCO
+ #define USG /* no setitimer */
+ #endif /* SCO */
+ #endif
  #else /* else not USE_SYSV_TERMIO */
+ #ifdef USE_POSIX_TERMIOS
+ #include <termios.h>
+ #else
  #include <sgtty.h>
+ #endif
  #endif	/* USE_SYSV_TERMIO */
  
+ #ifndef IUCLC
+ #define IUCLC	0
+ #endif
+ 
  #ifdef USE_USG_PTYS
  #include <sys/stream.h>
  #include <sys/ptem.h>
***************
*** 147,157 ****
--- 177,191 ----
  	0,
  	"\033[8;%s;%st",
  };
+ #ifdef USE_POSIX_TERMIOS
+ struct termios tioorig;
+ #else
  #ifdef USE_SYSV_TERMIO
  struct termio tioorig;
  #else /* not USE_SYSV_TERMIO */
  struct sgttyb sgorig;
  #endif /* USE_SYSV_TERMIO */
+ #endif /* USE_POSIX_TERMIOS */
  char *size[EMULATIONS] = {
  	"\033[%d;%dR",
  	"\033[8;%d;%dt",
***************
*** 185,195 ****
--- 219,233 ----
  	struct passwd *pw;
  	int i;
  	int rows, cols;
+ #ifdef USE_POSIX_TERMIOS
+ 	struct termios tio;
+ #else
  #ifdef USE_SYSV_TERMIO
  	struct termio tio;
  #else /* not USE_SYSV_TERMIO */
  	struct sgttyb sg;
  #endif /* USE_SYSV_TERMIO */
+ #endif /* USE_POSIX_TERMIOS */
  #ifdef USE_TERMCAP
  	char termcap [1024];
  	char newtc [1024];
***************
*** 291,297 ****
  		    myname, env);
  	    exit(1);
  	}
! #else /* else not USE_TERMCAP */
  	if(!(env = getenv("TERM")) || !*env) {
  		env = "xterm";
  		if(SHELL_BOURNE == shell_type)
--- 329,336 ----
  		    myname, env);
  	    exit(1);
  	}
! #endif /* USE_TERMCAP */
! #ifdef USE_TERMINFO
  	if(!(env = getenv("TERM")) || !*env) {
  		env = "xterm";
  		if(SHELL_BOURNE == shell_type)
***************
*** 298,307 ****
  			setname = "TERM=xterm;\nexport TERM;\n";
  		else	setname = "setenv TERM xterm;\n";
  	}
! #endif	/* USE_TERMCAP */
  
! #ifdef USE_SYSV_TERMIO
  	ioctl (tty, TCGETA, &tioorig);
  	tio = tioorig;
  	tio.c_iflag &= ~(ICRNL | IUCLC);
  	tio.c_lflag &= ~(ICANON | ECHO);
--- 337,350 ----
  			setname = "TERM=xterm;\nexport TERM;\n";
  		else	setname = "setenv TERM xterm;\n";
  	}
! #endif /* USE_TERMINFO */
  
! #if defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)
! #ifdef USE_POSIX_TERMIOS
! 	tcgetattr(tty, &tioorig);
! #else
  	ioctl (tty, TCGETA, &tioorig);
+ #endif
  	tio = tioorig;
  	tio.c_iflag &= ~(ICRNL | IUCLC);
  	tio.c_lflag &= ~(ICANON | ECHO);
***************
*** 317,327 ****
--- 360,374 ----
  	signal(SIGINT, onintr);
  	signal(SIGQUIT, onintr);
  	signal(SIGTERM, onintr);
+ #ifdef USE_POSIX_TERMIOS
+ 	tcsetattr(tty, TCSADRAIN, &tio);
+ #else
  #ifdef USE_SYSV_TERMIO
  	ioctl (tty, TCSETAW, &tio);
  #else	/* not USE_SYSV_TERMIO */
  	ioctl (tty, TIOCSETP, &sg);
  #endif	/* USE_SYSV_TERMIO */
+ #endif  /* USE_POSIX_TERMIOS */
  
  	if (argc == 2) {
  		sprintf (buf, setsize[emu], argv[0], argv[1]);
***************
*** 374,384 ****
--- 421,435 ----
  #endif	/* TIOCGWINSZ */
  #endif	/* sun */
  
+ #ifdef USE_POSIX_TERMIOS
+ 	tcsetattr(tty, TCSADRAIN, &tioorig);
+ #else
  #ifdef USE_SYSV_TERMIO
  	ioctl (tty, TCSETAW, &tioorig);
  #else	/* not USE_SYSV_TERMIO */
  	ioctl (tty, TIOCSETP, &sgorig);
  #endif	/* USE_SYSV_TERMIO */
+ #endif	/* USE_POSIX_TERMIOS */
  	signal(SIGINT, SIG_DFL);
  	signal(SIGQUIT, SIG_DFL);
  	signal(SIGTERM, SIG_DFL);
***************
*** 413,426 ****
  	if(SHELL_BOURNE == shell_type) {
  
  #ifdef USE_TERMCAP
  		printf ("%sTERMCAP='%s'\n",
  		 setname, termcap);
! #else /* else not USE_TERMCAP */
  #ifndef SVR4
  		printf ("%sCOLUMNS=%d;\nLINES=%d;\nexport COLUMNS LINES;\n",
  			setname, cols, rows);
  #endif /* !SVR4 */
! #endif	/* USE_SYSV_TERMCAP */
  
  	} else {		/* not Bourne shell */
  
--- 464,482 ----
  	if(SHELL_BOURNE == shell_type) {
  
  #ifdef USE_TERMCAP
+ #ifndef USE_TERMINFO
  		printf ("%sTERMCAP='%s'\n",
  		 setname, termcap);
! #else
! 		printf ("%sTERMCAP='%s';\nexport TERMCAP;\n", setname, termcap);
! #endif
! #endif /* USE_TERMCAP */
! #ifdef USE_TERMINFO
  #ifndef SVR4
  		printf ("%sCOLUMNS=%d;\nLINES=%d;\nexport COLUMNS LINES;\n",
  			setname, cols, rows);
  #endif /* !SVR4 */
! #endif /* USE_TERMINFO */
  
  	} else {		/* not Bourne shell */
  
***************
*** 427,433 ****
  #ifdef USE_TERMCAP
  		printf ("set noglob;\n%ssetenv TERMCAP '%s';\nunset noglob;\n",
  		 setname, termcap);
! #else /* else not USE_TERMCAP */
  #ifndef SVR4
  		printf ("set noglob;\n%ssetenv COLUMNS '%d';\nsetenv LINES '%d';\nunset noglob;\n",
  			setname, cols, rows);
--- 483,490 ----
  #ifdef USE_TERMCAP
  		printf ("set noglob;\n%ssetenv TERMCAP '%s';\nunset noglob;\n",
  		 setname, termcap);
! #endif /* USE_TERMCAP */
! #ifdef USE_TERMINFO
  #ifndef SVR4
  		printf ("set noglob;\n%ssetenv COLUMNS '%d';\nsetenv LINES '%d';\nunset noglob;\n",
  			setname, cols, rows);
***************
*** 473,484 ****
  {
  	register int last, c;
  	SIGNAL_T timeout();
! #ifndef USG
  	struct itimerval it;
  #endif
  
  	signal(SIGALRM, timeout);
! #ifdef USG
  	alarm (TIMEOUT);
  #else
  	bzero((char *)&it, sizeof(struct itimerval));
--- 530,541 ----
  {
  	register int last, c;
  	SIGNAL_T timeout();
! #if !defined(USG) && !defined(AMOEBA) && !defined(_MINIX)
  	struct itimerval it;
  #endif
  
  	signal(SIGALRM, timeout);
! #if defined(USG) || defined(AMOEBA) || defined(_MINIX)
  	alarm (TIMEOUT);
  #else
  	bzero((char *)&it, sizeof(struct itimerval));
***************
*** 497,503 ****
  	last = str[strlen(str) - 1];
  	while((*buf++ = getc(fp)) != last)
  	    ;
! #ifdef USG
  	alarm (0);
  #else
  	bzero((char *)&it, sizeof(struct itimerval));
--- 554,560 ----
  	last = str[strlen(str) - 1];
  	while((*buf++ = getc(fp)) != last)
  	    ;
! #if defined(USG) || defined(AMOEBA) || defined(_MINIX)
  	alarm (0);
  #else
  	bzero((char *)&it, sizeof(struct itimerval));
***************
*** 527,536 ****
--- 584,597 ----
  onintr(sig)
      int sig;
  {
+ #ifdef USE_POSIX_TERMIOS
+ 	tcsetattr(tty, TCSADRAIN, &tioorig);
+ #else
  #ifdef USE_SYSV_TERMIO
  	ioctl (tty, TCSETAW, &tioorig);
  #else	/* not USE_SYSV_TERMIO */
  	ioctl (tty, TIOCSETP, &sgorig);
  #endif	/* USE_SYSV_TERMIO */
+ #endif	/* USE_POSIX_TERMIOS */
  	exit(1);
  }
diff -c mit/clients/xterm/screen.c:1.1.1.1 mit/clients/xterm/screen.c:1.6
*** mit/clients/xterm/screen.c:1.1.1.1	Sat Mar 12 00:44:55 1994
--- mit/clients/xterm/screen.c	Sat Mar 12 00:44:55 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  *	$XFree86: mit/clients/xterm/screen.c,v 1.6 1993/03/20 06:12:36 dawes Exp $
   *	$XConsortium: screen.c,v 1.30 91/08/22 16:27:13 gildea Exp $
   */
  
***************
*** 39,49 ****
  #include <sys/ioctl.h>
  #endif
  
! #ifdef att
  #include <sys/termio.h>
  #include <sys/stream.h>			/* get typedef used in ptem.h */
  #include <sys/ptem.h>
  #endif
  
  extern Char *calloc(), *malloc(), *realloc();
  extern void free();
--- 40,54 ----
  #include <sys/ioctl.h>
  #endif
  
! #if defined(att) || defined(ISC)
  #include <sys/termio.h>
  #include <sys/stream.h>			/* get typedef used in ptem.h */
  #include <sys/ptem.h>
  #endif
+ 
+ #if _MINIX
+ #include <termios.h>
+ #endif /* _MINIX */
  
  extern Char *calloc(), *malloc(), *realloc();
  extern void free();
diff -c mit/clients/xterm/terminfo:1.1.1.1 mit/clients/xterm/terminfo:2.0
*** mit/clients/xterm/terminfo:1.1.1.1	Sat Mar 12 00:44:57 1994
--- mit/clients/xterm/terminfo	Sat Mar 12 00:44:57 1994
***************
*** 1,17 ****
  xterm|vs100|xterm terminal emulator,
! 	ind=^J, cols#80, lines#65,
! 	clear=\E[H\E[2J, cub1=^H, am, cup=\E[%i%p1%d;%p2%dH,
! 	cuf1=\E[C, cuu1=\E[A, el=\E[K, ed=\E[J,
! 	cud=\E[%p1%dB, cuu=\E[%p1%dA, cub=\E[%p1%dD,
! 	cuf=\E[%p1%dC, km,
! 	smso=\E[7m, rmso=\E[m, smul@, rmul@,
! 	bold=\E[1m, rev=\E[7m, blink=@, sgr0=\E[m,
! 	rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, rs2=@
! 	kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, ht=^I, ri=\EM,
! 	vt@, xon@, csr=\E[%i%p1%d;%p2%dr,
! 	il=\E[%p1%dL, dl=\E[%p1%dM, il1=\E[L, dl1=\E[M,
! 	ich=\E[%p1%d@, dch=\E[%p1%dP, ich1=\E[@, dch1=\E[P,
! 	use=vt100-am,
  xterms|vs100s|xterm terminal emulator (small screen 24x80),
  	cols#80, lines#24,
  	use=xterm,
--- 1,24 ----
  xterm|vs100|xterm terminal emulator,
! 	am, xenl, km, msgr,
! 	cols#80, it#8, lines#65,
! 	bel=^G, cr=\r, csr=\E[%i%p1%d;%p2%dr, tbc=\E[3g,
! 	clear=\E[H\E[2J, el=\E[K, ed=\E[J, cup=\E[%i%p1%d;%p2%dH,
! 	cud1=\n, home=\E[H, cub1=\b, cuf1=\E[C,
! 	cuu1=\E[A, dch1=\E[P, dl1=\E[M, blink=@,
! 	bold=\E[1m, rev=\E[7m, smso=\E[7m, sgr0=\E[m,
! 	rmso=\E[m, ich1=\E[@, il1=\E[L, kbs=\b,
! 	kdch1=\E[3~, kdl1=\E[31~, kel=\E[8~, kcud1=\EOB, kf0=\EOq,
! 	kf1=\E[11~, kf10=\E[21~, kf2=\E[12~, kf3=\E[13~,
! 	kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~,
! 	kf8=\E[19~, kf9=\E[20~, khome=\E[7~, kich1=\E[2~,
! 	kil1=\E[30~, kcub1=\EOD, knp=\E[6~, kpp=\E[5~,
! 	kcuf1=\EOC, kcuu1=\EOA, rmkx=\E[?1l\E>, smkx=\E[?1h\E=,
! 	dch=\E[%p1%dP, dl=\E[%p1%dM, cud=\E[%p1%dB, ich=\E[%p1%d@,
! 	il=\E[%p1%dL, cub=\E[%p1%dD, cuf=\E[%p1%dC, cuu=\E[%p1%dA,
! 	rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, rc=\E8, sc=\E7,
! 	ind=\n, ri=\EM,
! 	sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m,
! 	hts=\EH, ht=\t, kf11=\E[23~, kf12=\E[24~,
  xterms|vs100s|xterm terminal emulator (small screen 24x80),
  	cols#80, lines#24,
  	use=xterm,
diff -c /dev/null mit/clients/xterm/ttysvr.c:2.0
*** /dev/null	Sat Mar 12 00:44:57 1994
--- mit/clients/xterm/ttysvr.c	Sat Mar 12 00:44:57 1994
***************
*** 0 ****
--- 1,533 ----
+ /*
+  * $XFree86: mit/clients/xterm/ttysvr.c,v 2.0 1993/10/02 07:11:43 dawes Exp $
+  *
+  * ttysvr.c
+  *
+  * Simple tty server for xterm. Most of it is taken from Siebren's aterm.
+  *
+  * Author:
+  *	Leendert van Doorn, 1992
+  */
+ 
+ #include "ptyx.h"
+ #include "data.h"
+ #include "error.h"
+ #include <stdio.h>
+ 
+ extern char *ProgramName;
+ 
+ #ifdef AMOEBA
+ #include <sys/types.h>
+ #include <ailamoeba.h>
+ #include <signal.h>
+ #include <exception.h>
+ #include <thread.h>
+ #include <cmdreg.h>
+ #include <stdcom.h>
+ #include <stderr.h>
+ #include <limits.h>
+ #include <proc.h>
+ #include <file.h>
+ #include <fault.h>
+ #include <class/tios.h>
+ #include <server/tty/tty.h>
+ 
+ 
+ /*
+  * AIL stuff
+  */
+ #define SAME_ENDIAN(w)	(((w)&_AIL_ENDIAN) == (_ailword & _AIL_ENDIAN) )
+ 
+ extern char *tc_marshal();
+ extern char *tc_unmarshal();
+ extern void millisleep();
+ 
+ #define	CTRL(c)		((c) & 0x1f)
+ 
+ /*
+  * Tty input data structure.
+  * This is a separate buffer in which the edited line is built.
+  */
+ static char tty_line[_POSIX_MAX_CANON+1];
+ static char *tty_ptr;
+ static int tty_left;
+ 
+ /*
+  * A global flags which denotes whether we're busy with exiting. This
+  * prevents two cleanups to be running (one from ttythread, and one
+  * from the main stream code as a result of a failed _XAmSelect).
+  */
+ int exiting = False;
+ 
+ /*
+  * Mutexes to prevent concurrent reads/writes
+  */
+ static mutex read_mutex;
+ static mutex write_mutex;
+ 
+ port ttyport;
+ capability ttycap;
+ capability ttyintcap;
+ struct termios tios;
+ 
+ /*
+  * Initialize the TTY structures.
+  * Publish the tty capability when a name is provided.
+  */
+ void
+ ttyinit(name)
+     char *name;
+ {
+     mu_init(&read_mutex);
+     mu_init(&write_mutex);
+ 
+     uniqport(&ttyport);
+     priv2pub(&ttyport, &ttycap.cap_port);
+ 
+     if (name != NULL) {
+ 	errstat err;
+ 	(void) name_delete(name);
+ 	if ((err = name_append(name, &ttycap)) != STD_OK) {
+ 	    fprintf(stderr, "%s: cannot append %s: %s\n",
+ 		ProgramName, name, err_why(err));
+ 	    Exit(1);
+ 	}
+     }
+ 
+     tios.c_iflag = ICRNL | IXON;
+     tios.c_oflag = OPOST;
+     tios.c_cflag = CREAD | CS8 | B9600;
+     tios.c_lflag = ECHO | ECHOE | ECHOK | ICANON | ISIG;
+ 
+     tios.c_cc[VEOF] = CTRL('D');
+     tios.c_cc[VEOL] = _POSIX_VDISABLE;
+     tios.c_cc[VERASE] = CTRL('H');
+     tios.c_cc[VINTR] = CTRL('C');
+     tios.c_cc[VKILL] = CTRL('U');
+     tios.c_cc[VMIN] = 1;
+     tios.c_cc[VQUIT] = CTRL('\\');
+     tios.c_cc[VSUSP] = _POSIX_VDISABLE;
+     tios.c_cc[VTIME] = 0;
+     tios.c_cc[VSTART] = CTRL('Q');
+     tios.c_cc[VSTOP] = CTRL('S');
+ }
+ 
+ /* ARGSUSED */
+ static void
+ ttycatcher(sig, us, extra)
+     signum sig;
+     thread_ustate *us;
+     char *extra;
+ {
+     *((int *)extra) = True;
+ }
+ 
+ void
+ ttythread()
+ {
+     TScreen *screen = &term->screen;
+     struct circbuf *iq, *oq;
+     header hdr;
+     char *buf;
+     int n, cause, detail;
+     int signalled;
+     struct termios ttios;
+ 
+     oq = screen->tty_outq;
+     iq = screen->tty_inq;
+     buf = (char *)malloc(BUFSIZ);
+     if (buf == (char *)NULL) {
+ 	fprintf(stderr, "%s:  cannot malloc tty server buffer.\n",
+ 		ProgramName);
+ 	Exit(1);
+     }
+ 
+     sig_catch((signum) SIG_TRANS, ttycatcher, (char *) &signalled);
+     for (;;) {
+ 	if (exiting) { /* shell disappeared */
+ 	    if (cause == TERM_STUNNED)
+ 		fprintf(stderr, "%s: stun code %d\n", ProgramName, detail);
+ 	    else if (cause == TERM_EXCEPTION)
+ 		fprintf(stderr, "%s: exception code %d\n", ProgramName, detail);
+ 	    else if (cause != TERM_NORMAL)
+ 		fprintf(stderr, "%s: termination cause %d, detail %d\n",
+ 		    ProgramName, cause, detail);
+ 	    Cleanup(0);
+ 	}
+ 
+ 	signalled = False;
+ 	do {
+ 	    hdr.h_port = ttyport;
+ 	    n = getreq(&hdr, (bufptr) buf, BUFSIZ);
+ 	} while (ERR_CONVERT(n) == RPC_ABORTED);
+ 	if (ERR_STATUS(n)) {
+ 	    fprintf(stderr, "%s:  get request failed (%s)\n",
+ 		ProgramName, err_why(ERR_CONVERT(n)));
+ 	    Cleanup(1);
+ 	}
+ 
+ 	switch (hdr.h_command) {
+ 	case FSQ_CREATE:
+ 	    hdr.h_status = STD_OK;
+ 	    n = 0;
+ 	    break;
+ 	case FSQ_READ:
+ 	    if (!(tios.c_cflag & CREAD)) {
+ 		hdr.h_status = STD_NOTNOW;
+ 		n = 0;
+ 		break;
+ 	    }
+ 	    while (!signalled) {
+ 		if (mu_trylock(&read_mutex, -1) < 0)
+ 		    continue;
+ 		hdr.h_size = ttycanonread(buf, (int)hdr.h_size, &signalled);
+ 		hdr.h_extra = tty_left > 0 ? FSE_MOREDATA : FSE_NOMOREDATA;
+ 		mu_unlock(&read_mutex);
+ 		break;
+ 	    }
+ 	    n = hdr.h_size;
+ 	    hdr.h_status = signalled ? STD_INTR : STD_OK;
+ 	    break;
+ 	case FSQ_WRITE:
+ 	    mu_lock(&write_mutex);
+ 	    n = ttywrite(buf, n);
+ 	    mu_unlock(&write_mutex);
+ 	    hdr.h_size = n;
+ 	    hdr.h_status = STD_OK;
+ 	    n = 0;
+ 	    break;
+ 	case TTQ_CLOSE:
+ 	case TTQ_STATUS:
+ 	case TTQ_CONTROL:
+ 	case TTQ_TIME_READ:
+ 	    hdr.h_status = STD_COMBAD;
+ 	    n = 0;
+ 	    break;
+ 	case TIOS_SETATTR:
+ 	    (void) tc_unmarshal(buf, &ttios, SAME_ENDIAN(hdr.h_size));
+ 	    if (tios_check(&ttios)) {
+ 		hdr.h_status = STD_OK;
+ 		tios = ttios;
+ 	    } else
+ 		hdr.h_status = STD_ARGBAD;
+ 	    n = 0;
+ 	    break;
+ 	case TIOS_GETATTR:
+ 	    n = tc_marshal(buf, tios, SAME_ENDIAN(hdr.h_extra)) - buf;
+ 	    hdr.h_status = STD_OK;
+ 	    break;
+ 	case TIOS_SENDBREAK:
+ 	case TIOS_DRAIN:
+ 	case TIOS_FLUSH:
+ 	case TIOS_FLOW:
+ 	    hdr.h_status = STD_OK;
+ 	    n = 0;
+ 	    break;
+ 	case TIOS_GETWSIZE:
+ 	    hdr.h_extra = screen->max_col + 1;
+ 	    hdr.h_size = screen->max_row + 1;
+ 	    hdr.h_status = STD_OK;
+ 	    n = 0;
+ 	    break;
+ 	case STD_AGE:
+ 	case STD_COPY:
+ 	case STD_RESTRICT:
+ 	    hdr.h_status = STD_COMBAD;
+ 	    n = 0;
+ 	    break;
+ 	case STD_TOUCH:
+ 	    hdr.h_status = STD_OK;
+ 	    n = 0;
+ 	    break;
+ 	case STD_DESTROY:
+ 	    hdr.h_status = STD_DENIED;
+ 	    n = 0;
+ 	    break;
+ 	case STD_INFO:
+ 	    hdr.h_status = STD_OK;
+ 	    strcpy(buf, "Xterm tty server");
+ 	    n = strlen(buf);
+ 	    break;
+ 	case PS_CHECKPOINT:
+ 	    exiting = True;
+ 	    cb_putc(oq, '\0');
+ 	    WakeupMainThread();
+ 	    cause = hdr.h_extra;
+ 	    detail = hdr.h_offset;
+ 	    hdr.h_status = STD_OK;
+ 	    n = 0;
+ 	    break;
+ 	case PS_SWAPPROC:
+ 	    hdr.h_status = STD_OK;
+ 	    n = 0;
+ 	    break;
+ 	case TTQ_INTCAP:
+ 	    if (n == sizeof(capability))  {
+ 		hdr.h_status = STD_OK;
+ 		bcopy(buf, (char *)&ttyintcap, sizeof(capability));
+ 	    } else
+ 		hdr.h_status = STD_ARGBAD;
+ 	    n = 0;
+ 	    break;
+ 	default:
+ 	    hdr.h_status = STD_COMBAD;
+ 	    n = 0;
+ 	}
+ 	putrep(&hdr, (bufptr) buf, n);
+     }
+ }
+ 
+ int
+ tios_check(tp)
+     struct termios *tp;
+ {
+     register int i, j;
+ 
+     /*
+      * Check that all chars in th c_cc array are
+      * different, except VTIME and VMIN
+      */
+     for (i = 0; i < sizeof(tp->c_cc); ++i) {
+ 	if (i != VTIME && i != VMIN) for (j = 0; j < i; ++j)
+ 	    if (j != VTIME && j != VMIN &&
+ 	      tp->c_cc[i] == tp->c_cc[j] && tp->c_cc[i] != _POSIX_VDISABLE)
+ 		return False;
+     }
+ 
+     /* cannot change byte size */
+     if ((tp->c_cflag & CSIZE) != CS8)
+ 	return False;
+     return True;
+ }
+ 
+ void
+ erasechar(oq, n, echo)
+     struct circbuf *oq;
+     int n, echo;
+ {
+     register int rcol;
+ 
+     if (!echo) return;
+     if (n > 0) {
+ 	rcol = n - 1;
+ 	cb_putc(oq, '\b');
+ 	if (tios.c_lflag & ECHOE)
+ 	    cb_puts(oq, " \b", 2);
+     } else
+ 	cb_putc(oq, CTRL('G'));
+     WakeupMainThread();
+ }
+ 
+ void
+ linekill(oq, n, echo)
+     struct circbuf *oq;
+     int n, echo;
+ {
+     register int rcol;
+ 
+     if (!echo) return;
+     if (n > 0) {
+ 	for (rcol = n-1; rcol >= 0; rcol--) {
+ 	    cb_putc(oq, '\b');
+ 	    if (tios.c_lflag & ECHOK)
+ 		cb_puts(oq, " \b", 2);
+ 	}
+     } else
+ 	cb_putc(oq, CTRL('G'));
+     WakeupMainThread();
+ }
+ 
+ /*
+  * Canonize
+  */
+ #define ISSET(t, flag)	(((t).c_lflag & flag) != 0)
+ 
+ void
+ canonize(signalled)
+     int *signalled;
+ {
+     TScreen *screen = &term->screen;
+     struct circbuf *iq, *oq;
+     int ch, n;
+     int stop;
+     
+     n = 0;
+     oq = screen->tty_outq;
+     iq = screen->tty_inq;
+ 
+     for (stop = False; !stop; ) {
+ 	/* get a character, depending on canonisation */
+ 	if (!ISSET(tios, ICANON)) {
+ 	    /*
+ 	     * No canonization
+ 	     */
+ 	    int time = tios.c_cc[VTIME] * 100; /* inter-byte delay (in msec) */
+ 
+ 	    ch = time ? cb_trygetc(iq, time) : cb_trygetc(iq, -1);
+ 	    if (ch < 0 || *signalled)
+ 		break;
+ 	} else {
+ 	    /*
+ 	     * Canonized input
+ 	     */
+ 	    ch = cb_trygetc(iq, -1);
+ 	    if (ch == -1)
+ 		break;
+ 	}
+ 
+ 	/* ICANON may have changed while we waited for the first character */
+ 	if (!ISSET(tios, ICANON)) {
+ 	    int min = tios.c_cc[VMIN]; /* minimum characters to read */
+ 
+ 	    if (ISSET(tios, ECHO)) cb_putc(oq, ch);
+ 	    tty_line[n++] = ch;
+ 	    if (n >= sizeof(tty_line) || (min > 0 && n >= min))
+ 		break;
+ 	} else {
+ 	    if (tios.c_iflag & ISTRIP) ch &= 0x7f;
+ 	    if (ch == tios.c_cc[VEOF]) {
+ 		stop = True;
+ 	    } else if (ch == tios.c_cc[VERASE]) {
+ 		/* erase a single character */
+ 		erasechar(oq, n, ISSET(tios, ECHO));
+ 		if (n != 0) n--;
+ 	    } else if (ch == tios.c_cc[VKILL]) {
+ 		/* erase a whole line */
+ 		linekill(oq, n, ISSET(tios, ECHO));
+ 		n = 0;
+ 	    } else {
+ 		if (n > sizeof(tty_line)) {
+ 		    cb_putc(oq, CTRL('G'));
+ 		    continue;
+ 		}
+ 		if (ch == '\r' || ch == '\n' || ch == tios.c_cc[VEOL]) {
+ 		    if (tios.c_iflag & ICRNL)
+ 			ch = '\n';
+ 		    else if (tios.c_iflag & INLCR)
+ 			ch = '\r';
+ 		    if (ch == '\n' && tios.c_iflag & ICRNL)
+ 			cb_putc(oq, '\r');
+ 		    stop = True;
+ 		}
+ 		if (ISSET(tios, ECHO)) cb_putc(oq, ch);
+ 		tty_line[n++] = ch;
+ 	    }
+ 	}
+     }
+     if (ISSET(tios, ECHO)) WakeupMainThread();
+     tty_left = n;
+     tty_ptr = tty_line;
+ }
+ 
+ /*
+  * Canonized tty read
+  */
+ int
+ ttycanonread(buf, size, signalled)
+     char *buf;
+     size_t size;
+     int *signalled;
+ {
+     if (tty_left == 0)
+ 	canonize(signalled);
+     if (size > tty_left)
+ 	size = tty_left;
+     strncpy(buf, tty_ptr, size);
+     tty_ptr += size;
+     tty_left -= size;
+     return size;
+ }
+ 
+ /*
+  * Write data to tty
+  */
+ int
+ ttywrite(buf, size)
+     char *buf;
+     int size;
+ {
+     TScreen *screen = &term->screen;
+     struct circbuf *oq;
+     int ch, i;
+ 
+     oq = screen->tty_outq;
+     for (i = 0; i < size; i++) {
+ 	if ((ch = buf[i]) == '\n' && tios.c_iflag & ICRNL)
+ 	    cb_putc(oq, '\r');
+ 	cb_putc(oq, ch);
+ 	if (ch == '\n') {
+ 	    /* Provide a wakeup for each line.  Otherwise the circular buffer
+ 	     * could be filled (thus blocking us) without the main thread
+ 	     * knowing it can already process some data.
+ 	     */
+ 	    WakeupMainThread();
+ 	}
+     }
+     WakeupMainThread();
+     return size;
+ }
+ 
+ static void
+ flush_read()
+ {
+     TScreen *screen = &term->screen;
+     struct circbuf *iq;
+     char *p;
+     int n;
+ 
+     iq = screen->tty_inq;
+     cb_putc(iq, '\n');
+     mu_lock(&read_mutex);
+     while ((n = cb_getp(iq, &p, 0/*don't block*/)) > 0)
+ 	cb_getpdone(iq, n);
+     tty_left = 0;
+     mu_unlock(&read_mutex);
+     WakeupMainThread();
+ }
+ 
+ /*
+  * Before characters are pushed onto the input stream of the shell
+  * process some of them may need some pre-processing. For example,
+  * interrupt should be processed as soon as possible to obtain the
+  * desired effect. This routine deals with key strokes that have
+  * such special properties.
+  */
+ int
+ ttypreprocess(ch)
+     int ch;
+ {
+     if ((tios.c_lflag & ISIG) && ch == tios.c_cc[VQUIT]) {
+ 	if (!(tios.c_lflag & NOFLSH)) flush_read();
+ 	ttysendsig(SIGQUIT);
+ 	return 1;
+     }
+     if ((tios.c_lflag & ISIG) && ch == tios.c_cc[VINTR]) {
+ 	if (!(tios.c_lflag & NOFLSH)) flush_read();
+ 	ttysendsig(SIGINT);
+ 	return 1;
+     }
+     return 0;
+ }
+ 
+ /*
+  * Send Unix signal to shell
+  */
+ ttysendsig(sig)
+     int sig;
+ {
+     header hdr;
+     long tout;
+ 
+     if (!(tios.c_lflag & ISIG))
+ 	return;
+     if (NULLPORT(&ttyintcap.cap_port))
+ 	return;
+     hdr.h_port = ttyintcap.cap_port;
+     hdr.h_priv = ttyintcap.cap_priv;
+     hdr.h_extra = sig;
+     hdr.h_command = TTI_SIGNAL;
+     tout = timeout(2000L);
+     trans(&hdr, NILBUF, 0, &hdr, NILBUF, 0);
+     timeout(tout);
+ }
+ #endif /* AMOEBA */
diff -c mit/demos/x11perf/do_copyarea.c:1.1.1.1 mit/demos/x11perf/do_copyarea.c:1.3
*** mit/demos/x11perf/do_copyarea.c:1.1.1.1	Sat Mar 12 00:45:06 1994
--- mit/demos/x11perf/do_copyarea.c	Sat Mar 12 00:45:06 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/x11perf/do_copyarea.c,v 1.3 1993/03/27 08:53:56 dawes Exp $ */
  /*****************************************************************************
  Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
  
***************
*** 345,351 ****
--- 346,355 ----
  
  #ifdef MITSHM
  
+ #ifndef __TYPES__
  #include <sys/types.h>
+ #define __TYPES__
+ #endif
  #include <sys/ipc.h>
  #include <sys/shm.h>
  #include <X11/extensions/XShm.h>
diff -c mit/demos/x11perf/x11pcomp.cpp:1.1.1.1 mit/demos/x11perf/x11pcomp.cpp:1.3
*** mit/demos/x11perf/x11pcomp.cpp:1.1.1.1	Sat Mar 12 00:45:06 1994
--- mit/demos/x11perf/x11pcomp.cpp	Sat Mar 12 00:45:06 1994
***************
*** 16,24 ****
  XCOMM Mark Moraes, University of Toronto <moraes@csri.toronto.edu>
  XCOMM Joel McCormack, DEC Western Research Lab <joel@decwrl.dec.com>
  XCOMM
  XCOMM $XConsortium: x11pcomp.cpp,v 1.6 91/08/22 11:43:57 rws Exp $
  
! PATH=LIBPATH:.:$PATH
  export PATH
  
  set -e
--- 16,30 ----
  XCOMM Mark Moraes, University of Toronto <moraes@csri.toronto.edu>
  XCOMM Joel McCormack, DEC Western Research Lab <joel@decwrl.dec.com>
  XCOMM
+ XCOMM $XFree86: mit/demos/x11perf/x11pcomp.cpp,v 1.3 1993/04/11 13:52:16 dawes Exp $
  XCOMM $XConsortium: x11pcomp.cpp,v 1.6 91/08/22 11:43:57 rws Exp $
  
! if [ x"$XWINHOME" != x ]; then
!     LIB_PATH=$XWINHOME/lib/X11/x11perfcomp
! else
!     LIB_PATH=LIBPATH
! fi
! PATH=$LIB_PATH:.:$PATH
  export PATH
  
  set -e
diff -c mit/demos/x11perf/x11perf.c:1.1.1.1 mit/demos/x11perf/x11perf.c:1.3
*** mit/demos/x11perf/x11perf.c:1.1.1.1	Sat Mar 12 00:45:07 1994
--- mit/demos/x11perf/x11perf.c	Sat Mar 12 00:45:07 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/x11perf/x11perf.c,v 1.3 1993/03/25 14:15:55 dawes Exp $ */
  /*****************************************************************************
  Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
  
***************
*** 149,154 ****
--- 150,182 ----
      return 0;
  }
  
+ #endif
+ 
+ #ifdef AMOEBA
+ static int
+ gettimeofday(tvp, tzp)
+     struct timeval *tvp;
+     struct timezone *tzp;
+ {
+     static unsigned long lasttime, timedelta;
+     unsigned long curtime;
+ 
+     curtime = sys_milli();
+     if (lasttime == 0 || lasttime > curtime) {
+ 	/* re-init time */
+ 	timedelta = time((time_t *) 0) - curtime/1000;
+     }
+     lasttime = curtime;
+     tvp->tv_sec = timedelta + curtime/1000;
+     tvp->tv_usec = 1000 * (curtime%1000);
+ }
+ #endif
+ 
+ #ifdef _MINIX
+ struct timezone {
+     int  tz_minuteswest;
+     int  tz_dsttime;
+ };
  #endif
  
  static struct  timeval start;
diff -c mit/demos/xgc/Imakefile:1.1.1.1 mit/demos/xgc/Imakefile:2.0
*** mit/demos/xgc/Imakefile:1.1.1.1	Sat Mar 12 00:45:11 1994
--- mit/demos/xgc/Imakefile	Sat Mar 12 00:45:11 1994
***************
*** 1,12 ****
  XCOMM $XConsortium: Imakefile,v 1.9 91/07/16 23:08:10 gildea Exp $
          DEFINES = 
             SRCS = dashlist.c planemask.c getfile.c tests.c text.c \
                    choice.c main.c interpret.c record.c testfrac.c
        OTHERSRCS = gram.y lex.l
             OBJS = dashlist.o planemask.o getfile.o tests.o text.o \
                    choice.o main.o interpret.o record.o testfrac.o \
                    gram.o lex.o
! LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
    SYS_LIBRARIES = -lm
           YFLAGS = -d
--- 1,18 ----
+ XCOMM $XFree86: mit/demos/xgc/Imakefile,v 2.0 1993/12/18 11:43:23 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.9 91/07/16 23:08:10 gildea Exp $
          DEFINES = 
             SRCS = dashlist.c planemask.c getfile.c tests.c text.c \
                    choice.c main.c interpret.c record.c testfrac.c
        OTHERSRCS = gram.y lex.l
+ #if i386Bsd || defined(LinuxArchitecture)
+       LEXPIECES = lex.l2
+ #else
+       LEXPIECES = lex.l1 lex.l2
+ #endif
             OBJS = dashlist.o planemask.o getfile.o tests.o text.o \
                    choice.o main.o interpret.o record.o testfrac.o \
                    gram.o lex.o
! LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(LEXLIB) $(XLIB)
          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
    SYS_LIBRARIES = -lm
           YFLAGS = -d
***************
*** 15,26 ****
  
  InstallAppDefaults(Xgc)
  
  gram.h gram.c: gram.y
! 	yacc -d gram.y
  	$(MV) y.tab.c gram.c
  	$(MV) y.tab.h gram.h
  
  clean::
! 	$(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c
  
  depend:: lex.c gram.c
--- 21,36 ----
  
  InstallAppDefaults(Xgc)
  
+ lex.l: $(LEXPIECES)
+ 	$(RM) lex.l
+ 	cat $(LEXPIECES) > lex.l
+ 
  gram.h gram.c: gram.y
! 	$(YACC) $(YFLAGS) gram.y
  	$(MV) y.tab.c gram.c
  	$(MV) y.tab.h gram.h
  
  clean::
! 	$(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c lex.l
  
  depend:: lex.c gram.c
diff -c mit/demos/xgc/lex.l:1.1.1.1 mit/demos/xgc/lex.l:removed
*** mit/demos/xgc/lex.l:1.1.1.1	Sat Mar 12 00:45:12 1994
--- mit/demos/xgc/lex.l	Sat Mar 12 00:45:11 1994
***************
*** 1,163 ****
- /*
- ** lex file for xgc syntax
- */
- 
- /* Lots of stuff stolen from gwm's wool.lex */
- 
- %{
- 
- #include <X11/X.h>
- #include "gram.h"
- #include "constants.h"
- 
- %}
- 
- %p				4000
- %a				3000
- 
- number				[0-9]+
- word				[^\n\t ]+
- string				\"([^"]|\\.)*\"
- 
- %%
- 
- [Rr]un				{ return (RUN); }
- 
- [Ff]unction			{ return (FUNCTION); }
- [Cc]lear			{ yylval.num = GXclear;
- 				  return (FUNCTIONTYPE); }
- [Aa]nd				{ yylval.num = GXand;
- 				  return (FUNCTIONTYPE); }
- [Aa]ndReverse			{ yylval.num = GXandReverse;
- 				  return (FUNCTIONTYPE); }
- [Cc]opy				{ yylval.num = GXcopy;
- 				  return (FUNCTIONTYPE); }
- [Aa]ndInverted			{ yylval.num = GXandInverted;
- 				  return (FUNCTIONTYPE); }
- [Nn]oop				{ yylval.num = GXnoop;
- 				  return (FUNCTIONTYPE); }
- [Xx]or				{ yylval.num = GXxor;
- 				  return (FUNCTIONTYPE); }
- [Oo]r				{ yylval.num = GXor;
- 				  return (FUNCTIONTYPE); }
- [Nn]or				{ yylval.num = GXnor;
- 				  return (FUNCTIONTYPE); }
- [Ee]quiv			{ yylval.num = GXequiv;
- 				  return (FUNCTIONTYPE); }
- [Ii]nvert			{ yylval.num = GXinvert;
- 				  return (FUNCTIONTYPE); }
- [Oo]rReverse			{ yylval.num = GXorReverse;
- 				  return (FUNCTIONTYPE); }
- [Cc]opyInverted			{ yylval.num = GXcopyInverted;
- 				  return (FUNCTIONTYPE); }
- [Oo]rInverted			{ yylval.num = GXorInverted;
- 				  return (FUNCTIONTYPE); }
- [Nn]and				{ yylval.num = GXnand;
- 				  return (FUNCTIONTYPE); }
- [Ss]et				{ yylval.num = GXset;
- 				  return (FUNCTIONTYPE); }
- 
- [Tt]est				{ return (TEST); }
- CopyArea			{ yylval.num = CopyArea;
- 				  return (TESTTYPE); }
- CopyPlane			{ yylval.num = CopyPlane;
- 				  return (TESTTYPE); }
- PolyPoint			{ yylval.num = PolyPoint;
- 				  return (TESTTYPE); }
- PolyLine			{ yylval.num = PolyLine;
- 				  return (TESTTYPE); }
- PolySegment			{ yylval.num = PolySegment;
- 				  return (TESTTYPE); }
- PolyRectangle			{ yylval.num = PolyRectangle;
- 				  return (TESTTYPE); }
- PolyArc				{ yylval.num = PolyArc;
- 				  return (TESTTYPE); }
- FillPolygon			{ yylval.num = FillPolygon;
- 				  return (TESTTYPE); }
- PolyFillRect			{ yylval.num = PolyFillRect;
- 				  return (TESTTYPE); }
- PolyFillArc			{ yylval.num = PolyFillArc;
- 				  return (TESTTYPE); }
- PutImage			{ yylval.num = PutImage;
- 				  return (TESTTYPE); }
- GetImage			{ yylval.num = GetImage;
- 				  return (TESTTYPE); }
- PolyText8			{ yylval.num = PolyText8;
- 				  return (TESTTYPE); }
- ImageText8			{ yylval.num = ImageText8;
- 				  return (TESTTYPE); }
- PolyText16			{ yylval.num = PolyText16;
- 				  return (TESTTYPE); }
- ImageText16			{ yylval.num = ImageText16;
- 				  return (TESTTYPE); }
- 
- [Ll]inestyle			{ return (LINESTYLE); }
- OnOffDash			{ yylval.num = LineOnOffDash;
- 				  return (LINESTYLETYPE); }
- DoubleDash			{ yylval.num = LineDoubleDash;
- 				  return (LINESTYLETYPE); }
- 
- [Cc]apstyle			{ return (CAPSTYLE); }
- NotLast				{ yylval.num = CapNotLast;
- 				  return (CAPSTYLETYPE); }
- Butt				{ yylval.num = CapButt;
- 				  return (CAPSTYLETYPE); }
- Projecting			{ yylval.num = CapProjecting;
- 				  return (CAPSTYLETYPE); }
- 
- [Jj]oinstyle			{ return (JOINSTYLE); }
- Miter				{ yylval.num = JoinMiter;
- 				  return (JOINSTYLETYPE); }
- Bevel				{ yylval.num = JoinBevel;
- 				  return (JOINSTYLETYPE); }
- 
- Round				{ return (ROUND); }
- 
- [Ff]illstyle			{ return (FILLSTYLE); }
- Tiled				{ yylval.num = FillTiled;
- 				  return (FILLSTYLETYPE); }
- Stippled			{ yylval.num = FillStippled;
- 				  return (FILLSTYLETYPE); }
- OpaqueStippled			{ yylval.num = FillOpaqueStippled;
- 				  return (FILLSTYLETYPE); }
- 
- Solid				{ return (SOLID); }
- 
- [Ff]illrule			{ return (FILLRULE); }
- EvenOdd				{ yylval.num = EvenOddRule;
- 				  return (FILLRULETYPE); }
- Winding				{ yylval.num = WindingRule;
- 				  return (FILLRULETYPE); }
- 
- [Aa]rcmode			{ return (ARCMODE); }
- Chord				{ yylval.num = ArcChord;
- 				  return (ARCMODETYPE); }
- PieSlice			{ yylval.num = ArcPieSlice;
- 				  return (ARCMODETYPE); }
- 
- [Ff]oreground			{ return (FOREGROUND); }
- [Bb]ackground			{ return (BACKGROUND); }
- [Ll]inewidth			{ return (LINEWIDTH); }
- [Pp]lanemask			{ return (PLANEMASK); }
- [Dd]ashlist			{ return (DASHLIST); }
- [Ff]ont				{ return (FONT); }
- [Pp]ercent			{ return (PERCENT); }
- 
- {number}			{ (void) sscanf (yytext, "%d", &yylval.num);
- 				  return (NUMBER); }
- {string}			{ yylval.ptr = (char *) yytext;
- 				  return (STRING); }
- \#[^\n]*\n			{ ; }
- [\t ]				{ ; }
- \n				{ return ('\n'); }
- 
- {word}				{ yylval.ptr = (char *) yytext;
- 				  return (STRING); }
- 
- .				{ fprintf(stderr,
- 					"xgc: bad character `%s', line %d\n",
- 					yytext, yylineno); }
- 
- %%
- 
- yywrap() { return (1); }
--- 0 ----
diff -c /dev/null mit/demos/xgc/lex.l1:1.3
*** /dev/null	Sat Mar 12 00:45:12 1994
--- mit/demos/xgc/lex.l1	Sat Mar 12 00:45:12 1994
***************
*** 0 ****
--- 1,6 ----
+ /* $XFree86: mit/demos/xgc/lex.l1,v 1.3 1993/03/27 08:54:05 dawes Exp $ */
+ /* Specs required by older versions of lex */
+ 
+ %p				4000
+ %a				3000
+ 
diff -c /dev/null mit/demos/xgc/lex.l2:1.2
*** /dev/null	Sat Mar 12 00:45:13 1994
--- mit/demos/xgc/lex.l2	Sat Mar 12 00:45:13 1994
***************
*** 0 ****
--- 1,167 ----
+ /* $XFree86: mit/demos/xgc/lex.l2,v 1.2 1993/03/27 08:54:07 dawes Exp $ */
+ /*
+ ** lex file for xgc syntax
+ */
+ 
+ /* Lots of stuff stolen from gwm's wool.lex */
+ 
+ %{
+ 
+ #include <X11/X.h>
+ #include "gram.h"
+ #include "constants.h"
+ 
+ int yylineno;
+ %}
+ 
+ /*%p				4000*/
+ /*%a				3000*/
+ 
+ number				[0-9]+
+ word				[^\n\t ]+
+ string				\"([^"]|\\.)*\"
+ 
+ %%
+ 
+ [Rr]un				{ return (RUN); }
+ 
+ [Ff]unction			{ return (FUNCTION); }
+ [Cc]lear			{ yylval.num = GXclear;
+ 				  return (FUNCTIONTYPE); }
+ [Aa]nd				{ yylval.num = GXand;
+ 				  return (FUNCTIONTYPE); }
+ [Aa]ndReverse			{ yylval.num = GXandReverse;
+ 				  return (FUNCTIONTYPE); }
+ [Cc]opy				{ yylval.num = GXcopy;
+ 				  return (FUNCTIONTYPE); }
+ [Aa]ndInverted			{ yylval.num = GXandInverted;
+ 				  return (FUNCTIONTYPE); }
+ [Nn]oop				{ yylval.num = GXnoop;
+ 				  return (FUNCTIONTYPE); }
+ [Xx]or				{ yylval.num = GXxor;
+ 				  return (FUNCTIONTYPE); }
+ [Oo]r				{ yylval.num = GXor;
+ 				  return (FUNCTIONTYPE); }
+ [Nn]or				{ yylval.num = GXnor;
+ 				  return (FUNCTIONTYPE); }
+ [Ee]quiv			{ yylval.num = GXequiv;
+ 				  return (FUNCTIONTYPE); }
+ [Ii]nvert			{ yylval.num = GXinvert;
+ 				  return (FUNCTIONTYPE); }
+ [Oo]rReverse			{ yylval.num = GXorReverse;
+ 				  return (FUNCTIONTYPE); }
+ [Cc]opyInverted			{ yylval.num = GXcopyInverted;
+ 				  return (FUNCTIONTYPE); }
+ [Oo]rInverted			{ yylval.num = GXorInverted;
+ 				  return (FUNCTIONTYPE); }
+ [Nn]and				{ yylval.num = GXnand;
+ 				  return (FUNCTIONTYPE); }
+ [Ss]et				{ yylval.num = GXset;
+ 				  return (FUNCTIONTYPE); }
+ 
+ [Tt]est				{ return (TEST); }
+ CopyArea			{ yylval.num = CopyArea;
+ 				  return (TESTTYPE); }
+ CopyPlane			{ yylval.num = CopyPlane;
+ 				  return (TESTTYPE); }
+ PolyPoint			{ yylval.num = PolyPoint;
+ 				  return (TESTTYPE); }
+ PolyLine			{ yylval.num = PolyLine;
+ 				  return (TESTTYPE); }
+ PolySegment			{ yylval.num = PolySegment;
+ 				  return (TESTTYPE); }
+ PolyRectangle			{ yylval.num = PolyRectangle;
+ 				  return (TESTTYPE); }
+ PolyArc				{ yylval.num = PolyArc;
+ 				  return (TESTTYPE); }
+ FillPolygon			{ yylval.num = FillPolygon;
+ 				  return (TESTTYPE); }
+ PolyFillRect			{ yylval.num = PolyFillRect;
+ 				  return (TESTTYPE); }
+ PolyFillArc			{ yylval.num = PolyFillArc;
+ 				  return (TESTTYPE); }
+ PutImage			{ yylval.num = PutImage;
+ 				  return (TESTTYPE); }
+ GetImage			{ yylval.num = GetImage;
+ 				  return (TESTTYPE); }
+ PolyText8			{ yylval.num = PolyText8;
+ 				  return (TESTTYPE); }
+ ImageText8			{ yylval.num = ImageText8;
+ 				  return (TESTTYPE); }
+ PolyText16			{ yylval.num = PolyText16;
+ 				  return (TESTTYPE); }
+ ImageText16			{ yylval.num = ImageText16;
+ 				  return (TESTTYPE); }
+ 
+ [Ll]inestyle			{ return (LINESTYLE); }
+ OnOffDash			{ yylval.num = LineOnOffDash;
+ 				  return (LINESTYLETYPE); }
+ DoubleDash			{ yylval.num = LineDoubleDash;
+ 				  return (LINESTYLETYPE); }
+ 
+ [Cc]apstyle			{ return (CAPSTYLE); }
+ NotLast				{ yylval.num = CapNotLast;
+ 				  return (CAPSTYLETYPE); }
+ Butt				{ yylval.num = CapButt;
+ 				  return (CAPSTYLETYPE); }
+ Projecting			{ yylval.num = CapProjecting;
+ 				  return (CAPSTYLETYPE); }
+ 
+ [Jj]oinstyle			{ return (JOINSTYLE); }
+ Miter				{ yylval.num = JoinMiter;
+ 				  return (JOINSTYLETYPE); }
+ Bevel				{ yylval.num = JoinBevel;
+ 				  return (JOINSTYLETYPE); }
+ 
+ Round				{ return (ROUND); }
+ 
+ [Ff]illstyle			{ return (FILLSTYLE); }
+ Tiled				{ yylval.num = FillTiled;
+ 				  return (FILLSTYLETYPE); }
+ Stippled			{ yylval.num = FillStippled;
+ 				  return (FILLSTYLETYPE); }
+ OpaqueStippled			{ yylval.num = FillOpaqueStippled;
+ 				  return (FILLSTYLETYPE); }
+ 
+ Solid				{ return (SOLID); }
+ 
+ [Ff]illrule			{ return (FILLRULE); }
+ EvenOdd				{ yylval.num = EvenOddRule;
+ 				  return (FILLRULETYPE); }
+ Winding				{ yylval.num = WindingRule;
+ 				  return (FILLRULETYPE); }
+ 
+ [Aa]rcmode			{ return (ARCMODE); }
+ Chord				{ yylval.num = ArcChord;
+ 				  return (ARCMODETYPE); }
+ PieSlice			{ yylval.num = ArcPieSlice;
+ 				  return (ARCMODETYPE); }
+ 
+ [Ff]oreground			{ return (FOREGROUND); }
+ [Bb]ackground			{ return (BACKGROUND); }
+ [Ll]inewidth			{ return (LINEWIDTH); }
+ [Pp]lanemask			{ return (PLANEMASK); }
+ [Dd]ashlist			{ return (DASHLIST); }
+ [Ff]ont				{ return (FONT); }
+ [Pp]ercent			{ return (PERCENT); }
+ 
+ {number}			{ (void) sscanf (yytext, "%d", &yylval.num);
+ 				  return (NUMBER); }
+ {string}			{ yylval.ptr = (char *) yytext;
+ 				  return (STRING); }
+ \#[^\n]*\n			{ ; }
+ [\t ]				{ ; }
+ \n				{ return ('\n'); }
+ 
+ {word}				{ yylval.ptr = (char *) yytext;
+ 				  return (STRING); }
+ 
+ .				{ fprintf(stderr,
+ 					"xgc: bad character `%s', line %d\n",
+ 					yytext, yylineno); }
+ 
+ %%
+ 
+ #ifndef yywrap
+ yywrap() { return (1); }
+ #endif
diff -c mit/demos/xgc/tests.c:1.1.1.1 mit/demos/xgc/tests.c:1.3
*** mit/demos/xgc/tests.c:1.1.1.1	Sat Mar 12 00:45:14 1994
--- mit/demos/xgc/tests.c	Sat Mar 12 00:45:14 1994
***************
*** 1,4 ****
--- 1,5 ----
  /*
+ ** $XFree86: mit/demos/xgc/tests.c,v 1.3 1993/03/25 14:16:22 dawes Exp $
  ** $XConsortium: tests.c,v 1.20 91/06/08 18:57:07 rws Exp $
  **
  */
***************
*** 13,19 ****
  #ifdef SVR4
  #define SYSV
  #endif
! #ifndef SYSV
  #include <sys/timeb.h>
  #include <sys/resource.h>
  #endif
--- 14,20 ----
  #ifdef SVR4
  #define SYSV
  #endif
! #if !defined(SYSV) && !defined(_MINIX)
  #include <sys/timeb.h>
  #include <sys/resource.h>
  #endif
***************
*** 50,56 ****
  timer(flag)
       int flag;
  {
! #ifndef SYSV
    static struct timeval starttime;  /* starting time for gettimeofday() */
    struct timeval endtime;           /* ending time for gettimeofday() */
    static struct rusage startusage;  /* starting time for getrusage() */
--- 51,57 ----
  timer(flag)
       int flag;
  {
! #if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX)
    static struct timeval starttime;  /* starting time for gettimeofday() */
    struct timeval endtime;           /* ending time for gettimeofday() */
    static struct rusage startusage;  /* starting time for getrusage() */
diff -c mit/demos/xgc/text.c:1.1.1.1 mit/demos/xgc/text.c:1.2
*** mit/demos/xgc/text.c:1.1.1.1	Sat Mar 12 00:45:15 1994
--- mit/demos/xgc/text.c	Sat Mar 12 00:45:15 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/xgc/text.c,v 1.2 1993/03/21 05:53:20 dawes Exp $ */
  /*
  ** xgc
  **
***************
*** 178,184 ****
    String oldtext;		/* the old text */
  
    static Arg textargs[] = {
!     {XtNstring, NULL}
    };
  
    /* Initialize the XawTextBlock. */
--- 179,185 ----
    String oldtext;		/* the old text */
  
    static Arg textargs[] = {
!     {XtNstring, (XtArgVal)NULL}
    };
  
    /* Initialize the XawTextBlock. */
diff -c mit/demos/xeyes/Eyes.c:1.1.1.1 mit/demos/xeyes/Eyes.c:1.4
*** mit/demos/xeyes/Eyes.c:1.1.1.1	Sat Mar 12 00:45:18 1994
--- mit/demos/xeyes/Eyes.c	Sat Mar 12 00:45:18 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/xeyes/Eyes.c,v 1.4 1993/03/20 05:23:51 dawes Exp $ */
  /* $XConsortium: Eyes.c,v 1.26 91/08/23 12:26:40 gildea Exp $ */
  /*
   * Copyright 1991 Massachusetts Institute of Technology
***************
*** 306,311 ****
--- 307,314 ----
  		cx = EYE_X(num);
  		cy = EYE_Y(num);
  	} else {
+ 		extern double hypot();
+ 
  		angle = atan2 ((double) dy, (double) dx);
  		cosa = cos (angle);
  		sina = sin (angle);
diff -c mit/demos/xgas/chamber.c:1.1.1.1 mit/demos/xgas/chamber.c:1.2
*** mit/demos/xgas/chamber.c:1.1.1.1	Sat Mar 12 00:45:20 1994
--- mit/demos/xgas/chamber.c	Sat Mar 12 00:45:20 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/xgas/chamber.c,v 1.2 1993/03/21 05:52:15 dawes Exp $ */
  /*
   * chamber.c -- Larry Medwin -- Dec. 18, 1989
   *   xgas: Copyright 1990 Larry Medwin: @(#)chamber.c	1.5 2/9/90
***************
*** 24,30 ****
      XGCValues values;
  
      /* Create GC for walls */
!     data->WallGC = XCreateGC( dpy, DefaultRootWindow(dpy), NULL, NULL);
      XSetForeground( dpy, data->WallGC, data->foreground);
  
      /* Create GC for molecules */
--- 25,31 ----
      XGCValues values;
  
      /* Create GC for walls */
!     data->WallGC = XCreateGC( dpy, DefaultRootWindow(dpy), 0, NULL);
      XSetForeground( dpy, data->WallGC, data->foreground);
  
      /* Create GC for molecules */
diff -c mit/demos/maze/Imakefile:1.1.1.1 mit/demos/maze/Imakefile:2.0
*** mit/demos/maze/Imakefile:1.1.1.1	Sat Mar 12 00:45:21 1994
--- mit/demos/maze/Imakefile	Sat Mar 12 00:45:22 1994
***************
*** 1,7 ****
  XCOMM $XConsortium: Imakefile,v 1.5 91/07/18 17:39:13 rws Exp $
          DEPLIBS = $(DEPXLIB)
  LOCAL_LIBRARIES = $(XLIB)
! #ifndef ConvexArchitecture
             SRCS = maze.c getopt.c 
             OBJS = maze.o getopt.o 
  #else
--- 1,8 ----
+ XCOMM $XFree86: mit/demos/maze/Imakefile,v 2.0 1993/10/24 13:42:16 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 1.5 91/07/18 17:39:13 rws Exp $
          DEPLIBS = $(DEPXLIB)
  LOCAL_LIBRARIES = $(XLIB)
! #if !defined(ConvexArchitecture) && !defined(Minix) && !defined(OsfArchitecture) && !defined(i386BsdArchitecture)
             SRCS = maze.c getopt.c 
             OBJS = maze.o getopt.o 
  #else
diff -c mit/demos/maze/getopt.c:1.1.1.1 mit/demos/maze/getopt.c:1.2
*** mit/demos/maze/getopt.c:1.1.1.1	Sat Mar 12 00:45:22 1994
--- mit/demos/maze/getopt.c	Sat Mar 12 00:45:22 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/maze/getopt.c,v 1.2 1993/03/20 05:20:36 dawes Exp $ */
  /*
  **  GETOPT PROGRAM AND LIBRARY ROUTINE
  **
***************
*** 34,40 ****
  		if(optind >= argc ||
  		   argv[optind][0] != '-' || argv[optind][1] == '\0')
  			return(EOF);
! 		else if(strcmp(argv[optind], "--") == NULL) {
  			optind++;
  			return(EOF);
  		}
--- 35,41 ----
  		if(optind >= argc ||
  		   argv[optind][0] != '-' || argv[optind][1] == '\0')
  			return(EOF);
! 		else if(strcmp(argv[optind], "--") == 0) {
  			optind++;
  			return(EOF);
  		}
diff -c mit/demos/puzzle/main.c:1.1.1.1 mit/demos/puzzle/main.c:1.3
*** mit/demos/puzzle/main.c:1.1.1.1	Sat Mar 12 00:45:23 1994
--- mit/demos/puzzle/main.c	Sat Mar 12 00:45:23 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/puzzle/main.c,v 1.3 1993/03/25 14:15:50 dawes Exp $ */
  /* $XConsortium: main.c,v 1.15 91/02/18 18:04:16 converse Exp $ */
  
  /* Puzzle - (C) Copyright 1987, 1988 Don Bennett.
***************
*** 26,31 ****
--- 27,40 ----
  #include <X11/Xlib.h>
  #include <X11/Xutil.h>
  
+ #ifdef _MINIX
+ /* BSD compatibility def */
+ struct timezone {
+     int  tz_minuteswest;
+     int  tz_dsttime;
+ };
+ #endif
+ 
  #include "ac.cursor"
  #include "ac_mask"
  
***************
*** 549,555 ****
  	ACCursor = XCreatePixmapCursor(dpy,ACPixmap,ACMask,
  				       &FGcolor,&BGcolor,
  				       ac_x_hot, ac_y_hot);
! 	if (ACCursor == NULL)
  	    error("Unable to store ArrowCrossCursor.");
      
  	XDefineCursor(dpy,PuzzleRoot,ACCursor);
--- 558,564 ----
  	ACCursor = XCreatePixmapCursor(dpy,ACPixmap,ACMask,
  				       &FGcolor,&BGcolor,
  				       ac_x_hot, ac_y_hot);
! 	if (ACCursor == 0)
  	    error("Unable to store ArrowCrossCursor.");
      
  	XDefineCursor(dpy,PuzzleRoot,ACCursor);
***************
*** 761,766 ****
--- 770,777 ----
      MoveSteps = (((long)MoveSteps) * timePerTile)/(delta ? delta : 1L);
      if (MoveSteps <= 0)
  	MoveSteps = 1;
+     if (MoveSteps >= MAX_STEPS)
+ 	MoveSteps = MAX_STEPS - 1;
  }
  
  CalculateStepsize()
diff -c mit/demos/xcmstest/TekCMS_LT.c:1.1.1.1 mit/demos/xcmstest/TekCMS_LT.c:1.2
*** mit/demos/xcmstest/TekCMS_LT.c:1.1.1.1	Sat Mar 12 00:45:25 1994
--- mit/demos/xcmstest/TekCMS_LT.c	Sat Mar 12 00:45:26 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/xcmstest/TekCMS_LT.c,v 1.2 1993/03/20 05:23:04 dawes Exp $ */
  /* $XConsortium: TekCMS_LT.c,v 1.7 91/05/31 19:14:10 rws Exp $ */
  
  /*
***************
*** 58,63 ****
--- 59,70 ----
  #include <sys/stat.h>
  #include <X11/Xcms.h>
  
+ #ifdef S_ISDIR
+ #define IS_DIRECTORY(mode)      S_ISDIR(mode)
+ #else
+ #define IS_DIRECTORY(mode)      ((mode & S_IFDIR) != 0)
+ #endif
+ 
  #ifdef AUTOHEADER
  #  include "TestInit.ah"
  #  include "TekCMS_TCI.ah"
***************
*** 589,595 ****
      /* Verify that it is a directory */
      if (stat(tmpstr, &statbuf) == 0) {
  	/* stat succeeded */
! 	if (statbuf.st_mode & S_IFDIR) {
  	    strcpy(TekCMS_idir, tmpstr);
  	    return(1);
  	}
--- 596,602 ----
      /* Verify that it is a directory */
      if (stat(tmpstr, &statbuf) == 0) {
  	/* stat succeeded */
! 	if (IS_DIRECTORY(statbuf.st_mode)) {
  	    strcpy(TekCMS_idir, tmpstr);
  	    return(1);
  	}
***************
*** 633,639 ****
      /* Verify that it is a directory */
      if (stat(tmpstr, &statbuf) == 0) {
  	/* stat succeeded */
! 	if (statbuf.st_mode & S_IFDIR) {
  	    strcpy(TekCMS_vdir, tmpstr);
  	    return(1);
  	}
--- 640,646 ----
      /* Verify that it is a directory */
      if (stat(tmpstr, &statbuf) == 0) {
  	/* stat succeeded */
! 	if (IS_DIRECTORY(statbuf.st_mode)) {
  	    strcpy(TekCMS_vdir, tmpstr);
  	    return(1);
  	}
***************
*** 677,683 ****
      /* Verify that it is a directory */
      if (stat(tmpstr, &statbuf) == 0) {
  	/* stat succeeded */
! 	if (statbuf.st_mode & S_IFDIR) {
  	    strcpy(TekCMS_rdir, tmpstr);
  	    return(1);
  	}
--- 684,690 ----
      /* Verify that it is a directory */
      if (stat(tmpstr, &statbuf) == 0) {
  	/* stat succeeded */
! 	if (IS_DIRECTORY(statbuf.st_mode)) {
  	    strcpy(TekCMS_rdir, tmpstr);
  	    return(1);
  	}
diff -c mit/demos/xcmstest/TestInit.c:1.1.1.1 mit/demos/xcmstest/TestInit.c:1.2
*** mit/demos/xcmstest/TestInit.c:1.1.1.1	Sat Mar 12 00:45:26 1994
--- mit/demos/xcmstest/TestInit.c	Sat Mar 12 00:45:26 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/xcmstest/TestInit.c,v 1.2 1993/03/20 05:23:07 dawes Exp $ */
  /* $XConsortium: TestInit.c,v 1.5 91/07/31 11:40:28 rws Exp $ */
  
  /*
***************
*** 124,129 ****
--- 125,135 ----
  #define N_FONTS ( sizeof(fontname)/sizeof(char *) )
  static Font	font[N_FONTS];
  
+ #ifdef S_ISDIR
+ #define IS_DIRECTORY(mode)	S_ISDIR(mode)
+ #else
+ #define IS_DIRECTORY(mode)	((mode & S_IFDIR) != 0)
+ #endif
  
  
  /*
***************
*** 267,283 ****
  
      /* check for the IDIR, RDIR and VDIR directories */
      if (stat(idir, &statbuf) == 0) {
! 	if (statbuf.st_mode & S_IFDIR) {
  	    strcpy(TekCMS_idir, idir);
  	}
      }
      if (stat(rdir, &statbuf) == 0) {
! 	if (statbuf.st_mode & S_IFDIR) {
  	    strcpy(TekCMS_rdir, rdir);
  	}
      }
      if (stat(vdir, &statbuf) == 0) {
! 	if (statbuf.st_mode & S_IFDIR) {
  	    strcpy(TekCMS_vdir, vdir);
  	}
      }
--- 273,289 ----
  
      /* check for the IDIR, RDIR and VDIR directories */
      if (stat(idir, &statbuf) == 0) {
! 	if (IS_DIRECTORY(statbuf.st_mode)) {
  	    strcpy(TekCMS_idir, idir);
  	}
      }
      if (stat(rdir, &statbuf) == 0) {
! 	if (IS_DIRECTORY(statbuf.st_mode)) {
  	    strcpy(TekCMS_rdir, rdir);
  	}
      }
      if (stat(vdir, &statbuf) == 0) {
! 	if (IS_DIRECTORY(statbuf.st_mode)) {
  	    strcpy(TekCMS_vdir, vdir);
  	}
      }
diff -c mit/fonts/PEX/Imakefile:1.1.1.1 mit/fonts/PEX/Imakefile:2.0
*** mit/fonts/PEX/Imakefile:1.1.1.1	Sat Mar 12 00:45:30 1994
--- mit/fonts/PEX/Imakefile	Sat Mar 12 00:45:30 1994
***************
*** 1,4 ****
--- 1,5 ----
  XCOMM
+ XCOMM $XFree86: mit/fonts/PEX/Imakefile,v 2.0 1993/06/26 12:43:00 dawes Exp $
  XCOMM $XConsortium: Imakefile,v 5.11 91/08/26 10:57:28 gildea Exp $
  XCOMM 
  XCOMM Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium.
***************
*** 40,46 ****
--- 41,51 ----
       YFLAGS = -d
  
    LINTFLAGS = -u
+ #ifdef LinuxArchitecture
+        LIBS = -lm
+ #else
         LIBS = -ll -lm
+ #endif
  
        FONTS = Roman Roman_M 
  
***************
*** 56,62 ****
  all:: to_wfont $(FONTS_BINARY)
  
  to_wfont.h to_wfont.c: to_wfont.y
! 	yacc -d to_wfont.y
  	$(MV) y.tab.c to_wfont.c
  	$(MV) y.tab.h to_wfont.h
  
--- 61,67 ----
  all:: to_wfont $(FONTS_BINARY)
  
  to_wfont.h to_wfont.c: to_wfont.y
! 	$(YACC) -d to_wfont.y
  	$(MV) y.tab.c to_wfont.c
  	$(MV) y.tab.h to_wfont.h
  
diff -c mit/fonts/PEX/lex.l:1.1.1.1 mit/fonts/PEX/lex.l:2.2
*** mit/fonts/PEX/lex.l:1.1.1.1	Sat Mar 12 00:45:30 1994
--- mit/fonts/PEX/lex.l	Sat Mar 12 00:45:30 1994
***************
*** 1,4 ****
--- 1,5 ----
  %{
+ /* $XFree86: mit/fonts/PEX/lex.l,v 2.2 1994/03/10 07:05:29 dawes Exp $ */
  /* $XConsortium: lex.l,v 5.4 91/08/26 10:55:26 gildea Exp $ */
  
  /*****************************************************************
***************
*** 25,37 ****
  
  ******************************************************************/
  
! 
  #include <ctype.h>
  #include <math.h>
  #include "to_wfont.h"
  
! #if defined(ISC) && defined(SYSV) && defined(SYSV386) && __STDC__
! extern double atof(char *);
  #endif
  
  %}
--- 26,42 ----
  
  ******************************************************************/
  
! #include <stdlib.h>
  #include <ctype.h>
  #include <math.h>
  #include "to_wfont.h"
  
! #if defined(ISC) && defined(__STDC__)
! #ifdef ISC30
! extern double atof(const char *);
! #else
! extern double atof();
! #endif
  #endif
  
  %}
***************
*** 63,68 ****
--- 68,76 ----
  			}
  [()]			;
  %%
+ #ifndef yywrap
+ yywrap() { return(1);}
+ #endif
  
  int
  res_words(str)
***************
*** 115,123 ****
  		str++;
  		n -= 2;	/* one for EOL, one for end quote */
  	}
! 	if ((yylval.cval = (char *)malloc(n)) != NULL)
  	{
  		strncpy(yylval.cval, str, n);
  		return STRING;
  	}
  	else
--- 123,132 ----
  		str++;
  		n -= 2;	/* one for EOL, one for end quote */
  	}
! 	if ((yylval.cval = (char *)malloc(n+1)) != NULL)
  	{
  		strncpy(yylval.cval, str, n);
+ 		yylval.cval[n] = '\0';
  		return STRING;
  	}
  	else
diff -c mit/fonts/PEX/to_wfont.y:1.1.1.1 mit/fonts/PEX/to_wfont.y:2.1
*** mit/fonts/PEX/to_wfont.y:1.1.1.1	Sat Mar 12 00:45:31 1994
--- mit/fonts/PEX/to_wfont.y	Sat Mar 12 00:45:31 1994
***************
*** 1,4 ****
--- 1,5 ----
  %{
+ /* $XFree86: mit/fonts/PEX/to_wfont.y,v 2.1 1994/02/10 21:23:00 dawes Exp $ */
  /* $XConsortium: to_wfont.y,v 5.3 91/04/04 16:00:26 gildea Exp $ */
  
  /*****************************************************************
***************
*** 327,333 ****
--- 328,338 ----
  
  yyerror()
  {
+ #if defined(linux) || (BSD >= 199103)
+ 	int      yylineno;
+ #else
  	extern int      yylineno;
+ #endif
  #	define ERR_SIZE (sizeof(err_string) / sizeof(char *))
  	static char    *err_string[] = {
  		"Cannot open file",
***************
*** 610,623 ****
  				free((char *) spath->pts.pt2df);
  		if (path->subpaths != NULL)
  			free((char *) path->subpaths);
  	free(table);
  	free(sp_table);
  	free(strokes);
! 	}
! 	for (i=0; i < head.num_props; i++, head.properties++) {
! 	  if (head.properties != NULL)
! 	    free((char *) head.properties);
! 	}
  }
  
  check_nstroke()
--- 615,625 ----
  				free((char *) spath->pts.pt2df);
  		if (path->subpaths != NULL)
  			free((char *) path->subpaths);
+ 	}
  	free(table);
  	free(sp_table);
  	free(strokes);
! 	free(head.properties);
  }
  
  check_nstroke()
diff -c mit/demos/gpc/bif_lex.c:1.1.1.1 mit/demos/gpc/bif_lex.c:1.2
*** mit/demos/gpc/bif_lex.c:1.1.1.1	Sat Mar 12 00:45:37 1994
--- mit/demos/gpc/bif_lex.c	Sat Mar 12 00:45:37 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/gpc/bif_lex.c,v 1.2 1993/05/18 15:34:58 dawes Exp $ */
  /* $XConsortium: bif_lex.c,v 5.3 91/06/17 19:52:19 rws Exp $ */
  /***********************************************************
  Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium at M.I.T.
***************
*** 389,398 ****
  
  	static Yylex_info yylex_info =
  	{
! 		NULL,  NULL,  NULL,
! 		NULL,  NULL,
! 		NULL,  NULL,  NULL,
! 		NULL,
  		"no_file",
  		&yylval
  	};
--- 390,399 ----
  
  	static Yylex_info yylex_info =
  	{
! 		0,  0,  0,
! 		0,  0,
! 		0,  0,  0,
! 		0,
  		"no_file",
  		&yylval
  	};
diff -c mit/demos/gpc/brf_set.h:1.1.1.1 mit/demos/gpc/brf_set.h:1.2
*** mit/demos/gpc/brf_set.h:1.1.1.1	Sat Mar 12 00:45:38 1994
--- mit/demos/gpc/brf_set.h	Sat Mar 12 00:45:38 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/gpc/brf_set.h,v 1.2 1993/05/18 15:35:03 dawes Exp $ */
  /* $XConsortium: brf_set.h,v 5.1 91/02/16 10:07:18 rws Exp $ */
  
  /*
***************
*** 36,42 ****
  \*--------------------------------------------------------------------*/
  BRF_Any_With_Data total_with_data =
  {
! 	NULL,
  	NULL,
  	NULL,
  	do_brfgeneric,
--- 37,43 ----
  \*--------------------------------------------------------------------*/
  BRF_Any_With_Data total_with_data =
  {
! 	0,
  	NULL,
  	NULL,
  	do_brfgeneric,
diff -c mit/demos/gpc/brfexmacro.h:1.1.1.1 mit/demos/gpc/brfexmacro.h:1.2
*** mit/demos/gpc/brfexmacro.h:1.1.1.1	Sat Mar 12 00:45:38 1994
--- mit/demos/gpc/brfexmacro.h	Sat Mar 12 00:45:38 1994
***************
*** 1,3 ****
--- 1,4 ----
+ /* $XFree86: mit/demos/gpc/brfexmacro.h,v 1.2 1993/05/18 15:35:06 dawes Exp $ */
  /* $XConsortium: brfexmacro.h,v 5.2 91/04/04 13:32:56 gildea Exp $ */
  
  /*--------------------------------------------------------------------*\
***************
*** 38,52 ****
  
  #define INIT_LIST(item)\
  {\
!         brf_exception[item].brf_ex_type = NULL;\
          brf_exception[item].brf_ex_flag = BRF_OK;\
!         brf_exception[item].brf_ex_optional[VCOLORT] = NULL;\
!         brf_exception[item].brf_ex_optional[VCOLORI] = NULL;\
!         brf_exception[item].brf_ex_optional[VNORM] = NULL;\
!         brf_exception[item].brf_ex_optional[FCOLORT] = NULL;\
!         brf_exception[item].brf_ex_optional[FCOLORI] = NULL;\
!         brf_exception[item].brf_ex_optional[FNORM] = NULL;\
!         brf_exception[item].brf_ex_optional[EDATA] = NULL;\
          brf_exception[item].brf_ex_range[RANGESTART] = NO_RANGE_DATA;\
          brf_exception[item].brf_ex_range[RANGESTOP] = NO_RANGE_DATA;\
          brf_exception[item].brf_ex_rrange[RANGESTART] = NO_RANGE_DATA;\
--- 39,53 ----
  
  #define INIT_LIST(item)\
  {\
!         brf_exception[item].brf_ex_type = 0;\
          brf_exception[item].brf_ex_flag = BRF_OK;\
!         brf_exception[item].brf_ex_optional[VCOLORT] = 0;\
!         brf_exception[item].brf_ex_optional[VCOLORI] = 0;\
!         brf_exception[item].brf_ex_optional[VNORM] = 0;\
!         brf_exception[item].brf_ex_optional[FCOLORT] = 0;\
!         brf_exception[item].brf_ex_optional[FCOLORI] = 0;\
!         brf_exception[item].brf_ex_optional[FNORM] = 0;\
!         brf_exception[item].brf_ex_optional[EDATA] = 0;\
          brf_exception[item].brf_ex_range[RANGESTART] = NO_RANGE_DATA;\
          brf_exception[item].brf_ex_range[RANGESTOP] = NO_RANGE_DATA;\
          brf_exception[item].brf_ex_rrange[RANGESTART] = NO_RANGE_DATA;\